nbdkit-1.42.2/0000755000175000017500000000000014771247244006630 5nbdkit-1.42.2/html/0000755000175000017500000000000014771247240007570 5nbdkit-1.42.2/html/pod.css0000644000175000017500000000464514534316443011014 /* CSS to make pod2html files look a little bit better. */ body { margin-left: 4em; } body p, body ul, ol, body dl { margin-left: 2em; width: 31em; } pre { width: 31em; } li { padding-bottom: 0.5em; } /* Code sections. */ pre { background-color: #f8f8f8; color: rgb(204,0,0); font-weight: 550; border-left: 6px solid rgb(204,64,64); padding: 6px; margin-left: 1em; font-size: 120%; } /* Bold, italic in man pages. */ b, strong { color: rgb(204,0,0); } i, em { color: rgb(204,0,0); } /* Name heading. */ body > h1:first-of-type { display: none; } body > h1:first-of-type + p { font-size: 125%; font-weight: bold; color: rgb(204,0,0); margin-left: -32px; } /* Warning heading in man pages. */ a[name="warning"] { -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; border-radius-topleft: 5px; border-radius-topright: 5px; color: white; background-color: rgb(204,0,0); } a[name="warning"]:before { content: "\00a0\00a0\00a0"; } a[name="warning"]:after { content: "\00a0\00a0\00a0"; } /* Put the index on the right hand side in a floating box. */ ul[id="index"] { float: right; width: 18em; border-left: 3em solid white; background-color: #fcfcfc; margin-top: 32px; padding-top: 0px; margin-left: 1em; padding-left: 1em; padding-right: 1em; font-size: 90%; } ul[id="index"] a[href] { text-decoration: none; } ul[id="index"] a[href]:hover { text-decoration: underline; } ul[id="index"] a[href]:before { content: '#\00a0'; color: rgb(204,0,0); font-size: x-small; } ul[id="index"] { width: 17em; list-style: none; margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; } ul[id="index"] > li { margin-bottom: 0.5em; } ul[id="index"] > li ul { width: 16em; list-style: none; margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; margin-bottom: 0.5em; } ul[id="index"] > li ul li { display: inline; margin-right: 1em; } /* ul[id="index"] > li ul li:after { color: #ccc; content: '\2014'; } */ /* Get rid of those horrible
's :-( */ hr { display: none; } /* Demote

's and set rest of headers relative. */ h1 { font-size: 100%; color: black; border-bottom: solid 1px rgb(204,0,0); } h2 { font-size: 95%; border-bottom: none; } h3 { font-size: 90%; } h4 { font-size: 85%; } nbdkit-1.42.2/m4/0000755000175000017500000000000014771247240007144 5nbdkit-1.42.2/m4/ax_pthread.m40000644000175000017500000005403414534316443011452 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is # needed for multi-threaded programs (defaults to the value of CC # respectively CXX otherwise). (This is necessary on e.g. AIX to use the # special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # Copyright (c) 2019 Marc Stevens # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items with a "," contain both # C compiler flags (before ",") and linker flags (after ","). Other items # starting with a "-" are C compiler flags, and remaining items are # library names, except for "none" which indicates that we try without # any flags at all, and "pthread-config" which is a program returning # the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], [ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif ], [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac # Are we compiling with Clang? AC_CACHE_CHECK([whether $CC is Clang], [ax_cv_PTHREAD_CLANG], [ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif ], [ax_cv_PTHREAD_CLANG=yes]) fi ]) ax_pthread_clang="$ax_cv_PTHREAD_CLANG" # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) # Note that for GCC and Clang -pthread generally implies -lpthread, # except when -nostdlib is passed. # This is problematic using libtool to build C++ shared libraries with pthread: # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 # [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 # [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 # To solve this, first try -pthread together with -lpthread for GCC AS_IF([test "x$GCC" = "xyes"], [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) # Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first AS_IF([test "x$ax_pthread_clang" = "xyes"], [ax_pthread_flags="-pthread,-lpthread -pthread"]) # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac AS_IF([test "x$ax_pthread_check_macro" = "x--"], [ax_pthread_check_cond=0], [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; *,*) PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void *some_global = NULL; static void routine(void *a) { /* To avoid any unused-parameter or unused-but-set-parameter warning. */ some_global = a; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [ac_link="$ax_pthread_2step_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [break]) ]) done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ]) case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_CACHE_CHECK([for joinable pthread attribute], [ax_cv_PTHREAD_JOINABLE_ATTR], [ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $ax_pthread_attr; return attr /* ; */])], [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], []) done ]) AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"], [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$ax_cv_PTHREAD_JOINABLE_ATTR], [Define to necessary symbol if this constant uses a non-standard name on your system.]) ax_pthread_joinable_attr_defined=yes ]) AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ]) AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"], [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT; return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) ax_pthread_prio_inherit_defined=yes ]) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], [ AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) ], [ AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) ] ) ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD nbdkit-1.42.2/m4/libtool.m40000644000175000017500000112776414771245443011017 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 59 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS nbdkit-1.42.2/m4/ltoptions.m40000644000175000017500000003427514771245444011400 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) nbdkit-1.42.2/m4/ltsugar.m40000644000175000017500000001045314771245444011016 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) nbdkit-1.42.2/m4/ltversion.m40000644000175000017500000000131214771245444011354 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) nbdkit-1.42.2/m4/lt~obsolete.m40000644000175000017500000001400714771245444011706 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) nbdkit-1.42.2/m4/ocaml.m40000644000175000017500000001345014534316443010423 dnl autoconf macros for OCaml dnl dnl Copyright © 2009 Richard W.M. Jones dnl Copyright © 2009 Stefano Zacchiroli dnl Copyright © 2000-2005 Olivier Andrieu dnl Copyright © 2000-2005 Jean-Christophe Filliâtre dnl Copyright © 2000-2005 Georges Mariano dnl dnl For documentation, please read the ocaml.m4 man page. AC_DEFUN([AC_PROG_OCAML], [dnl # checking for ocamlc AC_CHECK_TOOL([OCAMLC],[ocamlc],[no]) if test "$OCAMLC" != "no"; then OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` AC_MSG_RESULT([OCaml version is $OCAMLVERSION]) # If OCAMLLIB is set, use it if test "$OCAMLLIB" = ""; then OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` else AC_MSG_RESULT([OCAMLLIB previously set; preserving it.]) fi AC_MSG_RESULT([OCaml library path is $OCAMLLIB]) AC_SUBST([OCAMLVERSION]) AC_SUBST([OCAMLLIB]) # checking for ocamlopt AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no]) OCAMLBEST=byte if test "$OCAMLOPT" = "no"; then AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.]) else TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.]) OCAMLOPT=no else OCAMLBEST=opt fi fi AC_SUBST([OCAMLBEST]) # checking for ocamlc.opt AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no]) if test "$OCAMLCDOTOPT" != "no"; then TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.]) else OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != "no" ; then AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no]) if test "$OCAMLOPTDOTOPT" != "no"; then TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.]) else OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi AC_SUBST([OCAMLOPT]) fi AC_SUBST([OCAMLC]) # checking for ocaml toplevel AC_CHECK_TOOL([OCAML],[ocaml],[no]) # checking for ocamldep AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no]) # checking for ocamlmktop AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no]) # checking for ocamlmklib AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no]) # checking for ocamldoc AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no]) # checking for ocamlbuild AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no]) ]) AC_DEFUN([AC_PROG_OCAMLLEX], [dnl # checking for ocamllex AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no]) if test "$OCAMLLEX" != "no"; then AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no]) if test "$OCAMLLEXDOTOPT" != "no"; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi AC_SUBST([OCAMLLEX]) ]) AC_DEFUN([AC_PROG_OCAMLYACC], [dnl AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no]) AC_SUBST([OCAMLYACC]) ]) AC_DEFUN([AC_PROG_CAMLP4], [dnl AC_REQUIRE([AC_PROG_OCAML])dnl # checking for camlp4 AC_CHECK_TOOL([CAMLP4],[camlp4],[no]) if test "$CAMLP4" != "no"; then TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT([versions differs from ocamlc]) CAMLP4=no fi fi AC_SUBST([CAMLP4]) # checking for companion tools AC_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no]) AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no]) AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no]) AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no]) AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no]) AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no]) AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no]) AC_CHECK_TOOL([CAMLP4RF],[camlp4rf],[no]) AC_SUBST([CAMLP4BOOT]) AC_SUBST([CAMLP4O]) AC_SUBST([CAMLP4OF]) AC_SUBST([CAMLP4OOF]) AC_SUBST([CAMLP4ORF]) AC_SUBST([CAMLP4PROF]) AC_SUBST([CAMLP4R]) AC_SUBST([CAMLP4RF]) ]) AC_DEFUN([AC_PROG_FINDLIB], [dnl AC_REQUIRE([AC_PROG_OCAML])dnl # checking for ocamlfind AC_CHECK_TOOL([OCAMLFIND],[ocamlfind],[no]) AC_SUBST([OCAMLFIND]) ]) dnl Thanks to Jim Meyering for working this next bit out for us. dnl XXX We should define AS_TR_SH if it's not defined already dnl (eg. for old autoconf). AC_DEFUN([AC_CHECK_OCAML_PKG], [dnl AC_REQUIRE([AC_PROG_FINDLIB])dnl AC_MSG_CHECKING([for OCaml findlib package $1]) unset found unset pkg found=no for pkg in $1 $2 ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then AC_MSG_RESULT([found]) AS_TR_SH([OCAML_PKG_$1])=$pkg found=yes break fi done if test "$found" = "no" ; then AC_MSG_RESULT([not found]) AS_TR_SH([OCAML_PKG_$1])=no fi AC_SUBST(AS_TR_SH([OCAML_PKG_$1])) ]) AC_DEFUN([AC_CHECK_OCAML_MODULE], [dnl AC_MSG_CHECKING([for OCaml module $2]) cat > conftest.ml <&5 2>&5 ; then found=yes break fi done if test "$found" ; then AC_MSG_RESULT([$$1]) else AC_MSG_RESULT([not found]) $1=no fi AC_SUBST([$1]) ]) dnl XXX Cross-compiling AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE], [dnl AC_REQUIRE([AC_PROG_OCAML])dnl AC_MSG_CHECKING([for OCaml compiler word size]) cat > conftest.ml < conftest.ml < #include #include #include enum { HELP_OPTION = CHAR_MAX + 1, DUMP_CONFIG_OPTION, DUMP_PLUGIN_OPTION, EXIT_WITH_PARENT_OPTION, FILTER_OPTION, KEEPALIVE_OPTION, LOG_OPTION, LONG_OPTIONS_OPTION, MASK_HANDSHAKE_OPTION, NO_MC_OPTION, NO_SR_OPTION, PRINT_URI, RUN_OPTION, SELINUX_LABEL_OPTION, SHORT_OPTIONS_OPTION, SWAP_OPTION, TIMEOUT_OPTION, TLS_OPTION, TLS_CERTIFICATES_OPTION, TLS_PSK_OPTION, TLS_VERIFY_PEER_OPTION, VSOCK_OPTION, }; static const char *short_options = "46D:e:fg:i:nop:P:rst:u:U:vV"; static const struct option long_options[] = { { "ipv4-only", no_argument, NULL, '4' }, { "ipv6-only", no_argument, NULL, '6' }, { "debug", required_argument, NULL, 'D' }, { "dump-config", no_argument, NULL, DUMP_CONFIG_OPTION }, { "dump-plugin", no_argument, NULL, DUMP_PLUGIN_OPTION }, { "exit-with-parent", no_argument, NULL, EXIT_WITH_PARENT_OPTION }, { "export", required_argument, NULL, 'e' }, { "export-name", required_argument, NULL, 'e' }, { "exportname", required_argument, NULL, 'e' }, { "filter", required_argument, NULL, FILTER_OPTION }, { "foreground", no_argument, NULL, 'f' }, { "no-fork", no_argument, NULL, 'f' }, { "group", required_argument, NULL, 'g' }, { "help", no_argument, NULL, HELP_OPTION }, { "ip-addr", required_argument, NULL, 'i' }, { "ipaddr", required_argument, NULL, 'i' }, { "keepalive", no_argument, NULL, KEEPALIVE_OPTION }, { "keep-alive", no_argument, NULL, KEEPALIVE_OPTION }, { "log", required_argument, NULL, LOG_OPTION }, { "long-options", no_argument, NULL, LONG_OPTIONS_OPTION }, { "mask-handshake", required_argument, NULL, MASK_HANDSHAKE_OPTION }, { "new-style", no_argument, NULL, 'n' }, { "newstyle", no_argument, NULL, 'n' }, { "no-mc", no_argument, NULL, NO_MC_OPTION }, { "no-meta-contexts", no_argument, NULL, NO_MC_OPTION }, { "no-sr", no_argument, NULL, NO_SR_OPTION }, { "no-structured-replies", no_argument, NULL, NO_SR_OPTION }, { "old-style", no_argument, NULL, 'o' }, { "oldstyle", no_argument, NULL, 'o' }, { "pid-file", required_argument, NULL, 'P' }, { "pidfile", required_argument, NULL, 'P' }, { "print-uri", no_argument, NULL, PRINT_URI }, { "print-url", no_argument, NULL, PRINT_URI }, { "port", required_argument, NULL, 'p' }, { "read-only", no_argument, NULL, 'r' }, { "readonly", no_argument, NULL, 'r' }, { "run", required_argument, NULL, RUN_OPTION }, { "selinux-label", required_argument, NULL, SELINUX_LABEL_OPTION }, { "short-options", no_argument, NULL, SHORT_OPTIONS_OPTION }, { "show-uri", no_argument, NULL, PRINT_URI }, { "show-url", no_argument, NULL, PRINT_URI }, { "single", no_argument, NULL, 's' }, { "stdin", no_argument, NULL, 's' }, { "swap", no_argument, NULL, SWAP_OPTION }, { "threads", required_argument, NULL, 't' }, { "timeout", required_argument, NULL, TIMEOUT_OPTION }, { "time-out", required_argument, NULL, TIMEOUT_OPTION }, { "tls", required_argument, NULL, TLS_OPTION }, { "tls-certificates", required_argument, NULL, TLS_CERTIFICATES_OPTION }, { "tls-psk", required_argument, NULL, TLS_PSK_OPTION }, { "tls-verify-peer", no_argument, NULL, TLS_VERIFY_PEER_OPTION }, { "unix", required_argument, NULL, 'U' }, { "user", required_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'V' }, { "vsock", no_argument, NULL, VSOCK_OPTION }, { NULL }, }; /* Is it a plugin or filter name relative to the plugindir/filterdir? */ static inline bool is_short_name (const char *filename) { const size_t n = strlen (filename); size_t i; for (i = 0; i < n; ++i) { switch (filename[i]) { case '/': case '\\': /* directory separators */ case ':': case ';': /* path separators */ case ' ': case '.': case ',': case '=': /* nbdkit parameter separator */ return false; /* non-printable ASCII */ case 127: return false; default: if ((unsigned)filename[i] <= 31) return false; } } return strstr (filename, DIR_SEPARATOR_STR) == NULL; } #endif /* NBDKIT_OPTIONS_H */ nbdkit-1.42.2/server/Makefile.am0000644000175000017500000001211714771245250012107 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = nbdkit.syms sbin_PROGRAMS = nbdkit nbdkit_SOURCES = \ backend.c \ background.c \ captive.c \ connections.c \ crypto.c \ debug.c \ debug-flags.c \ exports.c \ extents.c \ filters.c \ internal.h \ locks.c \ log.c \ log-stderr.c \ log-syslog.c \ main.c \ options.h \ plugins.c \ protocol.c \ protocol-handshake.c \ protocol-handshake-oldstyle.c \ protocol-handshake-newstyle.c \ public.c \ quit.c \ signals.c \ socket-activation.c \ sockets.c \ synopsis.c \ threadlocal.c \ timeout.c \ uri.c \ usergroup.c \ vfprintf.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(top_srcdir)/include/nbdkit-filter.h \ $(NULL) if ENABLE_LIBFUZZER nbdkit_SOURCES += fuzzer.c endif nbdkit_CPPFLAGS = \ -Dbindir=\"$(bindir)\" \ -Dlibdir=\"$(libdir)\" \ -Dmandir=\"$(mandir)\" \ -Dplugindir=\"$(plugindir)\" \ -Dfilterdir=\"$(filterdir)\" \ -Dsbindir=\"$(sbindir)\" \ -Dsysconfdir=\"$(sysconfdir)\" \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/protocol \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/utils \ $(NULL) nbdkit_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(WARNINGS_CFLAGS) \ $(GNUTLS_CFLAGS) \ $(LIBSELINUX_CFLAGS) \ $(VALGRIND_CFLAGS) \ $(NULL) nbdkit_LDADD = \ $(GNUTLS_LIBS) \ $(LIBSELINUX_LIBS) \ $(DL_LIBS) \ $(RT_LIBS) \ $(top_builddir)/common/protocol/libprotocol.la \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ -lm \ $(NULL) nbdkit_LDFLAGS = \ $(PTHREAD_LIBS) \ $(DL_LDFLAGS) \ $(NULL) EXTRA_nbdkit_DEPENDENCIES = nbdkit.syms if USE_LINKER_SCRIPT nbdkit_LDFLAGS += -Wl,--version-script=$(srcdir)/nbdkit.syms endif if IS_WINDOWS # On Windows, generate an import library so that plugins can link # against the executable. # https://stackoverflow.com/a/18147774 # https://sourceforge.net/p/mingw/mailman/mingw-users/thread/43694A03.2050503%40cox.net/ # https://stackoverflow.com/questions/20007973/how-do-i-generate-an-import-lib-for-an-exe-using-automake-autoconf-libtool/20363801#20363801 lib_LIBRARIES = libnbdkit.a libnbdkit.a: nbdkit$(EXEEXT) nbdkit.def $(LIBTOOL) --mode=execute \ $(DLLTOOL) -v $< -D nbdkit.exe -d nbdkit.def -l $@ nbdkit.def: nbdkit.syms rm -f $@ $@-t echo '; Generated from $<' > $@-t echo 'EXPORTS' >> $@-t $(SED) -n -e 's/.*\(nbdkit_[a-z0-9_]*\);.*/\t\1/p' < $< >> $@-t mv $@-t $@ chmod 0444 $@ # Annoyingly this is required for make dist. libnbdkit_a_SOURCES = endif # synopsis.c is generated from docs/synopsis.txt where it is also # used to generate the man page. BUILT_SOURCES = synopsis.c CLEANFILES += synopsis.c synopsis.c: $(top_srcdir)/docs/synopsis.txt Makefile.am rm -f $@ $@-t echo "/* DO NOT EDIT! Generated from $< */" > $@-t echo >> $@-t echo "const char *synopsis =" >> $@-t $(SED) -e 's/"/\\"/g' -e 's/\(.*\)/ "\1\\n"/g' $< >> $@-t echo " ;" >> $@-t mv $@-t $@ # pkg-config / pkgconf pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = nbdkit.pc # Unit testing TESTS = test-public check_PROGRAMS = test-public test_public_SOURCES = \ test-public.c \ public.c \ exports.c \ extents.c \ $(NULL) test_public_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/protocol \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/utils \ $(NULL) test_public_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(WARNINGS_CFLAGS) \ $(VALGRIND_CFLAGS) \ $(NULL) test_public_LDFLAGS = \ $(PTHREAD_LIBS) \ $(NULL) test_public_LDADD = \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ -lm \ $(NULL) nbdkit-1.42.2/server/Makefile.in0000644000175000017500000036250014771245450012126 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = nbdkit$(EXEEXT) @ENABLE_LIBFUZZER_TRUE@am__append_1 = fuzzer.c @USE_LINKER_SCRIPT_TRUE@am__append_2 = -Wl,--version-script=$(srcdir)/nbdkit.syms TESTS = test-public$(EXEEXT) check_PROGRAMS = test-public$(EXEEXT) subdir = server ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = nbdkit.pc CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(pkgconfigdir)" PROGRAMS = $(sbin_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } LIBRARIES = $(lib_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libnbdkit_a_AR = $(AR) $(ARFLAGS) libnbdkit_a_LIBADD = am_libnbdkit_a_OBJECTS = libnbdkit_a_OBJECTS = $(am_libnbdkit_a_OBJECTS) am__nbdkit_SOURCES_DIST = backend.c background.c captive.c \ connections.c crypto.c debug.c debug-flags.c exports.c \ extents.c filters.c internal.h locks.c log.c log-stderr.c \ log-syslog.c main.c options.h plugins.c protocol.c \ protocol-handshake.c protocol-handshake-oldstyle.c \ protocol-handshake-newstyle.c public.c quit.c signals.c \ socket-activation.c sockets.c synopsis.c threadlocal.c \ timeout.c uri.c usergroup.c vfprintf.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(top_srcdir)/include/nbdkit-filter.h fuzzer.c am__objects_1 = @ENABLE_LIBFUZZER_TRUE@am__objects_2 = nbdkit-fuzzer.$(OBJEXT) am_nbdkit_OBJECTS = nbdkit-backend.$(OBJEXT) \ nbdkit-background.$(OBJEXT) nbdkit-captive.$(OBJEXT) \ nbdkit-connections.$(OBJEXT) nbdkit-crypto.$(OBJEXT) \ nbdkit-debug.$(OBJEXT) nbdkit-debug-flags.$(OBJEXT) \ nbdkit-exports.$(OBJEXT) nbdkit-extents.$(OBJEXT) \ nbdkit-filters.$(OBJEXT) nbdkit-locks.$(OBJEXT) \ nbdkit-log.$(OBJEXT) nbdkit-log-stderr.$(OBJEXT) \ nbdkit-log-syslog.$(OBJEXT) nbdkit-main.$(OBJEXT) \ nbdkit-plugins.$(OBJEXT) nbdkit-protocol.$(OBJEXT) \ nbdkit-protocol-handshake.$(OBJEXT) \ nbdkit-protocol-handshake-oldstyle.$(OBJEXT) \ nbdkit-protocol-handshake-newstyle.$(OBJEXT) \ nbdkit-public.$(OBJEXT) nbdkit-quit.$(OBJEXT) \ nbdkit-signals.$(OBJEXT) nbdkit-socket-activation.$(OBJEXT) \ nbdkit-sockets.$(OBJEXT) nbdkit-synopsis.$(OBJEXT) \ nbdkit-threadlocal.$(OBJEXT) nbdkit-timeout.$(OBJEXT) \ nbdkit-uri.$(OBJEXT) nbdkit-usergroup.$(OBJEXT) \ nbdkit-vfprintf.$(OBJEXT) $(am__objects_1) $(am__objects_2) nbdkit_OBJECTS = $(am_nbdkit_OBJECTS) am__DEPENDENCIES_1 = nbdkit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/common/protocol/libprotocol.la \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(nbdkit_CFLAGS) $(CFLAGS) \ $(nbdkit_LDFLAGS) $(LDFLAGS) -o $@ am_test_public_OBJECTS = test_public-test-public.$(OBJEXT) \ test_public-public.$(OBJEXT) test_public-exports.$(OBJEXT) \ test_public-extents.$(OBJEXT) $(am__objects_1) test_public_OBJECTS = $(am_test_public_OBJECTS) test_public_DEPENDENCIES = $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ $(am__DEPENDENCIES_1) test_public_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_public_CFLAGS) \ $(CFLAGS) $(test_public_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit-backend.Po \ ./$(DEPDIR)/nbdkit-background.Po ./$(DEPDIR)/nbdkit-captive.Po \ ./$(DEPDIR)/nbdkit-connections.Po ./$(DEPDIR)/nbdkit-crypto.Po \ ./$(DEPDIR)/nbdkit-debug-flags.Po ./$(DEPDIR)/nbdkit-debug.Po \ ./$(DEPDIR)/nbdkit-exports.Po ./$(DEPDIR)/nbdkit-extents.Po \ ./$(DEPDIR)/nbdkit-filters.Po ./$(DEPDIR)/nbdkit-fuzzer.Po \ ./$(DEPDIR)/nbdkit-locks.Po ./$(DEPDIR)/nbdkit-log-stderr.Po \ ./$(DEPDIR)/nbdkit-log-syslog.Po ./$(DEPDIR)/nbdkit-log.Po \ ./$(DEPDIR)/nbdkit-main.Po ./$(DEPDIR)/nbdkit-plugins.Po \ ./$(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po \ ./$(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po \ ./$(DEPDIR)/nbdkit-protocol-handshake.Po \ ./$(DEPDIR)/nbdkit-protocol.Po ./$(DEPDIR)/nbdkit-public.Po \ ./$(DEPDIR)/nbdkit-quit.Po ./$(DEPDIR)/nbdkit-signals.Po \ ./$(DEPDIR)/nbdkit-socket-activation.Po \ ./$(DEPDIR)/nbdkit-sockets.Po ./$(DEPDIR)/nbdkit-synopsis.Po \ ./$(DEPDIR)/nbdkit-threadlocal.Po \ ./$(DEPDIR)/nbdkit-timeout.Po ./$(DEPDIR)/nbdkit-uri.Po \ ./$(DEPDIR)/nbdkit-usergroup.Po ./$(DEPDIR)/nbdkit-vfprintf.Po \ ./$(DEPDIR)/test_public-exports.Po \ ./$(DEPDIR)/test_public-extents.Po \ ./$(DEPDIR)/test_public-public.Po \ ./$(DEPDIR)/test_public-test-public.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libnbdkit_a_SOURCES) $(nbdkit_SOURCES) \ $(test_public_SOURCES) DIST_SOURCES = $(libnbdkit_a_SOURCES) $(am__nbdkit_SOURCES_DIST) \ $(test_public_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/nbdkit.pc.in \ $(top_srcdir)/common-rules.mk $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll synopsis.c EXTRA_DIST = nbdkit.syms nbdkit_SOURCES = backend.c background.c captive.c connections.c \ crypto.c debug.c debug-flags.c exports.c extents.c filters.c \ internal.h locks.c log.c log-stderr.c log-syslog.c main.c \ options.h plugins.c protocol.c protocol-handshake.c \ protocol-handshake-oldstyle.c protocol-handshake-newstyle.c \ public.c quit.c signals.c socket-activation.c sockets.c \ synopsis.c threadlocal.c timeout.c uri.c usergroup.c \ vfprintf.c $(top_srcdir)/include/nbdkit-plugin.h \ $(top_srcdir)/include/nbdkit-filter.h $(NULL) $(am__append_1) nbdkit_CPPFLAGS = \ -Dbindir=\"$(bindir)\" \ -Dlibdir=\"$(libdir)\" \ -Dmandir=\"$(mandir)\" \ -Dplugindir=\"$(plugindir)\" \ -Dfilterdir=\"$(filterdir)\" \ -Dsbindir=\"$(sbindir)\" \ -Dsysconfdir=\"$(sysconfdir)\" \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/protocol \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/utils \ $(NULL) nbdkit_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(WARNINGS_CFLAGS) \ $(GNUTLS_CFLAGS) \ $(LIBSELINUX_CFLAGS) \ $(VALGRIND_CFLAGS) \ $(NULL) nbdkit_LDADD = \ $(GNUTLS_LIBS) \ $(LIBSELINUX_LIBS) \ $(DL_LIBS) \ $(RT_LIBS) \ $(top_builddir)/common/protocol/libprotocol.la \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ -lm \ $(NULL) nbdkit_LDFLAGS = $(PTHREAD_LIBS) $(DL_LDFLAGS) $(NULL) $(am__append_2) EXTRA_nbdkit_DEPENDENCIES = nbdkit.syms # On Windows, generate an import library so that plugins can link # against the executable. # https://stackoverflow.com/a/18147774 # https://sourceforge.net/p/mingw/mailman/mingw-users/thread/43694A03.2050503%40cox.net/ # https://stackoverflow.com/questions/20007973/how-do-i-generate-an-import-lib-for-an-exe-using-automake-autoconf-libtool/20363801#20363801 @IS_WINDOWS_TRUE@lib_LIBRARIES = libnbdkit.a # Annoyingly this is required for make dist. @IS_WINDOWS_TRUE@libnbdkit_a_SOURCES = # synopsis.c is generated from docs/synopsis.txt where it is also # used to generate the man page. BUILT_SOURCES = synopsis.c # pkg-config / pkgconf pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = nbdkit.pc test_public_SOURCES = \ test-public.c \ public.c \ exports.c \ extents.c \ $(NULL) test_public_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/protocol \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/utils \ $(NULL) test_public_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(WARNINGS_CFLAGS) \ $(VALGRIND_CFLAGS) \ $(NULL) test_public_LDFLAGS = \ $(PTHREAD_LIBS) \ $(NULL) test_public_LDADD = \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ -lm \ $(NULL) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign server/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): nbdkit.pc: $(top_builddir)/config.status $(srcdir)/nbdkit.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) @IS_WINDOWS_FALSE@libnbdkit.a: $(libnbdkit_a_OBJECTS) $(libnbdkit_a_DEPENDENCIES) $(EXTRA_libnbdkit_a_DEPENDENCIES) @IS_WINDOWS_FALSE@ $(AM_V_at)-rm -f libnbdkit.a @IS_WINDOWS_FALSE@ $(AM_V_AR)$(libnbdkit_a_AR) libnbdkit.a $(libnbdkit_a_OBJECTS) $(libnbdkit_a_LIBADD) @IS_WINDOWS_FALSE@ $(AM_V_at)$(RANLIB) libnbdkit.a nbdkit$(EXEEXT): $(nbdkit_OBJECTS) $(nbdkit_DEPENDENCIES) $(EXTRA_nbdkit_DEPENDENCIES) @rm -f nbdkit$(EXEEXT) $(AM_V_CCLD)$(nbdkit_LINK) $(nbdkit_OBJECTS) $(nbdkit_LDADD) $(LIBS) test-public$(EXEEXT): $(test_public_OBJECTS) $(test_public_DEPENDENCIES) $(EXTRA_test_public_DEPENDENCIES) @rm -f test-public$(EXEEXT) $(AM_V_CCLD)$(test_public_LINK) $(test_public_OBJECTS) $(test_public_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-background.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-captive.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-connections.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-crypto.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-debug-flags.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-exports.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-extents.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-filters.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-fuzzer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-locks.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-log-stderr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-log-syslog.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-plugins.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-protocol-handshake.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-protocol.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-public.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-quit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-signals.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-socket-activation.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-sockets.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-synopsis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-threadlocal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-timeout.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-uri.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-usergroup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-vfprintf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_public-exports.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_public-extents.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_public-public.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_public-test-public.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit-backend.o: backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-backend.o -MD -MP -MF $(DEPDIR)/nbdkit-backend.Tpo -c -o nbdkit-backend.o `test -f 'backend.c' || echo '$(srcdir)/'`backend.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-backend.Tpo $(DEPDIR)/nbdkit-backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='backend.c' object='nbdkit-backend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-backend.o `test -f 'backend.c' || echo '$(srcdir)/'`backend.c nbdkit-backend.obj: backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-backend.obj -MD -MP -MF $(DEPDIR)/nbdkit-backend.Tpo -c -o nbdkit-backend.obj `if test -f 'backend.c'; then $(CYGPATH_W) 'backend.c'; else $(CYGPATH_W) '$(srcdir)/backend.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-backend.Tpo $(DEPDIR)/nbdkit-backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='backend.c' object='nbdkit-backend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-backend.obj `if test -f 'backend.c'; then $(CYGPATH_W) 'backend.c'; else $(CYGPATH_W) '$(srcdir)/backend.c'; fi` nbdkit-background.o: background.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-background.o -MD -MP -MF $(DEPDIR)/nbdkit-background.Tpo -c -o nbdkit-background.o `test -f 'background.c' || echo '$(srcdir)/'`background.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-background.Tpo $(DEPDIR)/nbdkit-background.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='background.c' object='nbdkit-background.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-background.o `test -f 'background.c' || echo '$(srcdir)/'`background.c nbdkit-background.obj: background.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-background.obj -MD -MP -MF $(DEPDIR)/nbdkit-background.Tpo -c -o nbdkit-background.obj `if test -f 'background.c'; then $(CYGPATH_W) 'background.c'; else $(CYGPATH_W) '$(srcdir)/background.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-background.Tpo $(DEPDIR)/nbdkit-background.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='background.c' object='nbdkit-background.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-background.obj `if test -f 'background.c'; then $(CYGPATH_W) 'background.c'; else $(CYGPATH_W) '$(srcdir)/background.c'; fi` nbdkit-captive.o: captive.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-captive.o -MD -MP -MF $(DEPDIR)/nbdkit-captive.Tpo -c -o nbdkit-captive.o `test -f 'captive.c' || echo '$(srcdir)/'`captive.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-captive.Tpo $(DEPDIR)/nbdkit-captive.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='captive.c' object='nbdkit-captive.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-captive.o `test -f 'captive.c' || echo '$(srcdir)/'`captive.c nbdkit-captive.obj: captive.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-captive.obj -MD -MP -MF $(DEPDIR)/nbdkit-captive.Tpo -c -o nbdkit-captive.obj `if test -f 'captive.c'; then $(CYGPATH_W) 'captive.c'; else $(CYGPATH_W) '$(srcdir)/captive.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-captive.Tpo $(DEPDIR)/nbdkit-captive.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='captive.c' object='nbdkit-captive.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-captive.obj `if test -f 'captive.c'; then $(CYGPATH_W) 'captive.c'; else $(CYGPATH_W) '$(srcdir)/captive.c'; fi` nbdkit-connections.o: connections.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-connections.o -MD -MP -MF $(DEPDIR)/nbdkit-connections.Tpo -c -o nbdkit-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-connections.Tpo $(DEPDIR)/nbdkit-connections.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connections.c' object='nbdkit-connections.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c nbdkit-connections.obj: connections.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-connections.obj -MD -MP -MF $(DEPDIR)/nbdkit-connections.Tpo -c -o nbdkit-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-connections.Tpo $(DEPDIR)/nbdkit-connections.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connections.c' object='nbdkit-connections.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` nbdkit-crypto.o: crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-crypto.o -MD -MP -MF $(DEPDIR)/nbdkit-crypto.Tpo -c -o nbdkit-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-crypto.Tpo $(DEPDIR)/nbdkit-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='nbdkit-crypto.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c nbdkit-crypto.obj: crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-crypto.obj -MD -MP -MF $(DEPDIR)/nbdkit-crypto.Tpo -c -o nbdkit-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-crypto.Tpo $(DEPDIR)/nbdkit-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='nbdkit-crypto.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` nbdkit-debug.o: debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-debug.o -MD -MP -MF $(DEPDIR)/nbdkit-debug.Tpo -c -o nbdkit-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-debug.Tpo $(DEPDIR)/nbdkit-debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='nbdkit-debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c nbdkit-debug.obj: debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-debug.obj -MD -MP -MF $(DEPDIR)/nbdkit-debug.Tpo -c -o nbdkit-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-debug.Tpo $(DEPDIR)/nbdkit-debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='nbdkit-debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi` nbdkit-debug-flags.o: debug-flags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-debug-flags.o -MD -MP -MF $(DEPDIR)/nbdkit-debug-flags.Tpo -c -o nbdkit-debug-flags.o `test -f 'debug-flags.c' || echo '$(srcdir)/'`debug-flags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-debug-flags.Tpo $(DEPDIR)/nbdkit-debug-flags.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug-flags.c' object='nbdkit-debug-flags.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-debug-flags.o `test -f 'debug-flags.c' || echo '$(srcdir)/'`debug-flags.c nbdkit-debug-flags.obj: debug-flags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-debug-flags.obj -MD -MP -MF $(DEPDIR)/nbdkit-debug-flags.Tpo -c -o nbdkit-debug-flags.obj `if test -f 'debug-flags.c'; then $(CYGPATH_W) 'debug-flags.c'; else $(CYGPATH_W) '$(srcdir)/debug-flags.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-debug-flags.Tpo $(DEPDIR)/nbdkit-debug-flags.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug-flags.c' object='nbdkit-debug-flags.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-debug-flags.obj `if test -f 'debug-flags.c'; then $(CYGPATH_W) 'debug-flags.c'; else $(CYGPATH_W) '$(srcdir)/debug-flags.c'; fi` nbdkit-exports.o: exports.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-exports.o -MD -MP -MF $(DEPDIR)/nbdkit-exports.Tpo -c -o nbdkit-exports.o `test -f 'exports.c' || echo '$(srcdir)/'`exports.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-exports.Tpo $(DEPDIR)/nbdkit-exports.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exports.c' object='nbdkit-exports.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-exports.o `test -f 'exports.c' || echo '$(srcdir)/'`exports.c nbdkit-exports.obj: exports.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-exports.obj -MD -MP -MF $(DEPDIR)/nbdkit-exports.Tpo -c -o nbdkit-exports.obj `if test -f 'exports.c'; then $(CYGPATH_W) 'exports.c'; else $(CYGPATH_W) '$(srcdir)/exports.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-exports.Tpo $(DEPDIR)/nbdkit-exports.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exports.c' object='nbdkit-exports.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-exports.obj `if test -f 'exports.c'; then $(CYGPATH_W) 'exports.c'; else $(CYGPATH_W) '$(srcdir)/exports.c'; fi` nbdkit-extents.o: extents.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-extents.o -MD -MP -MF $(DEPDIR)/nbdkit-extents.Tpo -c -o nbdkit-extents.o `test -f 'extents.c' || echo '$(srcdir)/'`extents.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-extents.Tpo $(DEPDIR)/nbdkit-extents.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extents.c' object='nbdkit-extents.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-extents.o `test -f 'extents.c' || echo '$(srcdir)/'`extents.c nbdkit-extents.obj: extents.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-extents.obj -MD -MP -MF $(DEPDIR)/nbdkit-extents.Tpo -c -o nbdkit-extents.obj `if test -f 'extents.c'; then $(CYGPATH_W) 'extents.c'; else $(CYGPATH_W) '$(srcdir)/extents.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-extents.Tpo $(DEPDIR)/nbdkit-extents.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extents.c' object='nbdkit-extents.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-extents.obj `if test -f 'extents.c'; then $(CYGPATH_W) 'extents.c'; else $(CYGPATH_W) '$(srcdir)/extents.c'; fi` nbdkit-filters.o: filters.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-filters.o -MD -MP -MF $(DEPDIR)/nbdkit-filters.Tpo -c -o nbdkit-filters.o `test -f 'filters.c' || echo '$(srcdir)/'`filters.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-filters.Tpo $(DEPDIR)/nbdkit-filters.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filters.c' object='nbdkit-filters.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-filters.o `test -f 'filters.c' || echo '$(srcdir)/'`filters.c nbdkit-filters.obj: filters.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-filters.obj -MD -MP -MF $(DEPDIR)/nbdkit-filters.Tpo -c -o nbdkit-filters.obj `if test -f 'filters.c'; then $(CYGPATH_W) 'filters.c'; else $(CYGPATH_W) '$(srcdir)/filters.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-filters.Tpo $(DEPDIR)/nbdkit-filters.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filters.c' object='nbdkit-filters.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-filters.obj `if test -f 'filters.c'; then $(CYGPATH_W) 'filters.c'; else $(CYGPATH_W) '$(srcdir)/filters.c'; fi` nbdkit-locks.o: locks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-locks.o -MD -MP -MF $(DEPDIR)/nbdkit-locks.Tpo -c -o nbdkit-locks.o `test -f 'locks.c' || echo '$(srcdir)/'`locks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-locks.Tpo $(DEPDIR)/nbdkit-locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='locks.c' object='nbdkit-locks.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-locks.o `test -f 'locks.c' || echo '$(srcdir)/'`locks.c nbdkit-locks.obj: locks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-locks.obj -MD -MP -MF $(DEPDIR)/nbdkit-locks.Tpo -c -o nbdkit-locks.obj `if test -f 'locks.c'; then $(CYGPATH_W) 'locks.c'; else $(CYGPATH_W) '$(srcdir)/locks.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-locks.Tpo $(DEPDIR)/nbdkit-locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='locks.c' object='nbdkit-locks.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-locks.obj `if test -f 'locks.c'; then $(CYGPATH_W) 'locks.c'; else $(CYGPATH_W) '$(srcdir)/locks.c'; fi` nbdkit-log.o: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log.o -MD -MP -MF $(DEPDIR)/nbdkit-log.Tpo -c -o nbdkit-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log.Tpo $(DEPDIR)/nbdkit-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='nbdkit-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c nbdkit-log.obj: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log.obj -MD -MP -MF $(DEPDIR)/nbdkit-log.Tpo -c -o nbdkit-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log.Tpo $(DEPDIR)/nbdkit-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='nbdkit-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` nbdkit-log-stderr.o: log-stderr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log-stderr.o -MD -MP -MF $(DEPDIR)/nbdkit-log-stderr.Tpo -c -o nbdkit-log-stderr.o `test -f 'log-stderr.c' || echo '$(srcdir)/'`log-stderr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log-stderr.Tpo $(DEPDIR)/nbdkit-log-stderr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log-stderr.c' object='nbdkit-log-stderr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log-stderr.o `test -f 'log-stderr.c' || echo '$(srcdir)/'`log-stderr.c nbdkit-log-stderr.obj: log-stderr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log-stderr.obj -MD -MP -MF $(DEPDIR)/nbdkit-log-stderr.Tpo -c -o nbdkit-log-stderr.obj `if test -f 'log-stderr.c'; then $(CYGPATH_W) 'log-stderr.c'; else $(CYGPATH_W) '$(srcdir)/log-stderr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log-stderr.Tpo $(DEPDIR)/nbdkit-log-stderr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log-stderr.c' object='nbdkit-log-stderr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log-stderr.obj `if test -f 'log-stderr.c'; then $(CYGPATH_W) 'log-stderr.c'; else $(CYGPATH_W) '$(srcdir)/log-stderr.c'; fi` nbdkit-log-syslog.o: log-syslog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log-syslog.o -MD -MP -MF $(DEPDIR)/nbdkit-log-syslog.Tpo -c -o nbdkit-log-syslog.o `test -f 'log-syslog.c' || echo '$(srcdir)/'`log-syslog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log-syslog.Tpo $(DEPDIR)/nbdkit-log-syslog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log-syslog.c' object='nbdkit-log-syslog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log-syslog.o `test -f 'log-syslog.c' || echo '$(srcdir)/'`log-syslog.c nbdkit-log-syslog.obj: log-syslog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-log-syslog.obj -MD -MP -MF $(DEPDIR)/nbdkit-log-syslog.Tpo -c -o nbdkit-log-syslog.obj `if test -f 'log-syslog.c'; then $(CYGPATH_W) 'log-syslog.c'; else $(CYGPATH_W) '$(srcdir)/log-syslog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-log-syslog.Tpo $(DEPDIR)/nbdkit-log-syslog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log-syslog.c' object='nbdkit-log-syslog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-log-syslog.obj `if test -f 'log-syslog.c'; then $(CYGPATH_W) 'log-syslog.c'; else $(CYGPATH_W) '$(srcdir)/log-syslog.c'; fi` nbdkit-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-main.o -MD -MP -MF $(DEPDIR)/nbdkit-main.Tpo -c -o nbdkit-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-main.Tpo $(DEPDIR)/nbdkit-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='nbdkit-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c nbdkit-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-main.obj -MD -MP -MF $(DEPDIR)/nbdkit-main.Tpo -c -o nbdkit-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-main.Tpo $(DEPDIR)/nbdkit-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='nbdkit-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` nbdkit-plugins.o: plugins.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-plugins.o -MD -MP -MF $(DEPDIR)/nbdkit-plugins.Tpo -c -o nbdkit-plugins.o `test -f 'plugins.c' || echo '$(srcdir)/'`plugins.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-plugins.Tpo $(DEPDIR)/nbdkit-plugins.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins.c' object='nbdkit-plugins.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-plugins.o `test -f 'plugins.c' || echo '$(srcdir)/'`plugins.c nbdkit-plugins.obj: plugins.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-plugins.obj -MD -MP -MF $(DEPDIR)/nbdkit-plugins.Tpo -c -o nbdkit-plugins.obj `if test -f 'plugins.c'; then $(CYGPATH_W) 'plugins.c'; else $(CYGPATH_W) '$(srcdir)/plugins.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-plugins.Tpo $(DEPDIR)/nbdkit-plugins.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins.c' object='nbdkit-plugins.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-plugins.obj `if test -f 'plugins.c'; then $(CYGPATH_W) 'plugins.c'; else $(CYGPATH_W) '$(srcdir)/plugins.c'; fi` nbdkit-protocol.o: protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol.o -MD -MP -MF $(DEPDIR)/nbdkit-protocol.Tpo -c -o nbdkit-protocol.o `test -f 'protocol.c' || echo '$(srcdir)/'`protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol.Tpo $(DEPDIR)/nbdkit-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol.c' object='nbdkit-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol.o `test -f 'protocol.c' || echo '$(srcdir)/'`protocol.c nbdkit-protocol.obj: protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol.obj -MD -MP -MF $(DEPDIR)/nbdkit-protocol.Tpo -c -o nbdkit-protocol.obj `if test -f 'protocol.c'; then $(CYGPATH_W) 'protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol.Tpo $(DEPDIR)/nbdkit-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol.c' object='nbdkit-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol.obj `if test -f 'protocol.c'; then $(CYGPATH_W) 'protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol.c'; fi` nbdkit-protocol-handshake.o: protocol-handshake.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake.o -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake.Tpo -c -o nbdkit-protocol-handshake.o `test -f 'protocol-handshake.c' || echo '$(srcdir)/'`protocol-handshake.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake.Tpo $(DEPDIR)/nbdkit-protocol-handshake.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake.c' object='nbdkit-protocol-handshake.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake.o `test -f 'protocol-handshake.c' || echo '$(srcdir)/'`protocol-handshake.c nbdkit-protocol-handshake.obj: protocol-handshake.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake.obj -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake.Tpo -c -o nbdkit-protocol-handshake.obj `if test -f 'protocol-handshake.c'; then $(CYGPATH_W) 'protocol-handshake.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake.Tpo $(DEPDIR)/nbdkit-protocol-handshake.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake.c' object='nbdkit-protocol-handshake.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake.obj `if test -f 'protocol-handshake.c'; then $(CYGPATH_W) 'protocol-handshake.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake.c'; fi` nbdkit-protocol-handshake-oldstyle.o: protocol-handshake-oldstyle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake-oldstyle.o -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Tpo -c -o nbdkit-protocol-handshake-oldstyle.o `test -f 'protocol-handshake-oldstyle.c' || echo '$(srcdir)/'`protocol-handshake-oldstyle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Tpo $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake-oldstyle.c' object='nbdkit-protocol-handshake-oldstyle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake-oldstyle.o `test -f 'protocol-handshake-oldstyle.c' || echo '$(srcdir)/'`protocol-handshake-oldstyle.c nbdkit-protocol-handshake-oldstyle.obj: protocol-handshake-oldstyle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake-oldstyle.obj -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Tpo -c -o nbdkit-protocol-handshake-oldstyle.obj `if test -f 'protocol-handshake-oldstyle.c'; then $(CYGPATH_W) 'protocol-handshake-oldstyle.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake-oldstyle.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Tpo $(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake-oldstyle.c' object='nbdkit-protocol-handshake-oldstyle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake-oldstyle.obj `if test -f 'protocol-handshake-oldstyle.c'; then $(CYGPATH_W) 'protocol-handshake-oldstyle.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake-oldstyle.c'; fi` nbdkit-protocol-handshake-newstyle.o: protocol-handshake-newstyle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake-newstyle.o -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Tpo -c -o nbdkit-protocol-handshake-newstyle.o `test -f 'protocol-handshake-newstyle.c' || echo '$(srcdir)/'`protocol-handshake-newstyle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Tpo $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake-newstyle.c' object='nbdkit-protocol-handshake-newstyle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake-newstyle.o `test -f 'protocol-handshake-newstyle.c' || echo '$(srcdir)/'`protocol-handshake-newstyle.c nbdkit-protocol-handshake-newstyle.obj: protocol-handshake-newstyle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-protocol-handshake-newstyle.obj -MD -MP -MF $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Tpo -c -o nbdkit-protocol-handshake-newstyle.obj `if test -f 'protocol-handshake-newstyle.c'; then $(CYGPATH_W) 'protocol-handshake-newstyle.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake-newstyle.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Tpo $(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol-handshake-newstyle.c' object='nbdkit-protocol-handshake-newstyle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-protocol-handshake-newstyle.obj `if test -f 'protocol-handshake-newstyle.c'; then $(CYGPATH_W) 'protocol-handshake-newstyle.c'; else $(CYGPATH_W) '$(srcdir)/protocol-handshake-newstyle.c'; fi` nbdkit-public.o: public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-public.o -MD -MP -MF $(DEPDIR)/nbdkit-public.Tpo -c -o nbdkit-public.o `test -f 'public.c' || echo '$(srcdir)/'`public.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-public.Tpo $(DEPDIR)/nbdkit-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='public.c' object='nbdkit-public.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-public.o `test -f 'public.c' || echo '$(srcdir)/'`public.c nbdkit-public.obj: public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-public.obj -MD -MP -MF $(DEPDIR)/nbdkit-public.Tpo -c -o nbdkit-public.obj `if test -f 'public.c'; then $(CYGPATH_W) 'public.c'; else $(CYGPATH_W) '$(srcdir)/public.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-public.Tpo $(DEPDIR)/nbdkit-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='public.c' object='nbdkit-public.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-public.obj `if test -f 'public.c'; then $(CYGPATH_W) 'public.c'; else $(CYGPATH_W) '$(srcdir)/public.c'; fi` nbdkit-quit.o: quit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-quit.o -MD -MP -MF $(DEPDIR)/nbdkit-quit.Tpo -c -o nbdkit-quit.o `test -f 'quit.c' || echo '$(srcdir)/'`quit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-quit.Tpo $(DEPDIR)/nbdkit-quit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quit.c' object='nbdkit-quit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-quit.o `test -f 'quit.c' || echo '$(srcdir)/'`quit.c nbdkit-quit.obj: quit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-quit.obj -MD -MP -MF $(DEPDIR)/nbdkit-quit.Tpo -c -o nbdkit-quit.obj `if test -f 'quit.c'; then $(CYGPATH_W) 'quit.c'; else $(CYGPATH_W) '$(srcdir)/quit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-quit.Tpo $(DEPDIR)/nbdkit-quit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quit.c' object='nbdkit-quit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-quit.obj `if test -f 'quit.c'; then $(CYGPATH_W) 'quit.c'; else $(CYGPATH_W) '$(srcdir)/quit.c'; fi` nbdkit-signals.o: signals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-signals.o -MD -MP -MF $(DEPDIR)/nbdkit-signals.Tpo -c -o nbdkit-signals.o `test -f 'signals.c' || echo '$(srcdir)/'`signals.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-signals.Tpo $(DEPDIR)/nbdkit-signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signals.c' object='nbdkit-signals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-signals.o `test -f 'signals.c' || echo '$(srcdir)/'`signals.c nbdkit-signals.obj: signals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-signals.obj -MD -MP -MF $(DEPDIR)/nbdkit-signals.Tpo -c -o nbdkit-signals.obj `if test -f 'signals.c'; then $(CYGPATH_W) 'signals.c'; else $(CYGPATH_W) '$(srcdir)/signals.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-signals.Tpo $(DEPDIR)/nbdkit-signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signals.c' object='nbdkit-signals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-signals.obj `if test -f 'signals.c'; then $(CYGPATH_W) 'signals.c'; else $(CYGPATH_W) '$(srcdir)/signals.c'; fi` nbdkit-socket-activation.o: socket-activation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-socket-activation.o -MD -MP -MF $(DEPDIR)/nbdkit-socket-activation.Tpo -c -o nbdkit-socket-activation.o `test -f 'socket-activation.c' || echo '$(srcdir)/'`socket-activation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-socket-activation.Tpo $(DEPDIR)/nbdkit-socket-activation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socket-activation.c' object='nbdkit-socket-activation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-socket-activation.o `test -f 'socket-activation.c' || echo '$(srcdir)/'`socket-activation.c nbdkit-socket-activation.obj: socket-activation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-socket-activation.obj -MD -MP -MF $(DEPDIR)/nbdkit-socket-activation.Tpo -c -o nbdkit-socket-activation.obj `if test -f 'socket-activation.c'; then $(CYGPATH_W) 'socket-activation.c'; else $(CYGPATH_W) '$(srcdir)/socket-activation.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-socket-activation.Tpo $(DEPDIR)/nbdkit-socket-activation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socket-activation.c' object='nbdkit-socket-activation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-socket-activation.obj `if test -f 'socket-activation.c'; then $(CYGPATH_W) 'socket-activation.c'; else $(CYGPATH_W) '$(srcdir)/socket-activation.c'; fi` nbdkit-sockets.o: sockets.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-sockets.o -MD -MP -MF $(DEPDIR)/nbdkit-sockets.Tpo -c -o nbdkit-sockets.o `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-sockets.Tpo $(DEPDIR)/nbdkit-sockets.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockets.c' object='nbdkit-sockets.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-sockets.o `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c nbdkit-sockets.obj: sockets.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-sockets.obj -MD -MP -MF $(DEPDIR)/nbdkit-sockets.Tpo -c -o nbdkit-sockets.obj `if test -f 'sockets.c'; then $(CYGPATH_W) 'sockets.c'; else $(CYGPATH_W) '$(srcdir)/sockets.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-sockets.Tpo $(DEPDIR)/nbdkit-sockets.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockets.c' object='nbdkit-sockets.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-sockets.obj `if test -f 'sockets.c'; then $(CYGPATH_W) 'sockets.c'; else $(CYGPATH_W) '$(srcdir)/sockets.c'; fi` nbdkit-synopsis.o: synopsis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-synopsis.o -MD -MP -MF $(DEPDIR)/nbdkit-synopsis.Tpo -c -o nbdkit-synopsis.o `test -f 'synopsis.c' || echo '$(srcdir)/'`synopsis.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-synopsis.Tpo $(DEPDIR)/nbdkit-synopsis.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='synopsis.c' object='nbdkit-synopsis.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-synopsis.o `test -f 'synopsis.c' || echo '$(srcdir)/'`synopsis.c nbdkit-synopsis.obj: synopsis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-synopsis.obj -MD -MP -MF $(DEPDIR)/nbdkit-synopsis.Tpo -c -o nbdkit-synopsis.obj `if test -f 'synopsis.c'; then $(CYGPATH_W) 'synopsis.c'; else $(CYGPATH_W) '$(srcdir)/synopsis.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-synopsis.Tpo $(DEPDIR)/nbdkit-synopsis.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='synopsis.c' object='nbdkit-synopsis.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-synopsis.obj `if test -f 'synopsis.c'; then $(CYGPATH_W) 'synopsis.c'; else $(CYGPATH_W) '$(srcdir)/synopsis.c'; fi` nbdkit-threadlocal.o: threadlocal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-threadlocal.o -MD -MP -MF $(DEPDIR)/nbdkit-threadlocal.Tpo -c -o nbdkit-threadlocal.o `test -f 'threadlocal.c' || echo '$(srcdir)/'`threadlocal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-threadlocal.Tpo $(DEPDIR)/nbdkit-threadlocal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='threadlocal.c' object='nbdkit-threadlocal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-threadlocal.o `test -f 'threadlocal.c' || echo '$(srcdir)/'`threadlocal.c nbdkit-threadlocal.obj: threadlocal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-threadlocal.obj -MD -MP -MF $(DEPDIR)/nbdkit-threadlocal.Tpo -c -o nbdkit-threadlocal.obj `if test -f 'threadlocal.c'; then $(CYGPATH_W) 'threadlocal.c'; else $(CYGPATH_W) '$(srcdir)/threadlocal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-threadlocal.Tpo $(DEPDIR)/nbdkit-threadlocal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='threadlocal.c' object='nbdkit-threadlocal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-threadlocal.obj `if test -f 'threadlocal.c'; then $(CYGPATH_W) 'threadlocal.c'; else $(CYGPATH_W) '$(srcdir)/threadlocal.c'; fi` nbdkit-timeout.o: timeout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-timeout.o -MD -MP -MF $(DEPDIR)/nbdkit-timeout.Tpo -c -o nbdkit-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-timeout.Tpo $(DEPDIR)/nbdkit-timeout.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timeout.c' object='nbdkit-timeout.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c nbdkit-timeout.obj: timeout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-timeout.obj -MD -MP -MF $(DEPDIR)/nbdkit-timeout.Tpo -c -o nbdkit-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-timeout.Tpo $(DEPDIR)/nbdkit-timeout.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timeout.c' object='nbdkit-timeout.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi` nbdkit-uri.o: uri.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-uri.o -MD -MP -MF $(DEPDIR)/nbdkit-uri.Tpo -c -o nbdkit-uri.o `test -f 'uri.c' || echo '$(srcdir)/'`uri.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-uri.Tpo $(DEPDIR)/nbdkit-uri.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uri.c' object='nbdkit-uri.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-uri.o `test -f 'uri.c' || echo '$(srcdir)/'`uri.c nbdkit-uri.obj: uri.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-uri.obj -MD -MP -MF $(DEPDIR)/nbdkit-uri.Tpo -c -o nbdkit-uri.obj `if test -f 'uri.c'; then $(CYGPATH_W) 'uri.c'; else $(CYGPATH_W) '$(srcdir)/uri.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-uri.Tpo $(DEPDIR)/nbdkit-uri.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uri.c' object='nbdkit-uri.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-uri.obj `if test -f 'uri.c'; then $(CYGPATH_W) 'uri.c'; else $(CYGPATH_W) '$(srcdir)/uri.c'; fi` nbdkit-usergroup.o: usergroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-usergroup.o -MD -MP -MF $(DEPDIR)/nbdkit-usergroup.Tpo -c -o nbdkit-usergroup.o `test -f 'usergroup.c' || echo '$(srcdir)/'`usergroup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-usergroup.Tpo $(DEPDIR)/nbdkit-usergroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='usergroup.c' object='nbdkit-usergroup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-usergroup.o `test -f 'usergroup.c' || echo '$(srcdir)/'`usergroup.c nbdkit-usergroup.obj: usergroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-usergroup.obj -MD -MP -MF $(DEPDIR)/nbdkit-usergroup.Tpo -c -o nbdkit-usergroup.obj `if test -f 'usergroup.c'; then $(CYGPATH_W) 'usergroup.c'; else $(CYGPATH_W) '$(srcdir)/usergroup.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-usergroup.Tpo $(DEPDIR)/nbdkit-usergroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='usergroup.c' object='nbdkit-usergroup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-usergroup.obj `if test -f 'usergroup.c'; then $(CYGPATH_W) 'usergroup.c'; else $(CYGPATH_W) '$(srcdir)/usergroup.c'; fi` nbdkit-vfprintf.o: vfprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-vfprintf.o -MD -MP -MF $(DEPDIR)/nbdkit-vfprintf.Tpo -c -o nbdkit-vfprintf.o `test -f 'vfprintf.c' || echo '$(srcdir)/'`vfprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-vfprintf.Tpo $(DEPDIR)/nbdkit-vfprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vfprintf.c' object='nbdkit-vfprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-vfprintf.o `test -f 'vfprintf.c' || echo '$(srcdir)/'`vfprintf.c nbdkit-vfprintf.obj: vfprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-vfprintf.obj -MD -MP -MF $(DEPDIR)/nbdkit-vfprintf.Tpo -c -o nbdkit-vfprintf.obj `if test -f 'vfprintf.c'; then $(CYGPATH_W) 'vfprintf.c'; else $(CYGPATH_W) '$(srcdir)/vfprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-vfprintf.Tpo $(DEPDIR)/nbdkit-vfprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vfprintf.c' object='nbdkit-vfprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-vfprintf.obj `if test -f 'vfprintf.c'; then $(CYGPATH_W) 'vfprintf.c'; else $(CYGPATH_W) '$(srcdir)/vfprintf.c'; fi` nbdkit-fuzzer.o: fuzzer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-fuzzer.o -MD -MP -MF $(DEPDIR)/nbdkit-fuzzer.Tpo -c -o nbdkit-fuzzer.o `test -f 'fuzzer.c' || echo '$(srcdir)/'`fuzzer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-fuzzer.Tpo $(DEPDIR)/nbdkit-fuzzer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzzer.c' object='nbdkit-fuzzer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-fuzzer.o `test -f 'fuzzer.c' || echo '$(srcdir)/'`fuzzer.c nbdkit-fuzzer.obj: fuzzer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-fuzzer.obj -MD -MP -MF $(DEPDIR)/nbdkit-fuzzer.Tpo -c -o nbdkit-fuzzer.obj `if test -f 'fuzzer.c'; then $(CYGPATH_W) 'fuzzer.c'; else $(CYGPATH_W) '$(srcdir)/fuzzer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-fuzzer.Tpo $(DEPDIR)/nbdkit-fuzzer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzzer.c' object='nbdkit-fuzzer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-fuzzer.obj `if test -f 'fuzzer.c'; then $(CYGPATH_W) 'fuzzer.c'; else $(CYGPATH_W) '$(srcdir)/fuzzer.c'; fi` test_public-test-public.o: test-public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-test-public.o -MD -MP -MF $(DEPDIR)/test_public-test-public.Tpo -c -o test_public-test-public.o `test -f 'test-public.c' || echo '$(srcdir)/'`test-public.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-test-public.Tpo $(DEPDIR)/test_public-test-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-public.c' object='test_public-test-public.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-test-public.o `test -f 'test-public.c' || echo '$(srcdir)/'`test-public.c test_public-test-public.obj: test-public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-test-public.obj -MD -MP -MF $(DEPDIR)/test_public-test-public.Tpo -c -o test_public-test-public.obj `if test -f 'test-public.c'; then $(CYGPATH_W) 'test-public.c'; else $(CYGPATH_W) '$(srcdir)/test-public.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-test-public.Tpo $(DEPDIR)/test_public-test-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-public.c' object='test_public-test-public.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-test-public.obj `if test -f 'test-public.c'; then $(CYGPATH_W) 'test-public.c'; else $(CYGPATH_W) '$(srcdir)/test-public.c'; fi` test_public-public.o: public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-public.o -MD -MP -MF $(DEPDIR)/test_public-public.Tpo -c -o test_public-public.o `test -f 'public.c' || echo '$(srcdir)/'`public.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-public.Tpo $(DEPDIR)/test_public-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='public.c' object='test_public-public.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-public.o `test -f 'public.c' || echo '$(srcdir)/'`public.c test_public-public.obj: public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-public.obj -MD -MP -MF $(DEPDIR)/test_public-public.Tpo -c -o test_public-public.obj `if test -f 'public.c'; then $(CYGPATH_W) 'public.c'; else $(CYGPATH_W) '$(srcdir)/public.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-public.Tpo $(DEPDIR)/test_public-public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='public.c' object='test_public-public.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-public.obj `if test -f 'public.c'; then $(CYGPATH_W) 'public.c'; else $(CYGPATH_W) '$(srcdir)/public.c'; fi` test_public-exports.o: exports.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-exports.o -MD -MP -MF $(DEPDIR)/test_public-exports.Tpo -c -o test_public-exports.o `test -f 'exports.c' || echo '$(srcdir)/'`exports.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-exports.Tpo $(DEPDIR)/test_public-exports.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exports.c' object='test_public-exports.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-exports.o `test -f 'exports.c' || echo '$(srcdir)/'`exports.c test_public-exports.obj: exports.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-exports.obj -MD -MP -MF $(DEPDIR)/test_public-exports.Tpo -c -o test_public-exports.obj `if test -f 'exports.c'; then $(CYGPATH_W) 'exports.c'; else $(CYGPATH_W) '$(srcdir)/exports.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-exports.Tpo $(DEPDIR)/test_public-exports.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exports.c' object='test_public-exports.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-exports.obj `if test -f 'exports.c'; then $(CYGPATH_W) 'exports.c'; else $(CYGPATH_W) '$(srcdir)/exports.c'; fi` test_public-extents.o: extents.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-extents.o -MD -MP -MF $(DEPDIR)/test_public-extents.Tpo -c -o test_public-extents.o `test -f 'extents.c' || echo '$(srcdir)/'`extents.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-extents.Tpo $(DEPDIR)/test_public-extents.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extents.c' object='test_public-extents.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-extents.o `test -f 'extents.c' || echo '$(srcdir)/'`extents.c test_public-extents.obj: extents.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -MT test_public-extents.obj -MD -MP -MF $(DEPDIR)/test_public-extents.Tpo -c -o test_public-extents.obj `if test -f 'extents.c'; then $(CYGPATH_W) 'extents.c'; else $(CYGPATH_W) '$(srcdir)/extents.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_public-extents.Tpo $(DEPDIR)/test_public-extents.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extents.c' object='test_public-extents.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_public_CPPFLAGS) $(CPPFLAGS) $(test_public_CFLAGS) $(CFLAGS) -c -o test_public-extents.obj `if test -f 'extents.c'; then $(CYGPATH_W) 'extents.c'; else $(CYGPATH_W) '$(srcdir)/extents.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-public.log: test-public$(EXEEXT) @p='test-public$(EXEEXT)'; \ b='test-public'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libLIBRARIES \ clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/nbdkit-backend.Po -rm -f ./$(DEPDIR)/nbdkit-background.Po -rm -f ./$(DEPDIR)/nbdkit-captive.Po -rm -f ./$(DEPDIR)/nbdkit-connections.Po -rm -f ./$(DEPDIR)/nbdkit-crypto.Po -rm -f ./$(DEPDIR)/nbdkit-debug-flags.Po -rm -f ./$(DEPDIR)/nbdkit-debug.Po -rm -f ./$(DEPDIR)/nbdkit-exports.Po -rm -f ./$(DEPDIR)/nbdkit-extents.Po -rm -f ./$(DEPDIR)/nbdkit-filters.Po -rm -f ./$(DEPDIR)/nbdkit-fuzzer.Po -rm -f ./$(DEPDIR)/nbdkit-locks.Po -rm -f ./$(DEPDIR)/nbdkit-log-stderr.Po -rm -f ./$(DEPDIR)/nbdkit-log-syslog.Po -rm -f ./$(DEPDIR)/nbdkit-log.Po -rm -f ./$(DEPDIR)/nbdkit-main.Po -rm -f ./$(DEPDIR)/nbdkit-plugins.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake.Po -rm -f ./$(DEPDIR)/nbdkit-protocol.Po -rm -f ./$(DEPDIR)/nbdkit-public.Po -rm -f ./$(DEPDIR)/nbdkit-quit.Po -rm -f ./$(DEPDIR)/nbdkit-signals.Po -rm -f ./$(DEPDIR)/nbdkit-socket-activation.Po -rm -f ./$(DEPDIR)/nbdkit-sockets.Po -rm -f ./$(DEPDIR)/nbdkit-synopsis.Po -rm -f ./$(DEPDIR)/nbdkit-threadlocal.Po -rm -f ./$(DEPDIR)/nbdkit-timeout.Po -rm -f ./$(DEPDIR)/nbdkit-uri.Po -rm -f ./$(DEPDIR)/nbdkit-usergroup.Po -rm -f ./$(DEPDIR)/nbdkit-vfprintf.Po -rm -f ./$(DEPDIR)/test_public-exports.Po -rm -f ./$(DEPDIR)/test_public-extents.Po -rm -f ./$(DEPDIR)/test_public-public.Po -rm -f ./$(DEPDIR)/test_public-test-public.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLIBRARIES install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/nbdkit-backend.Po -rm -f ./$(DEPDIR)/nbdkit-background.Po -rm -f ./$(DEPDIR)/nbdkit-captive.Po -rm -f ./$(DEPDIR)/nbdkit-connections.Po -rm -f ./$(DEPDIR)/nbdkit-crypto.Po -rm -f ./$(DEPDIR)/nbdkit-debug-flags.Po -rm -f ./$(DEPDIR)/nbdkit-debug.Po -rm -f ./$(DEPDIR)/nbdkit-exports.Po -rm -f ./$(DEPDIR)/nbdkit-extents.Po -rm -f ./$(DEPDIR)/nbdkit-filters.Po -rm -f ./$(DEPDIR)/nbdkit-fuzzer.Po -rm -f ./$(DEPDIR)/nbdkit-locks.Po -rm -f ./$(DEPDIR)/nbdkit-log-stderr.Po -rm -f ./$(DEPDIR)/nbdkit-log-syslog.Po -rm -f ./$(DEPDIR)/nbdkit-log.Po -rm -f ./$(DEPDIR)/nbdkit-main.Po -rm -f ./$(DEPDIR)/nbdkit-plugins.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake-newstyle.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake-oldstyle.Po -rm -f ./$(DEPDIR)/nbdkit-protocol-handshake.Po -rm -f ./$(DEPDIR)/nbdkit-protocol.Po -rm -f ./$(DEPDIR)/nbdkit-public.Po -rm -f ./$(DEPDIR)/nbdkit-quit.Po -rm -f ./$(DEPDIR)/nbdkit-signals.Po -rm -f ./$(DEPDIR)/nbdkit-socket-activation.Po -rm -f ./$(DEPDIR)/nbdkit-sockets.Po -rm -f ./$(DEPDIR)/nbdkit-synopsis.Po -rm -f ./$(DEPDIR)/nbdkit-threadlocal.Po -rm -f ./$(DEPDIR)/nbdkit-timeout.Po -rm -f ./$(DEPDIR)/nbdkit-uri.Po -rm -f ./$(DEPDIR)/nbdkit-usergroup.Po -rm -f ./$(DEPDIR)/nbdkit-vfprintf.Po -rm -f ./$(DEPDIR)/test_public-exports.Po -rm -f ./$(DEPDIR)/test_public-extents.Po -rm -f ./$(DEPDIR)/test_public-public.Po -rm -f ./$(DEPDIR)/test_public-test-public.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLIBRARIES uninstall-pkgconfigDATA \ uninstall-sbinPROGRAMS .MAKE: all check check-am install install-am install-exec \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic \ clean-libLIBRARIES clean-libtool clean-sbinPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLIBRARIES install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-libLIBRARIES uninstall-pkgconfigDATA \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile @IS_WINDOWS_TRUE@libnbdkit.a: nbdkit$(EXEEXT) nbdkit.def @IS_WINDOWS_TRUE@ $(LIBTOOL) --mode=execute \ @IS_WINDOWS_TRUE@ $(DLLTOOL) -v $< -D nbdkit.exe -d nbdkit.def -l $@ @IS_WINDOWS_TRUE@nbdkit.def: nbdkit.syms @IS_WINDOWS_TRUE@ rm -f $@ $@-t @IS_WINDOWS_TRUE@ echo '; Generated from $<' > $@-t @IS_WINDOWS_TRUE@ echo 'EXPORTS' >> $@-t @IS_WINDOWS_TRUE@ $(SED) -n -e 's/.*\(nbdkit_[a-z0-9_]*\);.*/\t\1/p' < $< >> $@-t @IS_WINDOWS_TRUE@ mv $@-t $@ @IS_WINDOWS_TRUE@ chmod 0444 $@ synopsis.c: $(top_srcdir)/docs/synopsis.txt Makefile.am rm -f $@ $@-t echo "/* DO NOT EDIT! Generated from $< */" > $@-t echo >> $@-t echo "const char *synopsis =" >> $@-t $(SED) -e 's/"/\\"/g' -e 's/\(.*\)/ "\1\\n"/g' $< >> $@-t echo " ;" >> $@-t mv $@-t $@ # 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: nbdkit-1.42.2/server/nbdkit.pc.in0000644000175000017500000000361614534316443012263 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ plugindir=@libdir@/nbdkit/plugins filterdir=@libdir@/nbdkit/filters Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ Description: A toolkit for creating NBD servers Requires: Cflags: # There is no library that NBD plugins have to be linked against. # All symbols like 'nbdkit_error' are provided by the main nbdkit # server binary when the plugin is loaded. So this is empty. Libs: nbdkit-1.42.2/server/backend.c0000644000175000017500000005517214534316443011616 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "ascii-ctype.h" #include "minmax.h" #include "internal.h" /* Helpers for registering a new backend. */ /* Use: * -D nbdkit.backend.controlpath=0 to suppress control path debugging. * -D nbdkit.backend.datapath=0 to suppress data path debugging. */ NBDKIT_DLL_PUBLIC int nbdkit_debug_backend_controlpath = 1; NBDKIT_DLL_PUBLIC int nbdkit_debug_backend_datapath = 1; #define controlpath_debug(fs, ...) \ do { \ if (nbdkit_debug_backend_controlpath) debug ((fs), ##__VA_ARGS__); \ } while (0) #define datapath_debug(fs, ...) \ do { \ if (nbdkit_debug_backend_datapath) debug ((fs), ##__VA_ARGS__); \ } while (0) void backend_init (struct backend *b, struct backend *next, size_t index, const char *filename, void *dl, const char *type) { b->magic = BACKEND_MAGIC; b->next = next; b->i = index; b->type = type; b->filename = strdup (filename); if (b->filename == NULL) { perror ("strdup"); exit (EXIT_FAILURE); } b->dl = dl; debug ("registering %s %s", type, filename); } void backend_load (struct backend *b, const char *name, void (*load) (void)) { size_t i, len; /* name is required. */ if (name == NULL) { fprintf (stderr, "%s: %s: %s must have a .name field\n", program_name, b->filename, b->type); exit (EXIT_FAILURE); } len = strlen (name); if (len == 0) { fprintf (stderr, "%s: %s: %s.name field must not be empty\n", program_name, b->filename, b->type); exit (EXIT_FAILURE); } if (! ascii_isalnum (*name)) { fprintf (stderr, "%s: %s: %s.name ('%s') field must begin with an " "ASCII alphanumeric character\n", program_name, b->filename, b->type, name); exit (EXIT_FAILURE); } for (i = 1; i < len; ++i) { unsigned char c = name[i]; if (! ascii_isalnum (c) && c != '-') { fprintf (stderr, "%s: %s: %s.name ('%s') field must contain only " "ASCII alphanumeric or dash characters\n", program_name, b->filename, b->type, name); exit (EXIT_FAILURE); } } /* Copy the module's name into local storage, so that name * survives past unload. */ b->name = strdup (name); if (b->name == NULL) { perror ("strdup"); exit (EXIT_FAILURE); } debug ("registered %s %s (name %s)", b->type, b->filename, b->name); /* Apply debug flags before calling load. */ apply_debug_flags (b->dl, name); /* Call the on-load callback if it exists. */ controlpath_debug ("%s: load", name); if (load) load (); } void backend_unload (struct backend *b, void (*unload) (void)) { /* Acquiring this lock prevents any other backend callbacks from running * simultaneously. */ lock_unload (); controlpath_debug ("%s: unload %s", b->name, b->type); if (unload) unload (); if (DO_DLCLOSE) dlclose (b->dl); free (b->filename); unlock_unload (); free (b->name); } int backend_list_exports (struct backend *b, int readonly, struct nbdkit_exports *exports) { GET_CONN; size_t count; controlpath_debug ("%s: list_exports readonly=%d tls=%d", b->name, readonly, conn->using_tls); assert (conn->top_context == NULL); if (b->list_exports (b, readonly, conn->using_tls, exports) == -1 || exports_resolve_default (exports, b, readonly) == -1) { controlpath_debug ("%s: list_exports failed", b->name); return -1; } count = nbdkit_exports_count (exports); controlpath_debug ("%s: list_exports returned %zu names", b->name, count); return 0; } const char * backend_default_export (struct backend *b, int readonly) { GET_CONN; const char *s; controlpath_debug ("%s: default_export readonly=%d tls=%d", b->name, readonly, conn->using_tls); if (conn->default_exportname[b->i] == NULL) { assert (conn->top_context == NULL); s = b->default_export (b, readonly, conn->using_tls); /* Ignore over-length strings. XXX Also ignore non-UTF8? */ if (s && strnlen (s, NBD_MAX_STRING + 1) > NBD_MAX_STRING) { controlpath_debug ("%s: default_export: ignoring invalid string", b->name); s = NULL; } if (s) { /* Best effort caching */ conn->default_exportname[b->i] = strdup (s); if (conn->default_exportname[b->i] == NULL) return s; } } return conn->default_exportname[b->i]; } static struct nbdkit_next_ops next_ops = { .prepare = backend_prepare, .finalize = backend_finalize, .export_description = backend_export_description, .get_size = backend_get_size, .block_size = backend_block_size, .can_write = backend_can_write, .can_flush = backend_can_flush, .is_rotational = backend_is_rotational, .can_trim = backend_can_trim, .can_zero = backend_can_zero, .can_fast_zero = backend_can_fast_zero, .can_extents = backend_can_extents, .can_fua = backend_can_fua, .can_multi_conn = backend_can_multi_conn, .can_cache = backend_can_cache, .pread = backend_pread, .pwrite = backend_pwrite, .flush = backend_flush, .trim = backend_trim, .zero = backend_zero, .extents = backend_extents, .cache = backend_cache, }; struct context * backend_open (struct backend *b, int readonly, const char *exportname, int shared) { struct connection *conn = threadlocal_get_conn (); bool using_tls; struct context *c; if (shared) using_tls = tls == 2; else { assert (conn); using_tls = conn->using_tls; } c = calloc (1, sizeof *c); if (c == NULL) { nbdkit_error ("malloc: %m"); return NULL; } c->magic = CONTEXT_MAGIC; PUSH_CONTEXT_FOR_SCOPE (c); controlpath_debug ("%s: open readonly=%d exportname=\"%s\" tls=%d", b->name, readonly, exportname, using_tls); c->next = next_ops; c->handle = NULL; c->b = b; c->c_next = NULL; c->conn = shared ? NULL : conn; c->state = 0; c->exportsize = -1; c->minimum_block_size = c->preferred_block_size = c->maximum_block_size = -1; c->can_write = readonly ? 0 : -1; c->can_flush = -1; c->is_rotational = -1; c->can_trim = -1; c->can_zero = -1; c->can_fast_zero = -1; c->can_fua = -1; c->can_multi_conn = -1; c->can_extents = -1; c->can_cache = -1; /* Determine the canonical name for default export */ if (!*exportname && c->conn) { exportname = backend_default_export (b, readonly); if (exportname == NULL) { nbdkit_error ("default export (\"\") not permitted"); free (c); return NULL; } } /* Most filters will call next_open first, resulting in * inner-to-outer ordering. */ c->handle = b->open (c, readonly, exportname, using_tls); controlpath_debug ("%s: open returned handle %p", b->name, c->handle); if (c->handle == NULL) { if (b->i && c->c_next != NULL) backend_close (c->c_next); free (c); return NULL; } c->state |= HANDLE_OPEN; return c; } int backend_prepare (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle); assert (c->state & HANDLE_OPEN); if (c->state & HANDLE_CONNECTED) return 0; /* Call these in order starting from the filter closest to the * plugin, similar to typical .open order. But remember that * a filter may skip opening its backend. */ if (b->i && c->c_next != NULL && backend_prepare (c->c_next) == -1) return -1; controlpath_debug ("%s: prepare readonly=%d", b->name, c->can_write == 0); if (b->prepare (c, c->can_write == 0) == -1) return -1; c->state |= HANDLE_CONNECTED; return 0; } int backend_finalize (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); /* Call these in reverse order to .prepare above, starting from the * filter furthest away from the plugin, and matching .close order. */ /* Once finalize fails, we can do nothing further on this connection */ if (c->state & HANDLE_FAILED) return -1; if (c->state & HANDLE_CONNECTED) { assert (c->state & HANDLE_OPEN && c->handle); controlpath_debug ("%s: finalize", b->name); if (b->finalize (c) == -1) { c->state |= HANDLE_FAILED; return -1; } } if (b->i && c->c_next != NULL) return backend_finalize (c->c_next); return 0; } void backend_close (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; struct context *c_next = c->c_next; /* outer-to-inner order, opposite .open */ assert (b->magic == BACKEND_MAGIC); assert (c->handle); assert (c->state & HANDLE_OPEN); controlpath_debug ("%s: close", b->name); b->close (c); free (c); if (c_next != NULL) backend_close (c_next); } bool backend_valid_range (struct context *c, uint64_t offset, uint32_t count) { assert (c->exportsize <= INT64_MAX); /* Guaranteed by negotiation phase */ return count > 0 && offset <= c->exportsize && offset + count <= c->exportsize; } /* Wrappers for all callbacks in a filter's struct nbdkit_next_ops. */ const char * backend_export_description (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; const char *s; assert (b->magic == BACKEND_MAGIC); controlpath_debug ("%s: export_description", b->name); assert (c->handle && (c->state & HANDLE_CONNECTED)); /* Caching is not useful for this value. */ s = b->export_description (c); /* Ignore over-length strings. XXX Also ignore non-UTF8? */ if (s && strnlen (s, NBD_MAX_STRING + 1) > NBD_MAX_STRING) { controlpath_debug ("%s: export_description: ignoring invalid string", b->name); s = NULL; } return s; } int64_t backend_get_size (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->exportsize == -1) { controlpath_debug ("%s: get_size", b->name); c->exportsize = b->get_size (c); } return c->exportsize; } int backend_block_size (struct context *c, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->minimum_block_size != -1) { *minimum = c->minimum_block_size; *preferred = c->preferred_block_size; *maximum = c->maximum_block_size; return 0; } else { controlpath_debug ("%s: block_size", b->name); r = b->block_size (c, minimum, preferred, maximum); if (r == 0) { c->minimum_block_size = *minimum; c->preferred_block_size = *preferred; c->maximum_block_size = *maximum; } return r; } } int backend_can_write (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_write == -1) { controlpath_debug ("%s: can_write", b->name); c->can_write = b->can_write (c); } return c->can_write; } int backend_can_flush (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_flush == -1) { controlpath_debug ("%s: can_flush", b->name); c->can_flush = b->can_flush (c); } return c->can_flush; } int backend_is_rotational (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->is_rotational == -1) { controlpath_debug ("%s: is_rotational", b->name); c->is_rotational = b->is_rotational (c); } return c->is_rotational; } int backend_can_trim (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_trim == -1) { controlpath_debug ("%s: can_trim", b->name); r = backend_can_write (c); if (r != 1) { c->can_trim = 0; return r; } c->can_trim = b->can_trim (c); } return c->can_trim; } int backend_can_zero (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_zero == -1) { controlpath_debug ("%s: can_zero", b->name); r = backend_can_write (c); if (r != 1) { c->can_zero = NBDKIT_ZERO_NONE; return r; /* Relies on 0 == NBDKIT_ZERO_NONE */ } c->can_zero = b->can_zero (c); } return c->can_zero; } int backend_can_fast_zero (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_fast_zero == -1) { controlpath_debug ("%s: can_fast_zero", b->name); r = backend_can_zero (c); if (r < NBDKIT_ZERO_EMULATE) { c->can_fast_zero = 0; return r; /* Relies on 0 == NBDKIT_ZERO_NONE */ } c->can_fast_zero = b->can_fast_zero (c); } return c->can_fast_zero; } int backend_can_extents (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_extents == -1) { controlpath_debug ("%s: can_extents", b->name); c->can_extents = b->can_extents (c); } return c->can_extents; } int backend_can_fua (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_fua == -1) { controlpath_debug ("%s: can_fua", b->name); r = backend_can_write (c); if (r != 1) { c->can_fua = NBDKIT_FUA_NONE; return r; /* Relies on 0 == NBDKIT_FUA_NONE */ } c->can_fua = b->can_fua (c); } return c->can_fua; } int backend_can_multi_conn (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_multi_conn == -1) { controlpath_debug ("%s: can_multi_conn", b->name); c->can_multi_conn = b->can_multi_conn (c); } return c->can_multi_conn; } int backend_can_cache (struct context *c) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); if (c->can_cache == -1) { controlpath_debug ("%s: can_cache", b->name); c->can_cache = b->can_cache (c); } return c->can_cache; } int backend_pread (struct context *c, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (backend_valid_range (c, offset, count)); assert (flags == 0); datapath_debug ("%s: pread count=%" PRIu32 " offset=%" PRIu64, b->name, count, offset); r = b->pread (c, buf, count, offset, flags, err); if (r == -1) assert (*err); return r; } int backend_pwrite (struct context *c, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; bool fua = !!(flags & NBDKIT_FLAG_FUA); int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_write == 1); assert (backend_valid_range (c, offset, count)); assert (!(flags & ~NBDKIT_FLAG_FUA)); if (fua) assert (c->can_fua > NBDKIT_FUA_NONE); datapath_debug ("%s: pwrite count=%" PRIu32 " offset=%" PRIu64 " fua=%d", b->name, count, offset, fua); r = b->pwrite (c, buf, count, offset, flags, err); if (r == -1) assert (*err); return r; } int backend_flush (struct context *c, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_flush == 1); assert (flags == 0); datapath_debug ("%s: flush", b->name); r = b->flush (c, flags, err); if (r == -1) assert (*err); return r; } int backend_trim (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; bool fua = !!(flags & NBDKIT_FLAG_FUA); int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_write == 1); assert (c->can_trim == 1); assert (backend_valid_range (c, offset, count)); assert (!(flags & ~NBDKIT_FLAG_FUA)); if (fua) assert (c->can_fua > NBDKIT_FUA_NONE); datapath_debug ("%s: trim count=%" PRIu32 " offset=%" PRIu64 " fua=%d", b->name, count, offset, fua); r = b->trim (c, count, offset, flags, err); if (r == -1) assert (*err); return r; } int backend_zero (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; bool fua = !!(flags & NBDKIT_FLAG_FUA); bool fast = !!(flags & NBDKIT_FLAG_FAST_ZERO); int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_write == 1); assert (c->can_zero > NBDKIT_ZERO_NONE); assert (backend_valid_range (c, offset, count)); assert (!(flags & ~(NBDKIT_FLAG_MAY_TRIM | NBDKIT_FLAG_FUA | NBDKIT_FLAG_FAST_ZERO))); if (fua) assert (c->can_fua > NBDKIT_FUA_NONE); if (fast) assert (c->can_fast_zero == 1); datapath_debug ("%s: zero count=%" PRIu32 " offset=%" PRIu64 " may_trim=%d fua=%d fast=%d", b->name, count, offset, !!(flags & NBDKIT_FLAG_MAY_TRIM), fua, fast); if (c->can_zero == NBDKIT_ZERO_NATIVE) r = b->zero (c, count, offset, flags, err); else { /* NBDKIT_ZERO_EMULATE */ int writeflags = 0; bool need_flush = false; if (fast) { *err = ENOTSUP; return -1; } if (fua) { if (c->can_fua == NBDKIT_FUA_EMULATE) need_flush = true; else writeflags = NBDKIT_FLAG_FUA; } while (count) { /* Always contains zeroes, but we can't use const or else gcc 9 * will use .rodata instead of .bss and inflate the binary size. */ static /* const */ char buffer[MAX_REQUEST_SIZE]; uint32_t limit = MIN (count, MAX_REQUEST_SIZE); if (limit == count && need_flush) writeflags = NBDKIT_FLAG_FUA; if (backend_pwrite (c, buffer, limit, offset, writeflags, err) == -1) return -1; offset += limit; count -= limit; } r = 0; } if (r == -1) { assert (*err); if (!fast) assert (*err != ENOTSUP && *err != EOPNOTSUPP); } return r; } int backend_extents (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_extents >= 0); assert (backend_valid_range (c, offset, count)); assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); datapath_debug ("%s: extents count=%" PRIu32 " offset=%" PRIu64 " req_one=%d", b->name, count, offset, !!(flags & NBDKIT_FLAG_REQ_ONE)); if (c->can_extents == 0) { /* By default it is safe assume that everything in the range is * allocated. */ r = nbdkit_add_extent (extents, offset, count, 0 /* allocated data */); if (r == -1) *err = errno; return r; } r = b->extents (c, count, offset, flags, extents, err); if (r == -1) assert (*err); return r; } int backend_cache (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { PUSH_CONTEXT_FOR_SCOPE (c); struct backend *b = c->b; int r; assert (b->magic == BACKEND_MAGIC); assert (c->handle && (c->state & HANDLE_CONNECTED)); assert (c->can_cache > NBDKIT_CACHE_NONE); assert (backend_valid_range (c, offset, count)); assert (flags == 0); datapath_debug ("%s: cache count=%" PRIu32 " offset=%" PRIu64, b->name, count, offset); if (c->can_cache == NBDKIT_CACHE_EMULATE) { static char buf[MAX_REQUEST_SIZE]; /* data sink, never read */ uint32_t limit; while (count) { limit = MIN (count, sizeof buf); if (backend_pread (c, buf, limit, offset, flags, err) == -1) return -1; count -= limit; offset += limit; } return 0; } r = b->cache (c, count, offset, flags, err); if (r == -1) assert (*err); return r; } nbdkit-1.42.2/server/background.c0000644000175000017500000000570514534316443012343 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" /* True if we forked into the background (used to control log messages). */ bool forked_into_background; #ifndef WIN32 /* This is a separate function because RHEL 6-era gcc requires pragmas * outside function scope. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" static void chdir_root (void) { chdir ("/"); } #pragma GCC diagnostic pop /* Run as a background process. If foreground is set (ie. -f or * equivalent) then this does nothing. Otherwise it forks into the * background and sets forked_into_background. */ void fork_into_background (void) { pid_t pid; if (foreground) return; pid = fork (); if (pid == -1) { perror ("fork"); exit (EXIT_FAILURE); } if (pid > 0) /* Parent process exits. */ exit (EXIT_SUCCESS); chdir_root (); /* By this point, stdin/out have been redirected to /dev/null. * If not verbose, set stderr to the same as stdout as well. */ if (!verbose) dup2 (STDOUT_FILENO, STDERR_FILENO); forked_into_background = true; debug ("forked into background (new pid = %d)", getpid ()); } #else /* WIN32 */ void fork_into_background (void) { if (foreground) return; fprintf (stderr, "nbdkit: You must use the -f option on Windows.\n"); NOT_IMPLEMENTED_ON_WINDOWS ("daemonizing"); } #endif /* WIN32 */ nbdkit-1.42.2/server/captive.c0000644000175000017500000001215014623341243011642 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #ifdef HAVE_SYS_WAIT_H #include #endif #include "open_memstream.h" #include "utils.h" #include "internal.h" #ifndef WIN32 /* Handle the --run option. If run is NULL, does nothing. If run is * not NULL then run nbdkit as a captive subprocess of the command. */ void run_command (void) { FILE *fp; char *cmd = NULL; size_t len = 0; int r, status; pid_t pid; if (!run) return; fp = open_memstream (&cmd, &len); if (fp == NULL) { perror ("open_memstream"); exit (EXIT_FAILURE); } /* Construct $uri. */ fprintf (fp, "uri="); if (uri) shell_quote (uri, fp); putc ('\n', fp); /* Since nbdkit 1.24, $nbd is a synonym for $uri. */ fprintf (fp, "nbd=\"$uri\"\n"); /* Expose $exportname. */ fprintf (fp, "exportname="); if (export_name) shell_quote (export_name, fp); putc ('\n', fp); /* Construct $port and $unixsocket. */ fprintf (fp, "port="); if (port) shell_quote (port, fp); putc ('\n', fp); fprintf (fp, "unixsocket="); if (unixsocket) shell_quote (unixsocket, fp); fprintf (fp, "\n"); /* Construct TLS-related variables. */ if (tls > 0) fprintf (fp, "tls=%d\n", tls); fprintf (fp, "tls_certificates="); if (tls_certificates_dir) shell_quote (tls_certificates_dir, fp); fprintf (fp, "\n"); fprintf (fp, "tls_psk="); if (tls_psk) shell_quote (tls_psk, fp); fprintf (fp, "\n"); /* Add the --run command. Note we don't have to quote this. */ fprintf (fp, "%s", run); if (fclose (fp) == EOF) { perror ("memstream failed"); exit (EXIT_FAILURE); } /* Fork. Captive nbdkit runs as the child process. */ pid = fork (); if (pid == -1) { perror ("fork"); exit (EXIT_FAILURE); } if (pid > 0) { /* Parent process is the run command. */ /* Restore original stdin/out */ if (dup2 (saved_stdin, STDIN_FILENO) == -1 || dup2 (saved_stdout, STDOUT_FILENO) == -1) { r = -1; } else r = system (cmd); if (r == -1) { nbdkit_error ("failure to execute external command: %m"); r = EXIT_FAILURE; } else if (WIFEXITED (r)) r = WEXITSTATUS (r); else { assert (WIFSIGNALED (r)); fprintf (stderr, "%s: external command was killed by signal %d\n", program_name, WTERMSIG (r)); r = WTERMSIG (r) + 128; } switch (waitpid (pid, &status, WNOHANG)) { case -1: nbdkit_error ("waitpid: %m"); r = EXIT_FAILURE; break; case 0: /* Captive nbdkit is still running; kill it. We want to wait * for nbdkit to exit since that ensures all cleanup is done in * the plugin before we return. However we don't care if nbdkit * returns an error, the exit code we return always comes from * the --run command. */ kill (pid, SIGTERM); waitpid (pid, NULL, 0); break; default: /* Captive nbdkit exited unexpectedly; update the exit status. */ if (WIFEXITED (status)) { if (r == 0) r = WEXITSTATUS (status); } else { assert (WIFSIGNALED (status)); fprintf (stderr, "%s: nbdkit command was killed by signal %d\n", program_name, WTERMSIG (status)); r = WTERMSIG (status) + 128; } } exit (r); } free (cmd); debug ("forked into background (new pid = %d)", getpid ()); } #else /* WIN32 */ void run_command (void) { if (!run) return; NOT_IMPLEMENTED_ON_WINDOWS ("--run"); } #endif /* WIN32 */ nbdkit-1.42.2/server/connections.c0000644000175000017500000003325614771245250012550 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #include "internal.h" #include "utils.h" /* Default number of parallel requests. */ #define DEFAULT_PARALLEL_REQUESTS 16 static struct connection *new_connection (int sockin, int sockout, int nworkers); static void free_connection (struct connection *conn); /* Don't call these raw socket functions directly. Use conn->recv etc. */ static int raw_recv ( void *buf, size_t len); static int raw_send_socket (const void *buf, size_t len, int flags); #ifndef WIN32 static int raw_send_other (const void *buf, size_t len, int flags); #endif static void raw_close (int how); conn_status connection_get_status (void) { GET_CONN; conn_status r; if (conn->nworkers && pthread_mutex_lock (&conn->status_lock)) abort (); r = conn->status; if (conn->nworkers && pthread_mutex_unlock (&conn->status_lock)) abort (); return r; } /* Update the status if the new value is lower than the existing value. * Return true if the caller should shutdown. */ bool connection_set_status (conn_status value) { GET_CONN; bool ret = false; if (conn->nworkers && pthread_mutex_lock (&conn->status_lock)) abort (); if (value < conn->status) { if (conn->nworkers && conn->status > STATUS_CLIENT_DONE && value <= STATUS_CLIENT_DONE) { char c = 0; assert (conn->status_pipe[1] >= 0); if (write (conn->status_pipe[1], &c, 1) != 1 && errno != EAGAIN) debug ("failed to notify pipe-to-self: %m"); } if (conn->status >= STATUS_CLIENT_DONE && value < STATUS_CLIENT_DONE) ret = true; conn->status = value; } if (conn->nworkers && pthread_mutex_unlock (&conn->status_lock)) abort (); return ret; } struct worker_data { struct connection *conn; char *name; }; static void * connection_worker (void *data) { struct worker_data *worker = data; struct connection *conn = worker->conn; char *name = worker->name; debug ("starting worker thread %s", name); threadlocal_new_server_thread (); threadlocal_set_name (name); threadlocal_set_conn (conn); free (worker); while (!quit && connection_get_status () > STATUS_CLIENT_DONE) if (protocol_recv_request_send_reply ()) { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); conn->close (SHUT_WR); } debug ("exiting worker thread %s", threadlocal_get_name ()); free (name); return NULL; } void handle_single_connection (int sockin, int sockout) { const char *plugin_name; int r; struct connection *conn; int nworkers = threads ? threads : DEFAULT_PARALLEL_REQUESTS; pthread_t *workers = NULL; lock_connection (); /* Because of asynchronous exit it is plausible that a new * connection is started at the same time as the backend is being * shut down. top may therefore be NULL, and if this happens return * immediately. */ if (!top) { unlock_connection (); return; } if (thread_model < NBDKIT_THREAD_MODEL_PARALLEL || nworkers == 1) nworkers = 0; conn = new_connection (sockin, sockout, nworkers); if (!conn) goto done; plugin_name = top->plugin_name (top); threadlocal_set_name (plugin_name); if (top->preconnect (top, read_only) == -1) goto done; /* Start the timeout just before the NBD handshake, but after * preconnect (so we don't bother to create a timer if the client * was rejected by IP rules etc). */ if (start_timeout (conn) == -1) goto done; /* NBD handshake. * * Note that this calls the backend .open callback when it is safe * to do so (eg. after TLS authentication). */ if (protocol_handshake () == -1) goto done; conn->handshake_complete = true; cancel_timeout (conn); if (!nworkers) { /* No need for a separate thread. */ debug ("handshake complete, processing requests serially"); while (!quit && connection_get_status () > STATUS_CLIENT_DONE) if (protocol_recv_request_send_reply ()) conn->close (SHUT_WR); } else { /* Create thread pool to process requests. */ debug ("handshake complete, processing requests with %d threads", nworkers); workers = calloc (nworkers, sizeof *workers); if (unlikely (!workers)) { perror ("malloc"); goto done; } for (nworkers = 0; nworkers < conn->nworkers; nworkers++) { struct worker_data *worker = malloc (sizeof *worker); int err; if (unlikely (!worker)) { perror ("malloc"); connection_set_status (STATUS_DEAD); goto wait; } if (unlikely (asprintf (&worker->name, "%s.%d", plugin_name, nworkers) < 0)) { perror ("asprintf"); connection_set_status (STATUS_DEAD); free (worker); goto wait; } worker->conn = conn; err = pthread_create (&workers[nworkers], NULL, connection_worker, worker); if (unlikely (err)) { errno = err; perror ("pthread_create"); connection_set_status (STATUS_DEAD); free (worker); goto wait; } } wait: while (nworkers) pthread_join (workers[--nworkers], NULL); free (workers); } /* Finalize (for filters), called just before close. */ lock_request (); r = backend_finalize (conn->top_context); unlock_request (); if (r == -1) goto done; done: free_connection (conn); unlock_connection (); } static struct connection * new_connection (int sockin, int sockout, int nworkers) { struct connection *conn; #ifndef WIN32 int opt; socklen_t optlen = sizeof opt; #endif conn = calloc (1, sizeof *conn); if (conn == NULL) { perror ("malloc"); return NULL; } conn->magic = CONN_MAGIC; conn->status_pipe[0] = conn->status_pipe[1] = -1; pthread_mutex_init (&conn->request_lock, NULL); pthread_mutex_init (&conn->read_lock, NULL); pthread_mutex_init (&conn->write_lock, NULL); pthread_mutex_init (&conn->status_lock, NULL); conn->default_exportname = calloc (top->i + 1, sizeof *conn->default_exportname); if (conn->default_exportname == NULL) { perror ("malloc"); goto error1; } conn->status = STATUS_ACTIVE; conn->nworkers = nworkers; if (nworkers) { #ifdef HAVE_PIPE2 if (pipe2 (conn->status_pipe, O_NONBLOCK | O_CLOEXEC)) { perror ("pipe2"); goto error2; } #else #ifdef HAVE_PIPE /* If we were fully parallel, then this function could be * accepting connections in one thread while another thread could * be in a plugin trying to fork. But plugins.c forced * thread_model to serialize_all_requests when it detects a lack * of atomic CLOEXEC, at which point, we can use a mutex to ensure * we aren't accepting until the plugin is not running, making * non-atomicity okay. */ assert (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS); lock_request (); if (pipe (conn->status_pipe)) { perror ("pipe"); unlock_request (); goto error2; } if (set_nonblock (set_cloexec (conn->status_pipe[0])) == -1) { perror ("fcntl"); close (conn->status_pipe[1]); unlock_request (); goto error2; } if (set_nonblock (set_cloexec (conn->status_pipe[1])) == -1) { perror ("fcntl"); close (conn->status_pipe[0]); unlock_request (); goto error2; } unlock_request (); #else /* !HAVE_PIPE2 && !HAVE_PIPE */ /* Windows has neither pipe2 nor pipe. XXX */ #endif #endif } conn->sockin = sockin; conn->sockout = sockout; conn->recv = raw_recv; #ifndef WIN32 if (getsockopt (sockout, SOL_SOCKET, SO_TYPE, &opt, &optlen) == 0) conn->send = raw_send_socket; else conn->send = raw_send_other; #else conn->send = raw_send_socket; #endif conn->close = raw_close; threadlocal_set_conn (conn); return conn; #if defined (HAVE_PIPE2) || defined (HAVE_PIPE) error2: #endif if (conn->status_pipe[0] >= 0) close (conn->status_pipe[0]); if (conn->status_pipe[1] >= 0) close (conn->status_pipe[1]); free (conn->default_exportname); error1: pthread_mutex_destroy (&conn->request_lock); pthread_mutex_destroy (&conn->read_lock); pthread_mutex_destroy (&conn->write_lock); pthread_mutex_destroy (&conn->status_lock); free (conn); return NULL; } static void free_connection (struct connection *conn) { struct backend *b; if (!conn) return; cancel_timeout (conn); conn->close (SHUT_RDWR); /* Don't call the plugin again if quit has been set because the main * thread will be in the process of unloading it. The plugin.unload * callback should always be called. */ if (!quit) { lock_request (); if (conn->top_context) { backend_close (conn->top_context); conn->top_context = NULL; } unlock_request (); } if (conn->status_pipe[0] >= 0) { close (conn->status_pipe[0]); close (conn->status_pipe[1]); } pthread_mutex_destroy (&conn->request_lock); pthread_mutex_destroy (&conn->read_lock); pthread_mutex_destroy (&conn->write_lock); pthread_mutex_destroy (&conn->status_lock); free (conn->exportname_from_set_meta_context); free_interns (); for_each_backend (b) free (conn->default_exportname[b->i]); free (conn->default_exportname); conn->magic = 0; free (conn); threadlocal_set_conn (NULL); } /* Write buffer to conn->sockout with send() and either succeed completely * (returns 0) or fail (returns -1). flags may include SEND_MORE as a hint * that this send will be followed by related data. */ static int raw_send_socket (const void *vbuf, size_t len, int flags) { GET_CONN; int sock = conn->sockout; const char *buf = vbuf; ssize_t r; int f = 0; if (sock < 0) { errno = EBADF; return -1; } #ifdef MSG_MORE if (flags & SEND_MORE) f |= MSG_MORE; #endif while (len > 0) { r = send (sock, buf, len, f); if (r == -1) { if (errno == EINTR || errno == EAGAIN) continue; return -1; } buf += r; len -= r; } return 0; } #ifndef WIN32 /* Write buffer to conn->sockout with write() and either succeed completely * (returns 0) or fail (returns -1). flags is ignored. */ static int raw_send_other (const void *vbuf, size_t len, int flags) { GET_CONN; int sock = conn->sockout; const char *buf = vbuf; ssize_t r; assert (sock >= 0); while (len > 0) { r = write (sock, buf, len); if (r == -1) { if (errno == EINTR || errno == EAGAIN) continue; return -1; } buf += r; len -= r; } return 0; } #endif /* !WIN32 */ /* Read buffer from conn->sockin and either succeed completely * (returns > 0), read an EOF (returns 0), or fail (returns -1). */ static int raw_recv (void *vbuf, size_t len) { GET_CONN; int sock = conn->sockin; char *buf = vbuf; ssize_t r; bool first_read = true; while (len > 0) { /* On Unix we want to use read(2) here because that allows us to * read from non-sockets (think: nbdkit -s). In particular this * makes fuzzing possible. However this is not possible on * Windows where we must use recv. */ #ifndef WIN32 r = read (sock, buf, len); #else r = recv (sock, buf, len, 0); #endif if (r == -1) { if (errno == EINTR || errno == EAGAIN) continue; return -1; } if (r == 0) { if (first_read) return 0; /* Partial record read. This is an error. */ errno = EBADMSG; return -1; } first_read = false; buf += r; len -= r; } return 1; } /* There's no place in the NBD protocol to send back errors from * close, so this function ignores errors. * * If @how == SHUT_WR and conn->nworkers > 1, the caller holds write_lock. */ static void raw_close (int how) { GET_CONN; if (conn->sockout >= 0 && how == SHUT_WR) { if (conn->sockin == conn->sockout) shutdown (conn->sockout, how); else closesocket (conn->sockout); conn->sockout = -1; } else { if (conn->sockin >= 0) closesocket (conn->sockin); if (conn->sockout >= 0 && conn->sockin != conn->sockout) closesocket (conn->sockout); } } nbdkit-1.42.2/server/crypto.c0000644000175000017500000006226514676465664011571 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include #include #include "cleanup.h" #include "internal.h" #include "realpath.h" #include "strndup.h" #ifdef HAVE_GNUTLS #include #include /* See comment in configure.ac */ #ifdef HAVE_GNUTLS_SOCKET_H #include #endif #ifdef HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED #define TRY_KTLS 1 #else #define TRY_KTLS 0 #endif static int crypto_auth; #define CRYPTO_AUTH_CERTIFICATES 1 #define CRYPTO_AUTH_PSK 2 static gnutls_certificate_credentials_t x509_creds; static gnutls_psk_server_credentials_t psk_creds; static void print_gnutls_error (int err, const char *fs, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); static void print_gnutls_error (int err, const char *fs, ...) { va_list args; fprintf (stderr, "%s: GnuTLS error: ", program_name); va_start (args, fs); vfprintf (stderr, fs, args); va_end (args); fprintf (stderr, ": %s\n", gnutls_strerror (err)); } /* Try to load certificates from 'path'. Returns true if successful. * If it's not a certicate directory it returns false. Exits on * other errors. */ static int load_certificates (const char *path) { CLEANUP_FREE char *ca_cert_filename = NULL; CLEANUP_FREE char *server_cert_filename = NULL; CLEANUP_FREE char *server_key_filename = NULL; CLEANUP_FREE char *ca_crl_filename = NULL; int err; if (asprintf (&ca_cert_filename, "%s/ca-cert.pem", path) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (asprintf (&server_cert_filename, "%s/server-cert.pem", path) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (asprintf (&server_key_filename, "%s/server-key.pem", path) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (asprintf (&ca_crl_filename, "%s/ca-crl.pem", path) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } /* Our test for a certificate directory is that ca-cert.pem, * server-cert.pem and server-key.pem must all exist in the path. */ if (access (ca_cert_filename, R_OK) == -1) return 0; if (access (server_cert_filename, R_OK) == -1) return 0; if (access (server_key_filename, R_OK) == -1) return 0; /* Any problem past here is a hard error. */ err = gnutls_certificate_allocate_credentials (&x509_creds); if (err < 0) { print_gnutls_error (err, "allocating credentials"); exit (EXIT_FAILURE); } err = gnutls_certificate_set_x509_trust_file (x509_creds, ca_cert_filename, GNUTLS_X509_FMT_PEM); if (err < 0) { print_gnutls_error (err, "loading %s", ca_cert_filename); exit (EXIT_FAILURE); } if (access (ca_crl_filename, R_OK) == 0) { err = gnutls_certificate_set_x509_crl_file (x509_creds, ca_crl_filename, GNUTLS_X509_FMT_PEM); if (err < 0) { print_gnutls_error (err, "loading %s", ca_crl_filename); exit (EXIT_FAILURE); } } err = gnutls_certificate_set_x509_key_file (x509_creds, server_cert_filename, server_key_filename, GNUTLS_X509_FMT_PEM); if (err < 0) { print_gnutls_error (err, "loading server certificate and key (%s, %s)", server_cert_filename, server_key_filename); exit (EXIT_FAILURE); } debug ("successfully loaded TLS certificates from %s", path); return 1; } static int start_certificates (void) { /* Try to locate the certificates directory and load them. */ if (tls_certificates_dir == NULL) { const char *home; CLEANUP_FREE char *path = NULL; #ifndef WIN32 #define RUNNING_AS_NON_ROOT_FOR_CERTIFICATES_DIR (geteuid () != 0) #else #define RUNNING_AS_NON_ROOT_FOR_CERTIFICATES_DIR 0 #endif if (RUNNING_AS_NON_ROOT_FOR_CERTIFICATES_DIR) { home = getenv ("HOME"); if (home) { if (asprintf (&path, "%s/.pki/%s", home, PACKAGE_NAME) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (load_certificates (path)) goto found_certificates; free (path); if (asprintf (&path, "%s/.config/pki/%s", home, PACKAGE_NAME) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (load_certificates (path)) goto found_certificates; } } else { /* geteuid () == 0 */ if (load_certificates (root_tls_certificates_dir)) goto found_certificates; } } else { if (load_certificates (tls_certificates_dir)) goto found_certificates; } return -1; found_certificates: #ifdef HAVE_GNUTLS_CERTIFICATE_SET_KNOWN_DH_PARAMS gnutls_certificate_set_known_dh_params (x509_creds, GNUTLS_SEC_PARAM_MEDIUM); #endif return 0; } static int start_psk (void) { int err; CLEANUP_FREE char *abs_psk_file = NULL; /* Make sure the path to the PSK file is absolute. */ abs_psk_file = realpath (tls_psk, NULL); if (abs_psk_file == NULL) { perror (tls_psk); exit (EXIT_FAILURE); } err = gnutls_psk_allocate_server_credentials (&psk_creds); if (err < 0) { print_gnutls_error (err, "allocating PSK credentials"); exit (EXIT_FAILURE); } /* Note that this function makes a copy of the string. * CLEANUP_FREE macro above will free abs_psk_file when * we return, but this is safe. */ gnutls_psk_set_server_credentials_file (psk_creds, abs_psk_file); return 0; } /* Initialize crypto. This also handles the command line parameters * and loading the server certificate. */ void crypto_init (bool tls_set_on_cli) { int err, r; const char *what; err = gnutls_global_init (); if (err < 0) { print_gnutls_error (err, "initializing GnuTLS"); exit (EXIT_FAILURE); } if (tls == 0) /* --tls=off */ return; /* --tls-psk overrides certificates. */ if (tls_psk != NULL) { what = "Pre-Shared Keys (PSK)"; r = start_psk (); if (r == 0) crypto_auth = CRYPTO_AUTH_PSK; } else { what = "X.509 certificates"; r = start_certificates (); if (r == 0) crypto_auth = CRYPTO_AUTH_CERTIFICATES; } if (r == 0) { debug ("TLS enabled using: %s", what); return; } /* If we get here, we didn't manage to load the PSK file / * certificates. If --tls=require was given on the command line * then that's a problem. */ if (tls == 2) { /* --tls=require */ fprintf (stderr, "%s: --tls=require but could not load TLS certificates.\n" "Try setting ‘--tls-certificates=/path/to/certificates’ or read\n" "the \"TLS\" section in nbdkit(1).\n", program_name); exit (EXIT_FAILURE); } /* If --tls=on was given on the command line, warn before we turn * TLS off. */ if (tls == 1 && tls_set_on_cli) { /* explicit --tls=on */ fprintf (stderr, "%s: warning: --tls=on but could not load TLS certificates.\n" "TLS will be disabled and TLS connections will be rejected.\n" "Try setting ‘--tls-certificates=/path/to/certificates’ or read\n" "the \"TLS\" section in nbdkit(1).\n", program_name); } tls = 0; debug ("TLS disabled: could not load TLS certificates"); } void crypto_free (void) { if (tls > 0) { switch (crypto_auth) { case CRYPTO_AUTH_CERTIFICATES: gnutls_certificate_free_credentials (x509_creds); break; case CRYPTO_AUTH_PSK: gnutls_psk_free_server_credentials (psk_creds); break; } } gnutls_global_deinit (); } /* Read buffer from GnuTLS and either succeed completely * (returns > 0), read an EOF (returns 0), or fail (returns -1). */ static int crypto_recv (void *vbuf, size_t len) { GET_CONN; gnutls_session_t session = conn->crypto_session; char *buf = vbuf; ssize_t r; bool first_read = true; assert (session != NULL); while (len > 0) { r = gnutls_record_recv (session, buf, len); if (r < 0) { if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN) continue; nbdkit_error ("gnutls_record_recv: %s", gnutls_strerror (r)); errno = EIO; return -1; } if (r == 0) { if (first_read) return 0; /* Partial record read. This is an error. */ errno = EBADMSG; return -1; } first_read = false; buf += r; len -= r; } return 1; } /* If this send()'s length is so large that it is going to require * multiple TCP segments anyway, there's no need to try and merge it * with any corked data from a previous send that used SEND_MORE. */ #define MAX_SEND_MORE_LEN (64 * 1024) /* Write buffer to GnuTLS and either succeed completely * (returns 0) or fail (returns -1). */ static int crypto_send (const void *vbuf, size_t len, int flags) { GET_CONN; gnutls_session_t session = conn->crypto_session; const char *buf = vbuf; int err; ssize_t r; assert (session != NULL); if (len + gnutls_record_check_corked (session) > MAX_SEND_MORE_LEN) { errno = 0; err = gnutls_record_uncork (session, GNUTLS_RECORD_WAIT); if (err < 0) { nbdkit_error ("gnutls_record_uncork: %s", gnutls_strerror (err)); if (errno == 0) errno = EIO; return -1; } } else if (flags & SEND_MORE) gnutls_record_cork (session); while (len > 0) { errno = 0; r = gnutls_record_send (session, buf, len); if (r < 0) { if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN) continue; nbdkit_error ("gnutls_record_send: %s", gnutls_strerror (r)); if (errno == 0) errno = EIO; return -1; } buf += r; len -= r; } if (!(flags & SEND_MORE)) { errno = 0; err = gnutls_record_uncork (session, GNUTLS_RECORD_WAIT); if (err < 0) { nbdkit_error ("gnutls_record_uncork: %s", gnutls_strerror (err)); if (errno == 0) errno = EIO; return -1; } } return 0; } /* There's no place in the NBD protocol to send back errors from * close, so this function ignores errors. */ static void crypto_close (int how) { GET_CONN; gnutls_session_t session = conn->crypto_session; int sockin, sockout; assert (session != NULL); if (how == SHUT_WR) gnutls_bye (session, GNUTLS_SHUT_WR); else { gnutls_transport_get_int2 (session, &sockin, &sockout); gnutls_bye (session, GNUTLS_SHUT_RDWR); if (sockin >= 0) closesocket (sockin); if (sockout >= 0 && sockin != sockout) closesocket (sockout); gnutls_deinit (session); conn->crypto_session = NULL; } } #ifdef WIN32 /* Push/pull functions. Only required for Windows, because on Unix we * can use the default send(2) and recv(2). Note these are actually * calling the wrappers win_send and win_recv in windows-compat.h */ static ssize_t push (gnutls_transport_ptr_t ptr, const void *buf, size_t n) { ssize_t r; r = send ((intptr_t) ptr, buf, n, 0); /* XXX call gnutls_transport_set_errno here */ return r; } static ssize_t pull (gnutls_transport_ptr_t ptr, void *buf, size_t n) { ssize_t r; r = recv ((intptr_t) ptr, buf, n, 0); /* XXX call gnutls_transport_set_errno here */ return r; } static int pull_timeout (gnutls_transport_ptr_t ptr, unsigned ms) { #if 0 /* XXX This is what you're supposed to do, but I couldn't get it to * work. */ return gnutls_system_recv_timeout (ptr, ms); #endif return 1; } #endif /* WIN32 */ /* Turn GnuTLS debug messages into nbdkit debug messages * when nbdkit -D nbdkit.tls.log > 0 */ NBDKIT_DLL_PUBLIC int nbdkit_debug_tls_log = 0; static void tls_log (int level, const char *msg) { size_t len; CLEANUP_FREE char *copy = NULL; /* Strip trailing \n added by GnuTLS. */ len = strlen (msg); if (len > 0 && msg[len-1] == '\n') { copy = strndup (msg, len-1); msg = copy; } debug ("gnutls: %d: %s", level, msg); } /* Print additional information about the session using * nbdkit -D nbdkit.tls.session=1 * * https://gnutls.org/manual/html_node/Obtaining-session-information.html */ NBDKIT_DLL_PUBLIC int nbdkit_debug_tls_session = 0; static void debug_x509_cert (gnutls_session_t session) { const gnutls_datum_t *cert_list; unsigned int i, cert_list_size = 0; cert_list = gnutls_certificate_get_peers (session, &cert_list_size); if (cert_list == NULL) { /* Note unless you use --tls-verify-peer you will always see the * following message. */ debug ("TLS: no peer certificates found"); return; } debug ("TLS: peer provided %u certificate(s)", cert_list_size); for (i = 0; i < cert_list_size; ++i) { int ret; gnutls_x509_crt_t cert; gnutls_datum_t cinfo; /* This is for debugging; best-effort is okay */ ret = gnutls_x509_crt_init (&cert); if (ret != 0) continue; ret = gnutls_x509_crt_import (cert, &cert_list[i], GNUTLS_X509_FMT_DER); if (ret != 0) { gnutls_x509_crt_deinit (cert); continue; } ret = gnutls_x509_crt_print (cert, GNUTLS_CRT_PRINT_ONELINE, &cinfo); if (ret == 0) { debug ("TLS: %s", cinfo.data); gnutls_free (cinfo.data); } gnutls_x509_crt_deinit (cert); } } static void debug_session (gnutls_session_t session) { gnutls_credentials_type_t cred; gnutls_kx_algorithm_t kx; bool dhe = false, ecdh = false; int grp; const char *desc, *username, *hint; #if TRY_KTLS gnutls_transport_ktls_enable_flags_t ktls_enabled; #endif if (nbdkit_debug_tls_session <= 0) return; desc = gnutls_session_get_desc (session); if (desc) debug ("TLS session: %s", desc); #if TRY_KTLS ktls_enabled = gnutls_transport_is_ktls_enabled (session); switch (ktls_enabled) { case GNUTLS_KTLS_RECV: debug ("TLS: kTLS enabled for receive only"); break; case GNUTLS_KTLS_SEND: debug ("TLS: kTLS enabled for send only"); break; case GNUTLS_KTLS_DUPLEX: debug ("TLS: kTLS enabled full duplex"); break; default: if ((int) ktls_enabled == 0) debug ("TLS: kTLS disabled"); else debug ("TLS: kTLS enabled unknown setting: %d", (int) ktls_enabled); } #endif kx = gnutls_kx_get (session); cred = gnutls_auth_get_type (session); switch (cred) { case GNUTLS_CRD_SRP: debug ("TLS: authentication: SRP (Secure Remote Password)"); #ifdef HAVE_GNUTLS_SRP_SERVER_GET_USERNAME username = gnutls_srp_server_get_username (session); #else username = NULL; #endif if (username) debug ("TLS: SRP session username: %s", username); break; case GNUTLS_CRD_PSK: debug ("TLS: authentication: PSK (Pre-Shared Key)"); hint = gnutls_psk_client_get_hint (session); if (hint) debug ("TLS: PSK hint: %s", hint); username = gnutls_psk_server_get_username (session); if (username) debug ("TLS: PSK username: %s", username); if (kx == GNUTLS_KX_ECDHE_PSK) ecdh = true; else if (kx == GNUTLS_KX_DHE_PSK) dhe = true; break; case GNUTLS_CRD_ANON: debug ("TLS: authentication: anonymous"); if (kx == GNUTLS_KX_ANON_ECDH) ecdh = true; else if (kx == GNUTLS_KX_ANON_DH) dhe = true; break; case GNUTLS_CRD_CERTIFICATE: debug ("TLS: authentication: certificate"); if (gnutls_certificate_type_get (session) == GNUTLS_CRT_X509) debug_x509_cert (session); if (kx == GNUTLS_KX_DHE_RSA || kx == GNUTLS_KX_DHE_DSS) dhe = true; else if (kx == GNUTLS_KX_ECDHE_RSA || kx == GNUTLS_KX_ECDHE_ECDSA) ecdh = true; break; default: debug ("TLS: authentication: unknown (%d)", (int) cred); } #ifdef HAVE_GNUTLS_GROUP_GET grp = gnutls_group_get (session); #else grp = 0; #endif if (grp) { debug ("TLS: negotiated group: " #ifdef HAVE_GNUTLS_GROUP_GET_NAME "%s", gnutls_group_get_name (grp)); #else "%d", grp); #endif } else { if (ecdh) debug ("TLS: ephemeral ECDH using curve %s", gnutls_ecc_curve_get_name (gnutls_ecc_curve_get (session))); else if (dhe) debug ("TLS: ephemeral DH using prime of %d bits", gnutls_dh_get_prime_bits (session)); } } /* Upgrade an existing connection to TLS. Also this should do access * control if enabled. The protocol code ensures this function can * only be called once per connection. */ int crypto_negotiate_tls (int sockin, int sockout) { GET_CONN; gnutls_session_t session; CLEANUP_FREE char *priority = NULL; int err; /* Create the GnuTLS session. */ err = gnutls_init (&session, GNUTLS_SERVER); if (err < 0) { nbdkit_error ("gnutls_init: %s", gnutls_strerror (err)); return -1; } if (nbdkit_debug_tls_log > 0) gnutls_global_set_log_level (nbdkit_debug_tls_log); gnutls_global_set_log_function (tls_log); switch (crypto_auth) { case CRYPTO_AUTH_CERTIFICATES: /* Associate the session with the server credentials (key, cert). */ err = gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, x509_creds); if (err < 0) { nbdkit_error ("gnutls_credentials_set: %s", gnutls_strerror (err)); goto error; } /* If verify peer is enabled, tell GnuTLS to request the client * certificates. (Note the default is to not request or verify * certificates). */ if (tls_verify_peer) { gnutls_certificate_server_set_request (session, GNUTLS_CERT_REQUEST); gnutls_session_set_verify_cert (session, NULL, 0); } priority = strdup (TLS_PRIORITY); if (priority == NULL) { nbdkit_error ("strdup: %m"); goto error; } break; case CRYPTO_AUTH_PSK: /* Associate the session with the server PSK credentials. */ err = gnutls_credentials_set (session, GNUTLS_CRD_PSK, psk_creds); if (err < 0) { nbdkit_error ("gnutls_credentials_set: %s", gnutls_strerror (err)); goto error; } if (asprintf (&priority, "%s:+ECDHE-PSK:+DHE-PSK:+PSK", TLS_PRIORITY) == -1) { nbdkit_error ("asprintf: %m"); goto error; } break; default: abort (); } assert (priority != NULL); err = gnutls_priority_set_direct (session, priority, NULL); if (err < 0) { nbdkit_error ("failed to set TLS session priority to %s: %s", priority, gnutls_strerror (err)); goto error; } /* Set up GnuTLS so it reads and writes on the raw sockets. */ gnutls_transport_set_int2 (session, sockin, sockout); #ifdef WIN32 gnutls_transport_set_push_function (session, push); gnutls_transport_set_pull_function (session, pull); gnutls_transport_set_pull_timeout_function (session, pull_timeout); #endif /* Perform the handshake. */ debug ("starting TLS handshake"); gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT); do { err = gnutls_handshake (session); } while (err < 0 && gnutls_error_is_fatal (err) == 0); if (err < 0) { gnutls_handshake_description_t in, out; /* Get some additional debug information about where in the * handshake protocol it failed. You have to look up these codes in * . */ in = gnutls_handshake_get_last_in (session); out = gnutls_handshake_get_last_out (session); nbdkit_error ("gnutls_handshake: %s (%d/%d)", gnutls_strerror (err), (int) in, (int) out); goto error; } debug ("TLS handshake completed"); debug_session (session); /* Set up the connection recv/send/close functions so they call * GnuTLS wrappers instead. */ conn->crypto_session = session; conn->recv = crypto_recv; conn->send = crypto_send; conn->close = crypto_close; return 0; error: gnutls_deinit (session); return -1; } /* The prototype of both gnutls_x509_crt_get_dn3 and * gnutls_x509_crt_get_issuer_dn3. */ typedef int (*get_dn3_fn) (gnutls_x509_crt_t cert, gnutls_datum_t *dn, unsigned flags); /* Common function to call either gnutls_x509_crt_get_dn3 or * gnutls_x509_crt_get_issuer_dn3. */ static char * get_peer_dn (const char *fn, get_dn3_fn get_dn3) { GET_CONN; gnutls_session_t session = conn->crypto_session; gnutls_credentials_type_t cred; const gnutls_datum_t *cert_list; unsigned int cert_list_size = 0; gnutls_x509_crt_t cert = NULL; gnutls_datum_t dn = { 0 }; int r; char *ret = NULL; if (!session) { nbdkit_debug ("nbdkit_peer_tls_dn: no TLS session"); goto out_no_dn; } cred = gnutls_auth_get_type (session); if (cred != GNUTLS_CRD_CERTIFICATE) { nbdkit_debug ("nbdkit_peer_tls_dn: " "TLS session not using certificates"); goto out_no_dn; } if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509) { nbdkit_debug ("nbdkit_peer_tls_dn: " "TLS session not using X.509 certificates"); goto out_no_dn; } cert_list = gnutls_certificate_get_peers (session, &cert_list_size); if (cert_list == NULL || cert_list_size == 0) { /* This can happen if tls_verify_peer is not set. It could also * happen because gnutls cannot allocate the certificate list but * that should be a rare error. Return no DN in this case. */ nbdkit_debug ("nbdkit_peer_tls_dn: " "no client certificates (is --tls-verify-peer set?)"); goto out_no_dn; } /* XXX According to the spec, certificates should be sent with the * client's certificate first, but the man page for * gnutls_certificate_get_peers says there are X.509 clients which * send them in a random order. However it's unlikely that there * are any NBD clients doing this. Anyway we only consider the * first certificate in the list. */ r = gnutls_x509_crt_init (&cert); if (r != 0) { nbdkit_error ("gnutls_x509_crt_init: %s", gnutls_strerror (r)); goto out; } r = gnutls_x509_crt_import (cert, &cert_list[0], GNUTLS_X509_FMT_DER); if (r != 0) { nbdkit_error ("gnutls_x509_crt_import: %s", gnutls_strerror (r)); goto out; } r = get_dn3 (cert, &dn, 0); if (r != 0) { nbdkit_error ("%s: %s", fn, gnutls_strerror (r)); goto out; } ret = strdup ((char *) dn.data); if (ret == NULL) { nbdkit_error ("strdup: %m"); ret = NULL; goto out; } out: if (cert) gnutls_x509_crt_deinit (cert); if (dn.data) gnutls_free (dn.data); return ret; /* Not an error, but no DN for this session. */ out_no_dn: if (cert) gnutls_x509_crt_deinit (cert); if (dn.data) gnutls_free (dn.data); ret = strdup (""); if (ret == NULL) { nbdkit_error ("strdup: %m"); return NULL; } return ret; } NBDKIT_DLL_PUBLIC char * nbdkit_peer_tls_dn (void) { return get_peer_dn ("gnutls_x509_crt_get_dn3", gnutls_x509_crt_get_dn3); } NBDKIT_DLL_PUBLIC char * nbdkit_peer_tls_issuer_dn (void) { return get_peer_dn ("gnutls_x509_crt_get_issuer_dn3", gnutls_x509_crt_get_issuer_dn3); } #else /* !HAVE_GNUTLS */ /* GnuTLS was not available at compile time. These are stub versions * of the above functions which either do nothing or report errors as * appropriate. */ void crypto_init (bool tls_set_on_cli) { if (tls > 0) { fprintf (stderr, "%s: TLS cannot be enabled because " "this binary was compiled without GnuTLS.\n", program_name); exit (EXIT_FAILURE); } tls = 0; debug ("TLS disabled: nbdkit was not compiled with GnuTLS support"); } void crypto_free (void) { /* nothing */ } int crypto_negotiate_tls (int sockin, int sockout) { /* Should never be called because tls == 0. */ abort (); } NBDKIT_DLL_PUBLIC char * nbdkit_peer_tls_dn (void) { nbdkit_error ("%s is not supported on this platform", "nbdkit_peer_tls_dn"); return NULL; } NBDKIT_DLL_PUBLIC char * nbdkit_peer_tls_issuer_dn (void) { nbdkit_error ("%s is not supported on this platform", "nbdkit_peer_tls_issuer_dn"); return NULL; } #endif /* !HAVE_GNUTLS */ nbdkit-1.42.2/server/debug.c0000644000175000017500000001043514534316443011306 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include "ansi-colours.h" #include "open_memstream.h" #include "utils.h" #include "internal.h" static void prologue (FILE *fp) { const char *name = threadlocal_get_name (); size_t instance_num = threadlocal_get_instance_num (); fprintf (fp, "%s: ", program_name); if (name) { fprintf (fp, "%s", name); if (instance_num > 0) fprintf (fp, "[%zu]", instance_num); fprintf (fp, ": "); } fprintf (fp, "debug: "); } /* Common debug function. * Note: preserves the previous value of errno. */ static void debug_common (bool in_server, const char *fs, va_list args) { if (!verbose) return; int err = errno; #ifndef WIN32 const int tty = isatty (fileno (stderr)); #else const int tty = 0; #endif CLEANUP_FREE char *str_inner = NULL; CLEANUP_FREE char *str_outer = NULL; FILE *fp_inner, *fp_outer; size_t len_inner = 0, len_outer = 0; /* The "inner" string is the debug string before escaping. */ fp_inner = open_memstream (&str_inner, &len_inner); if (fp_inner == NULL) goto fail; errno = err; /* so %m works */ vfprintf (fp_inner, fs, args); if (close_memstream (fp_inner) == -1) goto fail; /* The "outer" string contains the prologue, escaped debug string and \n. */ fp_outer = open_memstream (&str_outer, &len_outer); if (fp_outer == NULL) goto fail; if (!in_server && tty) ansi_force_colour (ANSI_FG_BOLD_BLACK, fp_outer); prologue (fp_outer); c_string_quote (str_inner, fp_outer); if (!in_server && tty) ansi_force_restore (fp_outer); fprintf (fp_outer, "\n"); if (close_memstream (fp_outer) == -1) goto fail; if (!str_outer) goto fail; /* Send it to stderr as atomically as possible. */ fputs (str_outer, stderr); errno = err; /* restore original value before return */ return; fail: /* Try to emit what we can. */ errno = err; /* so %m works */ vfprintf (stderr, fs, args); fprintf (stderr, "\n"); errno = err; /* restore original value before return */ } /* Note: preserves the previous value of errno. */ NBDKIT_DLL_PUBLIC void nbdkit_vdebug (const char *fs, va_list args) { debug_common (false, fs, args); } /* Note: preserves the previous value of errno. */ NBDKIT_DLL_PUBLIC void nbdkit_debug (const char *fs, ...) { int err = errno; va_list args; va_start (args, fs); debug_common (false, fs, args); va_end (args); errno = err; } /* This variant of debug is used when debug is called from the server * code, via the debug() macro. * * Note: preserves the previous value of errno. */ void debug_in_server (const char *fs, ...) { int err = errno; va_list args; va_start (args, fs); debug_common (true, fs, args); va_end (args); errno = err; } nbdkit-1.42.2/server/debug-flags.c0000644000175000017500000001166714534316443012410 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include "internal.h" #include "strndup.h" struct debug_flag { struct debug_flag *next; char *name; /* plugin or filter name */ char *flag; /* flag name */ char *symbol; /* symbol, eg. "myplugin_debug_foo" */ int value; /* value of flag */ bool used; /* if flag was successfully set */ }; /* Synthesize the name of the *_debug_* variable from the plugin name * and flag. */ static char * symbol_of_debug_flag (const char *name, const char *flag) { char *var; size_t i; int len; len = asprintf (&var, "%s_debug_%s", name, flag); if (len == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } /* If there are any '.'s remaining in the name, convert them to '_'. */ for (i = 0; i < (size_t) len; ++i) { if (var[i] == '.') var[i] = '_'; } return var; /* caller frees */ } /* Parse and add a single -D flag from the command line. * * Debug Flag must be "NAME.FLAG=N". * ^ ^ ^ * arg p q (after +1 adjustment below) */ void add_debug_flag (const char *arg) { struct debug_flag *flag; char *p, *q; p = strchr (arg, '.'); q = strchr (arg, '='); if (p == NULL || q == NULL) { bad_debug_flag: fprintf (stderr, "%s: -D (Debug Flag) must have the format NAME.FLAG=N\n", program_name); exit (EXIT_FAILURE); } p++; /* +1 adjustment */ q++; if (p - arg <= 1) goto bad_debug_flag; /* NAME too short */ if (p > q) goto bad_debug_flag; if (q - p <= 1) goto bad_debug_flag; /* FLAG too short */ if (*q == '\0') goto bad_debug_flag; /* N too short */ flag = malloc (sizeof *flag); if (flag == NULL) { debug_flag_perror: perror ("malloc"); exit (EXIT_FAILURE); } flag->name = strndup (arg, p-arg-1); if (!flag->name) goto debug_flag_perror; flag->flag = strndup (p, q-p-1); if (!flag->flag) goto debug_flag_perror; if (nbdkit_parse_int ("flag", q, &flag->value) == -1) goto bad_debug_flag; flag->used = false; flag->symbol = symbol_of_debug_flag (flag->name, flag->flag); /* Add flag to the linked list. */ flag->next = debug_flags; debug_flags = flag; } /* Apply all debug flags applicable to this backend. */ void apply_debug_flags (void *dl, const char *name) { struct debug_flag *flag; for (flag = debug_flags; flag != NULL; flag = flag->next) { if (!flag->used && strcmp (name, flag->name) == 0) { int *sym; /* Find the symbol. */ sym = dlsym (dl, flag->symbol); if (sym) { /* Set the flag. */ *sym = flag->value; } else { fprintf (stderr, "%s: warning: -D %s.%s: %s does not contain a " "global variable called %s\n", program_name, name, flag->flag, name, flag->symbol); } /* Mark this flag as used. */ flag->used = true; } } } void free_debug_flags (void) { while (debug_flags != NULL) { struct debug_flag *next = debug_flags->next; if (!debug_flags->used) fprintf (stderr, "%s: warning: debug flag -D %s.%s was not used\n", program_name, debug_flags->name, debug_flags->flag); free (debug_flags->name); free (debug_flags->flag); free (debug_flags->symbol); free (debug_flags); debug_flags = next; } } nbdkit-1.42.2/server/exports.c0000644000175000017500000001046514534316443011727 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "vector.h" #include "internal.h" /* Cap nr_exports to avoid sending over-large replies to the client, * and to avoid a plugin with large list consuming too much memory. */ #define MAX_EXPORTS 10000 /* Appendable list of exports. */ DEFINE_VECTOR_TYPE (exports, struct nbdkit_export); struct nbdkit_exports { exports exports; bool use_default; }; NBDKIT_DLL_PUBLIC struct nbdkit_exports * nbdkit_exports_new (void) { struct nbdkit_exports *r; r = malloc (sizeof *r); if (r == NULL) { nbdkit_error ("nbdkit_exports_new: malloc: %m"); return NULL; } r->exports = (exports) empty_vector; r->use_default = false; return r; } static void nbdkit_export_clear (struct nbdkit_export exp) { free (exp.name); free (exp.description); } NBDKIT_DLL_PUBLIC void nbdkit_exports_free (struct nbdkit_exports *exps) { if (exps) { exports_iter (&exps->exports, nbdkit_export_clear); free (exps->exports.ptr); free (exps); } } NBDKIT_DLL_PUBLIC size_t nbdkit_exports_count (const struct nbdkit_exports *exps) { return exps->exports.len; } NBDKIT_DLL_PUBLIC const struct nbdkit_export nbdkit_get_export (const struct nbdkit_exports *exps, size_t i) { assert (i < exps->exports.len); return exps->exports.ptr[i]; } NBDKIT_DLL_PUBLIC int nbdkit_add_export (struct nbdkit_exports *exps, const char *name, const char *description) { struct nbdkit_export e = { NULL, NULL }; if (exps->exports.len == MAX_EXPORTS) { nbdkit_error ("nbdkit_add_export: too many exports"); errno = EINVAL; return -1; } if (strlen (name) > NBD_MAX_STRING || (description && strlen (description) > NBD_MAX_STRING)) { nbdkit_error ("nbdkit_add_export: string too long"); errno = EINVAL; return -1; } e.name = strdup (name); if (e.name == NULL) { nbdkit_error ("nbdkit_add_export: strdup: %m"); return -1; } if (description) { e.description = strdup (description); if (e.description == NULL) { nbdkit_error ("nbdkit_add_export: strdup: %m"); free (e.name); errno = ENOMEM; return -1; } } if (exports_append (&exps->exports, e) == -1) { nbdkit_error ("nbdkit_add_export: realloc: %m"); free (e.name); free (e.description); errno = ENOMEM; return -1; } return 0; } NBDKIT_DLL_PUBLIC int nbdkit_use_default_export (struct nbdkit_exports *exps) { exps->use_default = true; return 0; } int exports_resolve_default (struct nbdkit_exports *exps, struct backend *b, int readonly) { const char *def = NULL; if (exps->use_default) { def = backend_default_export (b, readonly); exps->use_default = false; } if (def) return nbdkit_add_export (exps, def, NULL); return 0; } nbdkit-1.42.2/server/extents.c0000644000175000017500000002472314534316443011717 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include "cleanup.h" #include "isaligned.h" #include "minmax.h" #include "rounding.h" #include "vector.h" #include "internal.h" /* Cap nr_extents to avoid sending over-large replies to the client, * and to avoid a plugin with frequent alternations consuming too much * memory. */ #define MAX_EXTENTS (1 * 1024 * 1024) /* Appendable list of extents. */ DEFINE_VECTOR_TYPE (extents, struct nbdkit_extent); struct nbdkit_extents { extents extents; uint64_t start, end; /* end is one byte beyond the end of the range */ /* Where we expect the next extent to be added. If * nbdkit_add_extent has never been called this is -1. Note this * field is updated even if we don't actually add the extent because * it's used to check for API violations. */ int64_t next; }; NBDKIT_DLL_PUBLIC struct nbdkit_extents * nbdkit_extents_new (uint64_t start, uint64_t end) { struct nbdkit_extents *r; if (start > INT64_MAX || end > INT64_MAX) { nbdkit_error ("nbdkit_extents_new: " "start (%" PRIu64 ") or end (%" PRIu64 ") > INT64_MAX", start, end); errno = ERANGE; return NULL; } /* 0-length ranges are possible, so start == end is not an error. */ if (start > end) { nbdkit_error ("nbdkit_extents_new: " "start (%" PRIu64 ") >= end (%" PRIu64 ")", start, end); errno = ERANGE; return NULL; } r = malloc (sizeof *r); if (r == NULL) { nbdkit_error ("nbdkit_extents_new: malloc: %m"); return NULL; } r->extents = (extents) empty_vector; r->start = start; r->end = end; r->next = -1; return r; } NBDKIT_DLL_PUBLIC void nbdkit_extents_free (struct nbdkit_extents *exts) { if (exts) { free (exts->extents.ptr); free (exts); } } NBDKIT_DLL_PUBLIC size_t nbdkit_extents_count (const struct nbdkit_extents *exts) { return exts->extents.len; } NBDKIT_DLL_PUBLIC struct nbdkit_extent nbdkit_get_extent (const struct nbdkit_extents *exts, size_t i) { assert (i < exts->extents.len); return exts->extents.ptr[i]; } /* Insert *e in the list at the end. */ static int append_extent (struct nbdkit_extents *exts, const struct nbdkit_extent *e) { if (extents_append (&exts->extents, *e) == -1) { nbdkit_error ("nbdkit_add_extent: realloc: %m"); return -1; } return 0; } NBDKIT_DLL_PUBLIC int nbdkit_add_extent (struct nbdkit_extents *exts, uint64_t offset, uint64_t length, uint32_t type) { uint64_t overlap; /* Extents must be added in strictly ascending, contiguous order. */ if (exts->next >= 0 && exts->next != offset) { nbdkit_error ("nbdkit_add_extent: " "extents must be added in ascending order and " "must be contiguous"); errno = ERANGE; return -1; } exts->next = offset + length; /* Ignore zero-length extents. */ if (length == 0) return 0; /* Ignore extents beyond the end of the range, or if list is full. */ if (offset >= exts->end || exts->extents.len >= MAX_EXTENTS) return 0; /* Shorten extents that overlap the end of the range. */ if (offset + length > exts->end) { overlap = offset + length - exts->end; length -= overlap; } if (exts->extents.len == 0) { /* If there are no existing extents, and the new extent is * entirely before start, ignore it. */ if (offset + length <= exts->start) return 0; /* If there are no existing extents, and the new extent is after * start, then this is a bug in the plugin. */ if (offset > exts->start) { nbdkit_error ("nbdkit_add_extent: " "first extent must not be > start (%" PRIu64 ")", exts->start); errno = ERANGE; return -1; } /* If there are no existing extents, and the new extent overlaps * start, truncate it so it starts at start. */ overlap = exts->start - offset; length -= overlap; offset += overlap; } /* If we get here we are going to either add or extend. */ if (exts->extents.len > 0 && exts->extents.ptr[exts->extents.len-1].type == type) { /* Coalesce with the last extent. */ exts->extents.ptr[exts->extents.len-1].length += length; return 0; } else { /* Add a new extent. */ const struct nbdkit_extent e = { .offset = offset, .length = length, .type = type }; return append_extent (exts, &e); } } /* Compute aligned extents on behalf of a filter. */ NBDKIT_DLL_PUBLIC int nbdkit_extents_aligned (struct context *next_c, uint32_t count, uint64_t offset, uint32_t flags, uint32_t align, struct nbdkit_extents *exts, int *err) { struct nbdkit_next_ops *next = &next_c->next; size_t i; struct nbdkit_extent *e, *e2; assert (IS_ALIGNED (count | offset, align)); /* Perform an initial query, then scan for the first unaligned extent. */ if (next->extents (next_c, count, offset, flags, exts, err) == -1) return -1; for (i = 0; i < exts->extents.len; ++i) { e = &exts->extents.ptr[i]; if (!IS_ALIGNED (e->length, align)) { /* If the unalignment is past align, just truncate and return early */ if (e->offset + e->length > offset + align) { e->length = ROUND_DOWN (e->length, align); exts->extents.len = i + !!e->length; exts->next = e->offset + e->length; break; } /* Otherwise, coalesce until we have at least align bytes, which * may require further queries. The type bits are: * NBDKIT_EXTENT_HOLE (1<<0) * NBDKIT_EXTENT_ZERO (1<<1) * and the NBD protocol says any future bits will also have the * desired property that returning '0' is the safe default for * the generic case. Thus, performing the bitwise-and * intersection of the types of underlying extents gives the * correct type for our merged extent. */ assert (i == 0); while (e->length < align) { if (exts->extents.len > 1) { e->length += exts->extents.ptr[1].length; e->type &= exts->extents.ptr[1].type; extents_remove (&exts->extents, 1); } else { /* The plugin needs a fresh extents object each time, but * with care, we can merge it into the callers' exts. */ extents tmp; CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents2 = NULL; extents2 = nbdkit_extents_new (e->offset + e->length, offset + align); if (extents2 == NULL) { *err = errno; return -1; } if (next->extents (next_c, align - e->length, offset + e->length, flags & ~NBDKIT_FLAG_REQ_ONE, extents2, err) == -1) return -1; e2 = &extents2->extents.ptr[0]; assert (e2->offset == e->offset + e->length); e2->offset = e->offset; e2->length += e->length; e2->type &= e->type; e = e2; tmp = exts->extents; exts->extents = extents2->extents; extents2->extents = tmp; } } e->length = align; exts->extents.len = 1; exts->next = e->offset + e->length; break; } } /* Once we get here, all extents are aligned. */ return 0; } /* This is a convenient wrapper around next_ops->extents which can be * used from filters where you want to get a complete set of extents * covering the region [offset..offset+count-1]. */ NBDKIT_DLL_PUBLIC struct nbdkit_extents * nbdkit_extents_full (struct context *next_c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct nbdkit_next_ops *next = &next_c->next; struct nbdkit_extents *ret; /* Clear REQ_ONE to ask the plugin for as much information as it is * willing to return (the plugin may still truncate if it is too * costly to provide everything). */ flags &= ~NBDKIT_FLAG_REQ_ONE; ret = nbdkit_extents_new (offset, offset+count); if (ret == NULL) goto error0; while (count > 0) { const uint64_t old_offset = offset; size_t i; CLEANUP_EXTENTS_FREE struct nbdkit_extents *t = nbdkit_extents_new (offset, offset+count); if (t == NULL) goto error1; if (next->extents (next_c, count, offset, flags, t, err) == -1) goto error0; for (i = 0; i < nbdkit_extents_count (t); ++i) { const struct nbdkit_extent e = nbdkit_get_extent (t, i); if (nbdkit_add_extent (ret, e.offset, e.length, e.type) == -1) goto error1; assert (e.length <= count); offset += e.length; count -= e.length; } /* If the plugin is behaving we must make forward progress. */ assert (offset > old_offset); } return ret; error1: *err = errno; error0: nbdkit_extents_free (ret); return NULL; } nbdkit-1.42.2/server/filters.c0000644000175000017500000005175614534316443011703 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" /* We extend the generic backend struct with extra fields relating * to this filter. */ struct backend_filter { struct backend backend; struct nbdkit_filter filter; }; /* Note this frees the whole chain. */ static void filter_free (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); b->next->free (b->next); backend_unload (b, f->filter.unload); free (f); } static int filter_thread_model (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); int filter_thread_model = NBDKIT_THREAD_MODEL_PARALLEL; int model = b->next->thread_model (b->next); if (f->filter.thread_model) { filter_thread_model = f->filter.thread_model (); if (filter_thread_model == -1) exit (EXIT_FAILURE); } if (filter_thread_model < model) /* more serialized */ model = filter_thread_model; return model; } /* This is actually passing the request through to the final plugin, * hence the function name. */ static const char * plugin_name (struct backend *b) { return b->next->plugin_name (b->next); } static const char * filter_version (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); return f->filter._version; } static void filter_usage (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); const char *p; printf ("filter: %s", b->name); if (f->filter.longname) printf (" (%s)", f->filter.longname); printf ("\n"); printf ("(%s)\n", b->filename); if (f->filter.description) { printf ("%s", f->filter.description); if ((p = strrchr (f->filter.description, '\n')) == NULL || p[1]) printf ("\n"); } if (f->filter.config_help) { printf ("%s", f->filter.config_help); if ((p = strrchr (f->filter.config_help, '\n')) == NULL || p[1]) printf ("\n"); } } /* This implements the --dump-plugin option which can dump additional * fields for any filters present. */ static void filter_dump_fields (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); char *path; b->next->dump_fields (b->next); debug ("%s: dump_plugin", b->name); /* Dump some information about the filter. */ path = nbdkit_realpath (b->filename); printf ("%s_path=%s\n", b->name, path); free (path); printf ("%s_name=%s\n", b->name, b->name); /* We could add filter struct fields here, but they are not so * interesting for filters because they are always tied to the exact * current version of nbdkit so we can determine which fields are * present just by looking at the source. */ /* Custom fields. */ if (f->filter.dump_plugin) { f->filter.dump_plugin (); } } static int next_config (struct backend *b, const char *key, const char *value) { b->config (b, key, value); return 0; } static void filter_config (struct backend *b, const char *key, const char *value) { struct backend_filter *f = container_of (b, struct backend_filter, backend); debug ("%s: config key=%s, value=%s", b->name, key, value); if (f->filter.config) { if (f->filter.config (next_config, b->next, key, value) == -1) exit (EXIT_FAILURE); } else b->next->config (b->next, key, value); } static int next_config_complete (struct backend *b) { b->config_complete (b); return 0; } static void filter_config_complete (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); debug ("%s: config_complete", b->name); if (f->filter.config_complete) { if (f->filter.config_complete (next_config_complete, b->next) == -1) exit (EXIT_FAILURE); } else b->next->config_complete (b->next); } static void filter_get_ready (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); b->next->get_ready (b->next); /* exits on failure */ debug ("%s: get_ready thread_model=%d", b->name, thread_model); if (f->filter.get_ready) { if (f->filter.get_ready (thread_model) == -1) exit (EXIT_FAILURE); } } static void filter_after_fork (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); b->next->after_fork (b->next); /* exits on failure */ debug ("%s: after_fork", b->name); if (f->filter.after_fork) { if (f->filter.after_fork (b->next) == -1) exit (EXIT_FAILURE); } } static void filter_cleanup (struct backend *b) { struct backend_filter *f = container_of (b, struct backend_filter, backend); debug ("%s: cleanup", b->name); if (f->filter.cleanup) f->filter.cleanup (b->next); b->next->cleanup (b->next); } static int filter_preconnect (struct backend *b, int readonly) { struct backend_filter *f = container_of (b, struct backend_filter, backend); debug ("%s: preconnect", b->name); if (f->filter.preconnect) return f->filter.preconnect (b->next->preconnect, b->next, readonly); else return b->next->preconnect (b->next, readonly); } /* magic_config_key only applies to plugins, so this passes the * request through to the plugin (hence the name). */ static const char * plugin_magic_config_key (struct backend *b) { return b->next->magic_config_key (b->next); } static int filter_list_exports (struct backend *b, int readonly, int is_tls, struct nbdkit_exports *exports) { struct backend_filter *f = container_of (b, struct backend_filter, backend); if (f->filter.list_exports) return f->filter.list_exports (backend_list_exports, b->next, readonly, is_tls, exports); return backend_list_exports (b->next, readonly, exports); } static const char * filter_default_export (struct backend *b, int readonly, int is_tls) { struct backend_filter *f = container_of (b, struct backend_filter, backend); if (f->filter.default_export) return f->filter.default_export (backend_default_export, b->next, readonly, is_tls); return backend_default_export (b->next, readonly); } static int next_open (struct context *c, int readonly, const char *exportname) { struct backend *b = nbdkit_context_get_backend (c); struct context *c_next = nbdkit_next_context_open (b, readonly, exportname, false); struct context *old; if (c_next == NULL) return -1; old = nbdkit_context_set_next (c, c_next); assert (old == NULL); return 0; } static void * filter_open (struct context *c, int readonly, const char *exportname, int is_tls) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); void *handle; /* Most filters will call next_open first, resulting in * inner-to-outer ordering. */ if (f->filter.open) handle = f->filter.open (next_open, c, readonly, exportname, is_tls); else if (next_open (c, readonly, exportname) == -1) handle = NULL; else handle = NBDKIT_HANDLE_NOT_NEEDED; return handle; } static void filter_close (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); assert (c->handle); if (f->filter.close) f->filter.close (c->handle); } static int filter_prepare (struct context *c, int readonly) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.prepare && f->filter.prepare (c_next, c->handle, readonly) == -1) return -1; return 0; } static int filter_finalize (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.finalize && f->filter.finalize (c_next, c->handle) == -1) return -1; return 0; } static const char * filter_export_description (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.export_description) return f->filter.export_description (c_next, c->handle); else return backend_export_description (c_next); } static int64_t filter_get_size (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.get_size) return f->filter.get_size (c_next, c->handle); else return backend_get_size (c_next); } static int filter_block_size (struct context *c, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.block_size) return f->filter.block_size (c_next, c->handle, minimum, preferred, maximum); else return backend_block_size (c_next, minimum, preferred, maximum); } static int filter_can_write (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_write) return f->filter.can_write (c_next, c->handle); else return backend_can_write (c_next); } static int filter_can_flush (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_flush) return f->filter.can_flush (c_next, c->handle); else return backend_can_flush (c_next); } static int filter_is_rotational (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.is_rotational) return f->filter.is_rotational (c_next, c->handle); else return backend_is_rotational (c_next); } static int filter_can_trim (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_trim) return f->filter.can_trim (c_next, c->handle); else return backend_can_trim (c_next); } static int filter_can_zero (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_zero) return f->filter.can_zero (c_next, c->handle); else return backend_can_zero (c_next); } static int filter_can_fast_zero (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_fast_zero) return f->filter.can_fast_zero (c_next, c->handle); else return backend_can_fast_zero (c_next); } static int filter_can_extents (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_extents) return f->filter.can_extents (c_next, c->handle); else return backend_can_extents (c_next); } static int filter_can_fua (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_fua) return f->filter.can_fua (c_next, c->handle); else return backend_can_fua (c_next); } static int filter_can_multi_conn (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_multi_conn) return f->filter.can_multi_conn (c_next, c->handle); else return backend_can_multi_conn (c_next); } static int filter_can_cache (struct context *c) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.can_cache) return f->filter.can_cache (c_next, c->handle); else return backend_can_cache (c_next); } static int filter_pread (struct context *c, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.pread) return f->filter.pread (c_next, c->handle, buf, count, offset, flags, err); else return backend_pread (c_next, buf, count, offset, flags, err); } static int filter_pwrite (struct context *c, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.pwrite) return f->filter.pwrite (c_next, c->handle, buf, count, offset, flags, err); else return backend_pwrite (c_next, buf, count, offset, flags, err); } static int filter_flush (struct context *c, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.flush) return f->filter.flush (c_next, c->handle, flags, err); else return backend_flush (c_next, flags, err); } static int filter_trim (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.trim) return f->filter.trim (c_next, c->handle, count, offset, flags, err); else return backend_trim (c_next, count, offset, flags, err); } static int filter_zero (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.zero) return f->filter.zero (c_next, c->handle, count, offset, flags, err); else return backend_zero (c_next, count, offset, flags, err); } static int filter_extents (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.extents) return f->filter.extents (c_next, c->handle, count, offset, flags, extents, err); else return backend_extents (c_next, count, offset, flags, extents, err); } static int filter_cache (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_filter *f = container_of (b, struct backend_filter, backend); struct context *c_next = c->c_next; if (f->filter.cache) return f->filter.cache (c_next, c->handle, count, offset, flags, err); else return backend_cache (c_next, count, offset, flags, err); } static struct backend filter_functions = { .free = filter_free, .thread_model = filter_thread_model, .plugin_name = plugin_name, .usage = filter_usage, .version = filter_version, .dump_fields = filter_dump_fields, .config = filter_config, .config_complete = filter_config_complete, .magic_config_key = plugin_magic_config_key, .get_ready = filter_get_ready, .after_fork = filter_after_fork, .cleanup = filter_cleanup, .preconnect = filter_preconnect, .list_exports = filter_list_exports, .default_export = filter_default_export, .open = filter_open, .prepare = filter_prepare, .finalize = filter_finalize, .close = filter_close, .export_description = filter_export_description, .get_size = filter_get_size, .block_size = filter_block_size, .can_write = filter_can_write, .can_flush = filter_can_flush, .is_rotational = filter_is_rotational, .can_trim = filter_can_trim, .can_zero = filter_can_zero, .can_fast_zero = filter_can_fast_zero, .can_extents = filter_can_extents, .can_fua = filter_can_fua, .can_multi_conn = filter_can_multi_conn, .can_cache = filter_can_cache, .pread = filter_pread, .pwrite = filter_pwrite, .flush = filter_flush, .trim = filter_trim, .zero = filter_zero, .extents = filter_extents, .cache = filter_cache, }; /* Register and load a filter. */ struct backend * filter_register (struct backend *next, size_t index, const char *filename, void *dl, filter_init_function filter_init) { struct backend_filter *f; const struct nbdkit_filter *filter; f = calloc (1, sizeof *f); if (f == NULL) { perror ("strdup"); exit (EXIT_FAILURE); } f->backend = filter_functions; backend_init (&f->backend, next, index, filename, dl, "filter"); /* Call the initialization function which returns the address of the * filter's own 'struct nbdkit_filter'. */ filter = filter_init (); if (!filter) { fprintf (stderr, "%s: %s: filter registration function failed\n", program_name, filename); exit (EXIT_FAILURE); } /* We do not provide API or ABI guarantees for filters, other than * the ABI position and API contents of _api_version and _version to * diagnose mismatch from the current nbdkit version. */ if (filter->_api_version != NBDKIT_FILTER_API_VERSION) { fprintf (stderr, "%s: %s: filter is incompatible with this version of nbdkit " "(_api_version = %d, need %d)\n", program_name, filename, filter->_api_version, NBDKIT_FILTER_API_VERSION); exit (EXIT_FAILURE); } if (filter->_version == NULL || strcmp (filter->_version, PACKAGE_VERSION) != 0) { fprintf (stderr, "%s: %s: filter is incompatible with this version of nbdkit " "(_version = %s, need %s)\n", program_name, filename, filter->_version ?: "", PACKAGE_VERSION); exit (EXIT_FAILURE); } f->filter = *filter; backend_load (&f->backend, f->filter.name, f->filter.load); return (struct backend *) f; } NBDKIT_DLL_PUBLIC struct backend * nbdkit_context_get_backend (struct context *c) { assert (c); return c->b->next; } NBDKIT_DLL_PUBLIC struct context * nbdkit_next_context_open (struct backend *b, int readonly, const char *exportname, int shared) { struct context *c = threadlocal_get_context (); assert (b); assert (!c || b == c->b->next); return backend_open (b, readonly, exportname, shared || !c || !c->conn); } NBDKIT_DLL_PUBLIC void nbdkit_next_context_close (struct context *c) { if (c) backend_close (c); } NBDKIT_DLL_PUBLIC struct context * nbdkit_context_set_next (struct context *c, struct context *next) { struct context *old; assert (c); if (next) assert (next->b == c->b->next); old = c->c_next; c->c_next = next; return old; } nbdkit-1.42.2/server/internal.h0000644000175000017500000005377414771245250012056 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_INTERNAL_H #define NBDKIT_INTERNAL_H #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif /* Do we have the --timeout option? * * OpenBSD defines timer_create as a function that returns -ENOSYS, * which breaks configure. So we have to check for SIGEV_THREAD being * defined as well. * https://github.com/openbsd/src/blob/master/lib/libc/sys/timer_create.c */ #include #include #if defined(HAVE_TIMER_CREATE) && defined(SIGEV_THREAD) #define HAVE_TIMEOUT_OPTION 1 #endif /* Server supports API versions between 1 and MAX_API_VERSION */ #define MAX_API_VERSION 2 #define NBDKIT_API_VERSION MAX_API_VERSION #define NBDKIT_INTERNAL #include "nbdkit-plugin.h" #include "nbdkit-filter.h" #include "cleanup.h" #include "nbd-protocol.h" #include "string-vector.h" #include "unix-path-max.h" #include "vector.h" #include "windows-compat.h" /* Define unlikely macro, but only for GCC. These are used to move * debug and error handling code out of hot paths. */ #if defined (__GNUC__) #define unlikely(x) __builtin_expect (!!(x), 0) #define if_verbose if (unlikely (verbose)) #else #define unlikely(x) (x) #define if_verbose if (verbose) #endif #if defined (__SANITIZE_ADDRESS__) # define DO_DLCLOSE 0 #elif ENABLE_LIBFUZZER /* XXX This causes dlopen in the server to leak during fuzzing. * However it is necessary because of * https://bugs.llvm.org/show_bug.cgi?id=43917 */ # define DO_DLCLOSE 0 #else # if HAVE_VALGRIND # include /* http://valgrind.org/docs/manual/faq.html#faq.unhelpful */ # define DO_DLCLOSE !RUNNING_ON_VALGRIND # else # define DO_DLCLOSE 1 # endif #endif /* Declare program_name. */ #if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1 #include #define program_name program_invocation_short_name #else #define program_name "nbdkit" #endif #define container_of(ptr, type, member) ({ \ const typeof (((type *) 0)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - offsetof (type, member)); \ }) /* Maximum read or write request that we will handle. */ #define MAX_REQUEST_SIZE (64 * 1024 * 1024) /* main.c */ enum log_to { LOG_TO_DEFAULT, /* --log not specified: log to stderr, unless we forked into the background in which case log to syslog */ LOG_TO_STDERR, /* --log=stderr forced on the command line */ LOG_TO_SYSLOG, /* --log=syslog forced on the command line */ LOG_TO_NULL, /* --log=null forced on the command line */ }; enum service_mode { /* These two modes cannot form an NBD URI: */ SERVICE_MODE_SOCKET_ACTIVATION, /* socket activation. */ SERVICE_MODE_LISTEN_STDIN, /* -s */ SERVICE_MODE_UNIXSOCKET, /* -U */ SERVICE_MODE_VSOCK, /* --vsock */ SERVICE_MODE_TCPIP, /* --port */ }; extern const char *service_mode_string (enum service_mode); extern int tcpip_sock_af; extern struct debug_flag *debug_flags; extern const char *export_name; extern bool foreground; extern const char *ipaddr; extern bool keepalive; extern enum log_to log_to; extern unsigned mask_handshake; extern bool newstyle; extern bool no_mc; extern bool no_sr; extern const char *port; extern bool print_uri; extern bool read_only; extern const char *run; extern bool listen_stdin; extern const char *selinux_label; extern unsigned threads; extern unsigned timeout_secs, timeout_nsecs; extern int tls; extern const char *tls_certificates_dir; extern const char *tls_psk; extern bool tls_verify_peer; extern char *unixsocket; extern const char *user, *group; extern bool verbose; extern bool vsock; extern enum service_mode service_mode; extern char *uri; extern bool configured; extern int saved_stdin; extern int saved_stdout; extern struct backend *top; #define for_each_backend(b) for (b = top; b != NULL; b = b->next) /* debug.c */ #define debug(fs, ...) \ do { \ if_verbose \ debug_in_server ((fs), ##__VA_ARGS__); \ } while (0) extern void debug_in_server (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); /* quit.c */ extern volatile int quit; #ifndef WIN32 extern int quit_fd; #else extern HANDLE quit_fd; #endif extern void set_up_quit_pipe (void); extern void close_quit_pipe (void); extern void handle_quit (int sig); /* signals.c */ extern void set_up_signals (void); /* background.c */ extern bool forked_into_background; extern void fork_into_background (void); /* captive.c */ extern void run_command (void); /* socket-activation.c */ #define FIRST_SOCKET_ACTIVATION_FD 3 /* defined by systemd ABI */ extern unsigned int get_socket_activation (void); /* timeout.c */ struct connection; extern int start_timeout (struct connection *conn) __attribute__ ((__nonnull__ (1))); extern void cancel_timeout (struct connection *conn) __attribute__ ((__nonnull__ (1))); /* usergroup.c */ extern void change_user (void); /* uri.c */ extern char *make_uri (void); /* connections.c */ /* Flags for connection_send_function */ enum { SEND_MORE = 1, /* Hint to use MSG_MORE/corking to group send()s */ }; typedef int (*connection_recv_function) (void *buf, size_t len) __attribute__ ((__nonnull__ (1))); typedef int (*connection_send_function) (const void *buf, size_t len, int flags) __attribute__ ((__nonnull__ (1))); typedef void (*connection_close_function) (int how); /* struct context stores data per connection and backend. Primarily * this is the filter or plugin handle, but other state is also stored * here. */ enum { HANDLE_OPEN = 1, /* Set if .open passed, so .close is needed */ HANDLE_CONNECTED = 2, /* Set if .prepare passed, so .finalize is needed */ HANDLE_FAILED = 4, /* Set if .finalize failed */ }; struct context { struct nbdkit_next_ops next; /* Must be first member, for ABI reasons */ uint64_t magic; /* Magic number used to validate struct. */ #define CONTEXT_MAGIC 0xc011 void *handle; /* Plugin or filter handle. */ struct backend *b; /* Backend that provided handle. */ struct context *c_next; /* Underlying context, only when b->next != NULL. */ struct connection *conn; /* Active connection at context creation, if any. */ unsigned char state; /* Bitmask of HANDLE_* values */ uint64_t exportsize; uint32_t minimum_block_size; uint32_t preferred_block_size; uint32_t maximum_block_size; int can_write; int can_flush; int is_rotational; int can_trim; int can_zero; int can_fast_zero; int can_fua; int can_multi_conn; int can_extents; int can_cache; }; typedef enum { STATUS_DEAD, /* Connection is closed */ STATUS_CLIENT_DONE, /* Client has sent NBD_CMD_DISC */ STATUS_SHUTDOWN, /* Server wants soft shutdown */ STATUS_ACTIVE, /* Client can make requests */ } conn_status; struct connection { uint64_t magic; /* Magic number used to validate struct. */ #define CONN_MAGIC 0xc05 /* Listed in precedence order: do not grab earlier locks in this list * while holding a later lock. */ pthread_mutex_t request_lock; /* Forces serialization of requests */ pthread_mutex_t read_lock; /* Read entire client payload off wire */ pthread_mutex_t write_lock; /* Protect sockout, write response to wire */ pthread_mutex_t status_lock; /* Track current status of client */ conn_status status; int status_pipe[2]; /* track status changes via poll when nworkers > 1 */ void *crypto_session; int nworkers; struct context *top_context; /* The context tied to 'top'. */ char **default_exportname; /* One per plugin and filter. */ uint32_t cflags; uint16_t eflags; bool handshake_complete; #ifdef HAVE_TIMEOUT_OPTION timer_t timer; bool timer_set; #endif bool using_tls; bool structured_replies; bool meta_context_base_allocation; string_vector interns; char *exportname_from_set_meta_context; const char *exportname; int sockin, sockout; /* If nworkers > 1, only call this while read_lock is held */ connection_recv_function recv; /* If nworkers > 1, only call these while write_lock is held */ connection_send_function send; connection_close_function close; }; extern void handle_single_connection (int sockin, int sockout); extern conn_status connection_get_status (void); extern bool connection_set_status (conn_status value); /* protocol-handshake.c */ extern int protocol_handshake (void); extern int protocol_common_open (uint64_t *exportsize, uint16_t *flags, const char *exportname) __attribute__ ((__nonnull__ (1, 2, 3))); /* protocol-handshake-oldstyle.c */ extern int protocol_handshake_oldstyle (void); /* protocol-handshake-newstyle.c */ extern int protocol_handshake_newstyle (void); /* protocol.c */ extern bool protocol_recv_request_send_reply (void); /* The context ID of base:allocation. As far as I can tell it doesn't * matter what this is as long as nbdkit always returns the same * number. */ #define base_allocation_id 1 /* public.c */ extern void free_interns (void); /* crypto.c */ #define root_tls_certificates_dir sysconfdir "/pki/" PACKAGE_NAME extern void crypto_init (bool tls_set_on_cli); extern void crypto_free (void); extern int crypto_negotiate_tls (int sockin, int sockout); /* debug-flags.c */ extern void add_debug_flag (const char *arg); extern void apply_debug_flags (void *dl, const char *name); extern void free_debug_flags (void); /* log.c */ extern void log_verror (const char *fs, va_list args); /* log-*.c */ extern void log_stderr_verror (int orig_errno, const char *fs, va_list args) ATTRIBUTE_FORMAT_PRINTF (2, 0); extern void log_syslog_verror (int orig_errno, const char *fs, va_list args) ATTRIBUTE_FORMAT_PRINTF (2, 0); /* vfprintf.c */ #if !HAVE_VFPRINTF_PERCENT_M #include #define vfprintf replace_vfprintf extern int replace_vfprintf (FILE *f, const char *fmt, va_list args) __attribute__ ((__format__ (printf, 2, 0))); #endif /* backend.c */ struct backend { uint64_t magic; /* Magic number used to validate struct. */ #define BACKEND_MAGIC 0xbac /* Next filter or plugin in the chain. This is always NULL for * plugins and never NULL for filters. */ struct backend *next; /* A unique index used to fetch the handle from the connections * object. The plugin (last in the chain) has index 0, and the * filters have index 1, 2, ... depending how "far" they are from * the plugin. */ size_t i; /* The type of backend: filter or plugin. */ const char *type; /* A copy of the backend name that survives a dlclose. */ char *name; /* The file the backend was loaded from. */ char *filename; /* The dlopen handle for the backend. */ void *dl; /* Backend callbacks. All are required. */ void (*free) (struct backend *); int (*thread_model) (struct backend *); const char *(*plugin_name) (struct backend *); void (*usage) (struct backend *); const char *(*version) (struct backend *); void (*dump_fields) (struct backend *); void (*config) (struct backend *, const char *key, const char *value); void (*config_complete) (struct backend *); const char *(*magic_config_key) (struct backend *); void (*get_ready) (struct backend *); void (*after_fork) (struct backend *); void (*cleanup) (struct backend *); int (*preconnect) (struct backend *, int readonly); int (*list_exports) (struct backend *, int readonly, int is_tls, struct nbdkit_exports *exports); const char *(*default_export) (struct backend *, int readonly, int is_tls); void *(*open) (struct context *, int readonly, const char *exportname, int is_tls); int (*prepare) (struct context *, int readonly); int (*finalize) (struct context *); void (*close) (struct context *); const char *(*export_description) (struct context *); int64_t (*get_size) (struct context *); int (*block_size) (struct context *, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); int (*can_write) (struct context *); int (*can_flush) (struct context *); int (*is_rotational) (struct context *); int (*can_trim) (struct context *); int (*can_zero) (struct context *); int (*can_fast_zero) (struct context *); int (*can_extents) (struct context *); int (*can_fua) (struct context *); int (*can_multi_conn) (struct context *); int (*can_cache) (struct context *); int (*pread) (struct context *, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*pwrite) (struct context *, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*flush) (struct context *, uint32_t flags, int *err); int (*trim) (struct context *, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*zero) (struct context *, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*extents) (struct context *, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err); int (*cache) (struct context *, uint32_t count, uint64_t offset, uint32_t flags, int *err); }; extern void backend_init (struct backend *b, struct backend *next, size_t index, const char *filename, void *dl, const char *type) __attribute__ ((__nonnull__ (1, 4, 5, 6))); extern void backend_load (struct backend *b, const char *name, void (*load) (void)) __attribute__ ((__nonnull__ (1 /* not 2 */))); extern void backend_unload (struct backend *b, void (*unload) (void)) __attribute__ ((__nonnull__ (1))); extern int backend_list_exports (struct backend *b, int readonly, struct nbdkit_exports *exports) __attribute__ ((__nonnull__ (1, 3))); extern const char *backend_default_export (struct backend *b, int readonly) __attribute__ ((__nonnull__ (1))); /* exportname is only valid for this call and almost certainly will be * freed on return of this function, so backends must save the * exportname if they need to refer to it later. */ extern struct context *backend_open (struct backend *b, int readonly, const char *exportname, int shared) __attribute__ ((__nonnull__ (1, 3))); extern int backend_prepare (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_finalize (struct context *c) __attribute__ ((__nonnull__ (1))); extern void backend_close (struct context *c) __attribute__ ((__nonnull__ (1))); extern bool backend_valid_range (struct context *c, uint64_t offset, uint32_t count) __attribute__ ((__nonnull__ (1))); extern const char *backend_export_description (struct context *c) __attribute__ ((__nonnull__ (1))); extern int64_t backend_get_size (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_block_size (struct context *c, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) __attribute__ ((__nonnull__ (1, 2, 3, 4))); extern int backend_can_write (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_flush (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_is_rotational (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_trim (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_zero (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_fast_zero (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_extents (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_fua (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_multi_conn (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_can_cache (struct context *c) __attribute__ ((__nonnull__ (1))); extern int backend_pread (struct context *c, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 2, 6))); extern int backend_pwrite (struct context *c, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 2, 6))); extern int backend_flush (struct context *c, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 3))); extern int backend_trim (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 5))); extern int backend_zero (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 5))); extern int backend_extents (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err) __attribute__ ((__nonnull__ (1, 5, 6))); extern int backend_cache (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) __attribute__ ((__nonnull__ (1, 5))); /* plugins.c */ typedef struct nbdkit_plugin *(*plugin_init_function) (void); extern struct backend *plugin_register (size_t index, const char *filename, void *dl, plugin_init_function plugin_init) __attribute__ ((__nonnull__ (2, 3, 4))); /* filters.c */ typedef struct nbdkit_filter *(*filter_init_function) (void); extern struct backend *filter_register (struct backend *next, size_t index, const char *filename, void *dl, filter_init_function filter_init) __attribute__ ((__nonnull__ (1, 3, 4, 5))); /* locks.c */ extern unsigned thread_model; extern void lock_init_thread_model (void); extern const char *name_of_thread_model (int model); extern void lock_connection (void); extern void unlock_connection (void); extern void lock_request (void); extern void unlock_request (void); extern void lock_unload (void); extern void unlock_unload (void); /* sockets.c */ DEFINE_VECTOR_TYPE (sockets, int); extern void bind_unix_socket (sockets *) __attribute__ ((__nonnull__ (1))); extern void bind_tcpip_socket (sockets *) __attribute__ ((__nonnull__ (1))); extern void bind_vsock (sockets *) __attribute__ ((__nonnull__ (1))); extern void accept_incoming_connections (const sockets *socks) __attribute__ ((__nonnull__ (1))); /* threadlocal.c */ extern void threadlocal_init (void); extern void threadlocal_new_server_thread (void); extern void threadlocal_set_name (const char *name) __attribute__ ((__nonnull__ (1))); extern const char *threadlocal_get_name (void); extern void threadlocal_set_instance_num (size_t instance_num); extern size_t threadlocal_get_instance_num (void); extern void threadlocal_set_errno (int err); extern int threadlocal_get_errno (void); extern void threadlocal_set_last_error (char *msg); extern void threadlocal_clear_last_error (void); extern const char *threadlocal_get_last_error (void); extern void *threadlocal_buffer (size_t size); extern void threadlocal_set_conn (struct connection *conn); extern struct connection *threadlocal_get_conn (void); extern struct context *threadlocal_get_context (void); extern struct context *threadlocal_push_context (struct context *ctx); extern void threadlocal_pop_context (struct context **ctx); #define CLEANUP_CONTEXT_POP __attribute__ ((cleanup (threadlocal_pop_context))) #define PUSH_CONTEXT_FOR_SCOPE(ctx) \ CLEANUP_CONTEXT_POP CLANG_UNUSED_VARIABLE_WORKAROUND \ struct context *NBDKIT_UNIQUE_NAME (_ctx) = threadlocal_push_context (ctx) /* Macro which sets local variable struct connection *conn from * thread-local storage, asserting that it is non-NULL. If you want * to check if conn could be NULL (eg. outside a connection context) * then call threadlocal_get_conn instead. */ #define GET_CONN \ struct connection *conn = threadlocal_get_conn (); \ assert (conn != NULL) /* exports.c */ extern int exports_resolve_default (struct nbdkit_exports *exports, struct backend *b, int readonly); #endif /* NBDKIT_INTERNAL_H */ nbdkit-1.42.2/server/locks.c0000644000175000017500000001002414676465664011346 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include "internal.h" /* Note that the plugin's thread model cannot change after being * loaded, so caching it here is safe. */ unsigned thread_model = -1; static pthread_mutex_t connection_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t all_requests_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_rwlock_t unload_prevention_lock = PTHREAD_RWLOCK_INITIALIZER; /* Map thread model to string; use only from single-threaded context */ const char * name_of_thread_model (int model) { static char buf[] = "-2147483648 # unknown thread model!"; switch (model) { case NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS: return "serialize_connections"; case NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS: return "serialize_all_requests"; case NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS: return "serialize_requests"; case NBDKIT_THREAD_MODEL_PARALLEL: return "parallel"; } snprintf (buf, sizeof buf, "%d # unknown thread model!", model); return buf; } void lock_init_thread_model (void) { thread_model = top->thread_model (top); debug ("using thread model: %s", name_of_thread_model (thread_model)); assert (thread_model <= NBDKIT_THREAD_MODEL_PARALLEL); } void lock_connection (void) { if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS && pthread_mutex_lock (&connection_lock)) abort (); } void unlock_connection (void) { if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS && pthread_mutex_unlock (&connection_lock)) abort (); } void lock_request (void) { struct connection *conn = threadlocal_get_conn (); if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS && pthread_mutex_lock (&all_requests_lock)) abort (); if (conn && thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS && pthread_mutex_lock (&conn->request_lock)) abort (); if (pthread_rwlock_rdlock (&unload_prevention_lock)) abort (); } void unlock_request (void) { struct connection *conn = threadlocal_get_conn (); if (pthread_rwlock_unlock (&unload_prevention_lock)) abort (); if (conn && thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS && pthread_mutex_unlock (&conn->request_lock)) abort (); if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS && pthread_mutex_unlock (&all_requests_lock)) abort (); } void lock_unload (void) { if (pthread_rwlock_wrlock (&unload_prevention_lock)) abort (); } void unlock_unload (void) { if (pthread_rwlock_unlock (&unload_prevention_lock)) abort (); } nbdkit-1.42.2/server/log.c0000644000175000017500000000634414771245250011005 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "internal.h" /* Copy the error message to threadlocal. This is sent to callers * which are using structured replies, but is for extra information * only so don't fail if we are unable to copy it. */ static void copy_error_to_threadlocal (int orig_errno, const char *fs, va_list args) { va_list args_copy; char *msg; int r; va_copy (args_copy, args); errno = orig_errno; /* must restore in case fs contains %m */ r = vasprintf (&msg, fs, args_copy); va_end (args_copy); if (r != -1 && msg) threadlocal_set_last_error (msg); /* ownership passed to threadlocal */ } /* Call the right log_*_verror function depending on log_to sink. * Note: preserves the previous value of errno. */ void log_verror (const char *fs, va_list args) { int orig_errno = errno; copy_error_to_threadlocal (orig_errno, fs, args); switch (log_to) { case LOG_TO_DEFAULT: if (forked_into_background) log_syslog_verror (orig_errno, fs, args); else log_stderr_verror (orig_errno, fs, args); break; case LOG_TO_SYSLOG: log_syslog_verror (orig_errno, fs, args); break; case LOG_TO_STDERR: log_stderr_verror (orig_errno, fs, args); break; case LOG_TO_NULL: /* nothing */ break; } errno = orig_errno; /* Restore errno before leaving the function. */ } /* Note: preserves the previous value of errno. */ NBDKIT_DLL_PUBLIC void nbdkit_verror (const char *fs, va_list args) { log_verror (fs, args); } /* Note: preserves the previous value of errno. */ NBDKIT_DLL_PUBLIC void nbdkit_error (const char *fs, ...) { va_list args; va_start (args, fs); nbdkit_verror (fs, args); va_end (args); } nbdkit-1.42.2/server/log-stderr.c0000644000175000017500000000466014771245250012305 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "ansi-colours.h" #include "internal.h" void log_stderr_verror (int orig_errno, const char *fs, va_list args) { const char *name = threadlocal_get_name (); size_t instance_num = threadlocal_get_instance_num (); int tty; #ifdef HAVE_FLOCKFILE flockfile (stderr); #endif tty = isatty (fileno (stderr)); if (tty) ansi_force_colour (ANSI_FG_BRIGHT_RED, stderr); fprintf (stderr, "%s: ", program_name); if (name) { fprintf (stderr, "%s", name); if (instance_num > 0) fprintf (stderr, "[%zu]", instance_num); fprintf (stderr, ": "); } fprintf (stderr, "error: "); errno = orig_errno; /* must restore in case fs contains %m */ vfprintf (stderr, fs, args); fprintf (stderr, "\n"); if (tty) ansi_force_restore (stderr); #ifdef HAVE_FUNLOCKFILE funlockfile (stderr); #endif } nbdkit-1.42.2/server/log-syslog.c0000644000175000017500000000501514676465664012336 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "internal.h" #include "open_memstream.h" #include "syslog.h" /* Tempted to use LOG_FTP instead of LOG_DAEMON! */ static const int PRIORITY = LOG_DAEMON|LOG_ERR; void log_syslog_verror (int orig_errno, const char *fs, va_list args) { const char *name = threadlocal_get_name (); size_t instance_num = threadlocal_get_instance_num (); CLEANUP_FREE char *msg = NULL; size_t len = 0; FILE *fp = NULL; fp = open_memstream (&msg, &len); if (fp == NULL) { /* Fallback to logging using fs, args directly. */ errno = orig_errno; /* must restore in case fs contains %m */ vsyslog (PRIORITY, fs, args); return; } if (name) { fprintf (fp, "%s", name); if (instance_num > 0) fprintf (fp, "[%zu]", instance_num); fprintf (fp, ": "); } errno = orig_errno; /* must restore in case fs contains %m */ vfprintf (fp, fs, args); close_memstream (fp); syslog (PRIORITY, "%s", msg); } nbdkit-1.42.2/server/main.c0000644000175000017500000011003414771245250011140 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_MMAN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_LINUX_VM_SOCKETS_H #include #elif HAVE_SYS_VSOCK_H #include #endif #include #include #include "ascii-ctype.h" #include "ascii-string.h" #include "exit-with-parent.h" #include "nbd-protocol.h" #include "open_memstream.h" #include "realpath.h" #include "strndup.h" #include "syslog.h" #include "utils.h" #include "internal.h" #include "options.h" #ifdef ENABLE_LIBFUZZER #define main fuzzer_main #endif static char *make_random_fifo (void); static struct backend *open_plugin_so (size_t i, const char *filename, int short_name); static struct backend *open_filter_so (struct backend *next, size_t i, const char *filename, int short_name); static void start_serving (void); static void write_pidfile (void); static bool is_config_key (const char *key, size_t len); static void error_if_stdio_closed (void); static void switch_stdio (void); static void winsock_init (void); int tcpip_sock_af = AF_UNSPEC; /* -4, -6 */ struct debug_flag *debug_flags; /* -D */ bool exit_with_parent; /* --exit-with-parent */ const char *export_name; /* -e */ bool foreground; /* -f */ const char *ipaddr; /* -i */ bool keepalive; /* --keepalive */ enum log_to log_to = LOG_TO_DEFAULT; /* --log */ unsigned mask_handshake = ~0U; /* --mask-handshake */ bool newstyle = true; /* false = -o, true = -n */ bool no_mc; /* --no-meta-contexts */ bool no_sr; /* --no-sr */ char *pidfile; /* -P */ const char *port; /* -p */ bool print_uri; /* --print-uri */ bool read_only; /* -r */ const char *run; /* --run */ bool listen_stdin; /* -s */ const char *selinux_label; /* --selinux-label */ bool swap; /* --swap */ unsigned threads; /* -t */ unsigned timeout_secs, timeout_nsecs; /* --timeout */ int tls; /* --tls : 0=off 1=on 2=require */ const char *tls_certificates_dir; /* --tls-certificates */ const char *tls_psk; /* --tls-psk */ bool tls_verify_peer; /* --tls-verify-peer */ char *unixsocket; /* -U */ const char *user, *group; /* -u & -g */ bool verbose; /* -v */ bool vsock; /* --vsock */ enum service_mode service_mode; /* serving over TCP, Unix, etc */ bool configured; /* .config_complete done */ int saved_stdin = -1; /* dup'd stdin during -s/--run */ int saved_stdout = -1; /* dup'd stdout during -s/--run */ /* Linked list of backends. Each backend struct is followed by either * a filter or plugin struct. "top" points to the first one. They * are linked through the backend->next field. * * ┌──────────┠┌──────────┠┌──────────┠* top ───▶│ backend │───▶│ backend │───▶│ backend │ * │ b->i = 2 │ │ b->i = 1 │ │ b->i = 0 │ * │ filter │ │ filter │ │ plugin │ * └──────────┘ └──────────┘ └──────────┘ */ struct backend *top; static unsigned int socket_activation; /* $LISTEN_FDS and $LISTEN_PID set */ static char *random_fifo_dir = NULL; /* Directory containing -U - */ static char *random_fifo = NULL; /* Path to -U - socket */ static void usage (void) { extern const char *synopsis; /* --{short,long}-options remain undocumented */ printf ("%s\n", synopsis); /* This blurb matches the DESCRIPTION section of the man page: */ printf ( "Network Block Device (NBD) is a network protocol for accessing block\n" "devices over the network. Block devices are hard disks and things that\n" "behave like hard disks such as disk images and virtual machines.\n" "\n" "nbdkit is both a toolkit for creating NBD servers from “unconventionalâ€\n" "sources, and the name of an NBD server. nbdkit ships with many plugins\n" "for performing common tasks like serving local files.\n" "\n" ); printf ("Please read the nbdkit(1) manual page for full usage.\n"); } static void display_version (void) { if (strcmp (NBDKIT_VERSION_EXTRA, "") == 0) printf ("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); else printf ("%s %s (%s)\n", PACKAGE_NAME, PACKAGE_VERSION, NBDKIT_VERSION_EXTRA); } static void dump_config (void) { CLEANUP_FREE char *binary = NULL; #ifdef __linux__ binary = realpath ("/proc/self/exe", NULL); #else #ifdef WIN32 /* GetModuleFileNameA has a crappy interface that prevents us from * getting the length of the path so we just have to guess at an * upper limit here. It will at least truncate it properly with \0. * _get_pgmptr would be a better alternative except that it isn't * implemented in MinGW. XXX */ binary = malloc (256); if (!GetModuleFileNameA (NULL, binary, 256)) { free (binary); binary = NULL; } #endif #endif if (binary != NULL) printf ("%s=%s\n", "binary", binary); printf ("%s=%s\n", "bindir", bindir); if (can_exit_with_parent ()) printf ("exit_with_parent=yes\n"); else printf ("exit_with_parent=no\n"); printf ("%s=%s\n", "filterdir", filterdir); printf ("%s=%s\n", "host_cpu", host_cpu); printf ("%s=%s\n", "host_os", host_os); printf ("%s=%s\n", "libdir", libdir); printf ("%s=%s\n", "mandir", mandir); printf ("%s=%d\n", "max_api_version", MAX_API_VERSION); printf ("%s=%s\n", "name", PACKAGE_NAME); printf ("%s=%s\n", "plugindir", plugindir); printf ("%s=%s\n", "root_tls_certificates_dir", root_tls_certificates_dir); printf ("%s=%s\n", "run_default_socket", "Unix"); printf ("%s=%s\n", "sbindir", sbindir); #ifdef HAVE_LIBSELINUX printf ("selinux=yes\n"); #else printf ("selinux=no\n"); #endif printf ("%s=%s\n", "soext", SOEXT); printf ("%s=%s\n", "sysconfdir", sysconfdir); #ifdef HAVE_TIMEOUT_OPTION printf ("timeout_option=yes\n"); #else printf ("timeout_option=no\n"); #endif #ifdef HAVE_GNUTLS printf ("tls=yes\n"); #else printf ("tls=no\n"); #endif printf ("%s=%s\n", "version", PACKAGE_VERSION); if (strcmp (NBDKIT_VERSION_EXTRA, "") != 0) printf ("%s=%s\n", "version_extra", NBDKIT_VERSION_EXTRA); printf ("%s=%d\n", "version_major", NBDKIT_VERSION_MAJOR); printf ("%s=%d\n", "version_minor", NBDKIT_VERSION_MINOR); #if defined (AF_VSOCK) && defined (VMADDR_CID_ANY) printf ("vsock_option=yes\n"); #else printf ("vsock_option=no\n"); #endif #ifdef HAVE_LIBZSTD printf ("zstd=yes\n"); #else printf ("zstd=no\n"); #endif } /* -D nbdkit.environ=1 to dump the environment at start up. */ NBDKIT_DLL_PUBLIC int nbdkit_debug_environ; #ifndef HAVE_ENVIRON_DECL extern char **environ; #endif static void dump_environment (void) { size_t i; for (i = 0; environ[i]; ++i) nbdkit_debug ("%s", environ[i]); } int main (int argc, char *argv[]) { int c; bool help = false, version = false, dump_plugin = false; int tls_set_on_cli = false; bool short_name; const char *filename; char *p; static struct filter_filename { struct filter_filename *next; const char *filename; } *filter_filenames = NULL; size_t i; const char *magic_config_key; error_if_stdio_closed (); winsock_init (); #if !ENABLE_LIBFUZZER threadlocal_init (); #else static bool main_called = false; if (!main_called) { threadlocal_init (); main_called = true; } #endif /* The default setting for TLS depends on whether we were * compiled with GnuTLS. */ #ifdef HAVE_GNUTLS tls = 1; #else tls = 0; #endif /* Returns 0 if no socket activation, or the number of FDs. */ socket_activation = get_socket_activation (); for (;;) { c = getopt_long (argc, argv, short_options, long_options, NULL); if (c == -1) break; switch (c) { case DUMP_CONFIG_OPTION: dump_config (); exit (EXIT_SUCCESS); case DUMP_PLUGIN_OPTION: dump_plugin = true; break; case EXIT_WITH_PARENT_OPTION: if (can_exit_with_parent ()) { exit_with_parent = true; foreground = true; } else { fprintf (stderr, "%s: --exit-with-parent is not implemented " "for this operating system\n", program_name); exit (EXIT_FAILURE); } break; case FILTER_OPTION: { struct filter_filename *t; t = malloc (sizeof *t); if (t == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } t->next = filter_filenames; t->filename = optarg; filter_filenames = t; } break; case HELP_OPTION: help = true; break; case KEEPALIVE_OPTION: keepalive = true; break; case LOG_OPTION: if (strcmp (optarg, "stderr") == 0) log_to = LOG_TO_STDERR; else if (strcmp (optarg, "syslog") == 0) log_to = LOG_TO_SYSLOG; else if (strcmp (optarg, "null") == 0) log_to = LOG_TO_NULL; else { fprintf (stderr, "%s: " "--log must be \"stderr\", \"syslog\" or \"null\"\n", program_name); exit (EXIT_FAILURE); } break; case LONG_OPTIONS_OPTION: for (i = 0; long_options[i].name != NULL; ++i) { if (strcmp (long_options[i].name, "long-options") != 0 && strcmp (long_options[i].name, "short-options") != 0) printf ("--%s\n", long_options[i].name); } exit (EXIT_SUCCESS); case MASK_HANDSHAKE_OPTION: if (nbdkit_parse_unsigned ("mask-handshake", optarg, &mask_handshake) == -1) exit (EXIT_FAILURE); break; case NO_MC_OPTION: no_mc = true; break; case NO_SR_OPTION: no_sr = true; break; case PRINT_URI: print_uri = true; break; case RUN_OPTION: if (socket_activation) { fprintf (stderr, "%s: cannot use socket activation with --run flag\n", program_name); exit (EXIT_FAILURE); } run = optarg; foreground = true; break; case SELINUX_LABEL_OPTION: selinux_label = optarg; break; case SHORT_OPTIONS_OPTION: for (i = 0; short_options[i]; ++i) { if (short_options[i] != ':') printf ("-%c\n", short_options[i]); } exit (EXIT_SUCCESS); case SWAP_OPTION: swap = 1; break; case TIMEOUT_OPTION: #ifdef HAVE_TIMEOUT_OPTION if (nbdkit_parse_delay ("timeout", optarg, &timeout_secs, &timeout_nsecs) == -1) exit (EXIT_FAILURE); break; #else fprintf (stderr, "%s: --timeout is not supported on this platform\n", program_name); exit (EXIT_FAILURE); #endif case TLS_OPTION: tls_set_on_cli = true; if (ascii_strcasecmp (optarg, "require") == 0 || ascii_strcasecmp (optarg, "required") == 0 || ascii_strcasecmp (optarg, "force") == 0) tls = 2; else { tls = nbdkit_parse_bool (optarg); if (tls == -1) exit (EXIT_FAILURE); } break; case TLS_CERTIFICATES_OPTION: tls_certificates_dir = optarg; break; case TLS_PSK_OPTION: tls_psk = optarg; break; case TLS_VERIFY_PEER_OPTION: tls_verify_peer = true; break; case VSOCK_OPTION: #if defined (AF_VSOCK) && defined (VMADDR_CID_ANY) vsock = true; break; #else fprintf (stderr, "%s: AF_VSOCK is not supported on this platform\n", program_name); exit (EXIT_FAILURE); #endif case '4': tcpip_sock_af = AF_INET; break; case '6': tcpip_sock_af = AF_INET6; break; case 'D': add_debug_flag (optarg); break; case 'e': export_name = optarg; break; case 'f': foreground = true; break; case 'g': group = optarg; break; case 'i': if (socket_activation) { fprintf (stderr, "%s: cannot use socket activation with -i flag\n", program_name); exit (EXIT_FAILURE); } ipaddr = optarg; break; case 'n': newstyle = true; break; case 'o': newstyle = false; break; case 'P': pidfile = nbdkit_absolute_path (optarg); if (pidfile == NULL) exit (EXIT_FAILURE); break; case 'p': if (socket_activation) { fprintf (stderr, "%s: cannot use socket activation with -p flag\n", program_name); exit (EXIT_FAILURE); } port = optarg; break; case 'r': read_only = true; break; case 's': if (socket_activation) { fprintf (stderr, "%s: cannot use socket activation with -s flag\n", program_name); exit (EXIT_FAILURE); } listen_stdin = true; #ifdef WIN32 /* This could be implemented with a bit of work. The problem * currently is that we try to use recv() on the stdio file * descriptor which winsock does not support (nor Linux in * fact). We would need to implement a test to see if the file * descriptor is a socket or not and use either read or recv as * appropriate. */ NOT_IMPLEMENTED_ON_WINDOWS ("-s"); #endif break; case 't': if (nbdkit_parse_unsigned ("threads", optarg, &threads) == -1) exit (EXIT_FAILURE); /* XXX Worth a maximimum limit on threads? */ break; case 'U': if (socket_activation) { fprintf (stderr, "%s: cannot use socket activation with -U flag\n", program_name); exit (EXIT_FAILURE); } if (strcmp (optarg, "-") == 0) unixsocket = make_random_fifo (); else unixsocket = nbdkit_absolute_path (optarg); if (unixsocket == NULL) exit (EXIT_FAILURE); break; case 'u': user = optarg; break; case 'v': verbose = true; break; case 'V': version = true; break; default: usage (); exit (EXIT_FAILURE); } } /* No extra parameters. */ if (optind >= argc) { if (help) { usage (); exit (EXIT_SUCCESS); } if (version) { display_version (); exit (EXIT_SUCCESS); } if (dump_plugin) { /* Incorrect use of --dump-plugin. */ fprintf (stderr, "%s: use 'nbdkit plugin --dump-plugin' or\n" "'nbdkit /path/to/plugin." SOEXT " --dump-plugin' or\n" "if you want to find out about the server use --dump-config\n", program_name); exit (EXIT_FAILURE); } /* Otherwise this is an error. */ fprintf (stderr, "%s: no plugins given on the command line.\n" "Use '%s --help' or " "read the nbdkit(1) manual page for documentation.\n", program_name, program_name); exit (EXIT_FAILURE); } /* --tls=require and oldstyle won't work. */ if (tls == 2 && !newstyle) { fprintf (stderr, "%s: cannot use oldstyle protocol (-o) and require TLS\n", program_name); exit (EXIT_FAILURE); } /* Set the umask to a known value. This makes the behaviour of * plugins when creating files more predictable, and also removes an * implicit dependency on umask when calling mkstemp(3). */ umask (0022); /* If we will or might use syslog. */ if (log_to == LOG_TO_SYSLOG || log_to == LOG_TO_DEFAULT) openlog (program_name, LOG_PID, 0); /* Print the version in debug output, right after syslog initialization. */ if (strcmp (NBDKIT_VERSION_EXTRA, "") == 0) debug ("%s %s", PACKAGE_NAME, PACKAGE_VERSION); else debug ("%s %s (%s)", PACKAGE_NAME, PACKAGE_VERSION, NBDKIT_VERSION_EXTRA); /* Initialize TLS. */ crypto_init (tls_set_on_cli); assert (tls != -1); /* Implement --exit-with-parent early in case plugin initialization * takes a long time and the parent exits during that time. */ if (exit_with_parent) { if (set_exit_with_parent () == -1) { perror ("nbdkit: --exit-with-parent"); exit (EXIT_FAILURE); } } /* If the user has mixed up -p/--run/-s/-U/--vsock options, then * give an error. * * XXX Actually the server could easily be extended to handle both * TCP/IP and Unix sockets, or even multiple TCP/IP ports. */ if ((port && unixsocket) || (port && listen_stdin) || (unixsocket && listen_stdin) || (listen_stdin && run) || (listen_stdin && dump_plugin) || (vsock && unixsocket) || (vsock && listen_stdin)) { fprintf (stderr, "%s: --dump-plugin, -p, --run, -s, -U or --vsock options " "cannot be used in this combination\n", program_name); exit (EXIT_FAILURE); } /* Since nbdkit 1.36, --run implies -U -, unless --vsock or --port * was set explicitly. */ if (run && !unixsocket && !port && !vsock) { unixsocket = make_random_fifo (); if (!unixsocket) exit (EXIT_FAILURE); } /* By the point we have enough information to calculate the service mode. */ if (socket_activation) service_mode = SERVICE_MODE_SOCKET_ACTIVATION; else if (listen_stdin) service_mode = SERVICE_MODE_LISTEN_STDIN; else if (unixsocket) service_mode = SERVICE_MODE_UNIXSOCKET; else if (vsock) service_mode = SERVICE_MODE_VSOCK; else service_mode = SERVICE_MODE_TCPIP; debug ("service mode: %s", service_mode_string (service_mode)); /* By the point we have enough information to calculate the NBD URI. * Note this may be NULL. */ uri = make_uri (); /* The remaining command line arguments are the plugin name and * parameters. If --help, --version or --dump-plugin were specified * then we open the plugin so that we can display the per-plugin * help/version/plugin information. */ filename = argv[optind++]; short_name = is_short_name (filename); /* Is there an executable script located in the plugindir? * If so we simply execute it with the current command line. */ if (short_name) { struct stat statbuf; CLEANUP_FREE char *script; if (asprintf (&script, "%s/nbdkit-%s-plugin", plugindir, filename) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } if (stat (script, &statbuf) == 0 && (statbuf.st_mode & S_IXUSR) != 0) { /* We're going to execute the plugin directly. * Replace argv[0] with argv[optind-1] and move further arguments * down the list. */ argv[0] = argv[optind-1]; for (i = optind; i <= argc; i++) argv[i-1] = argv[i]; execv (script, argv); perror (script); exit (EXIT_FAILURE); } } /* Open the plugin (first) and then wrap the plugin with the * filters. The filters are wrapped in reverse order that they * appear on the command line so that in the end ‘top’ points to * the first filter on the command line. */ top = open_plugin_so (0, filename, short_name); i = 1; while (filter_filenames) { struct filter_filename *t = filter_filenames; filename = t->filename; short_name = is_short_name (filename); top = open_filter_so (top, i++, filename, short_name); filter_filenames = t->next; free (t); } /* Apply nbdkit.* flags for the server. */ apply_debug_flags (RTLD_DEFAULT, "nbdkit"); /* Check all debug flags were used, and free them. */ free_debug_flags (); /* Dump the environment if asked. This is the earliest we can do it * because it uses a debug flag. */ if (nbdkit_debug_environ && verbose) dump_environment (); if (help) { struct backend *b; usage (); for_each_backend (b) { printf ("\n"); b->usage (b); } top->free (top); exit (EXIT_SUCCESS); } if (version) { const char *v; struct backend *b; display_version (); for_each_backend (b) { printf ("%s", b->name); if ((v = b->version (b)) != NULL) printf (" %s", v); printf ("\n"); } top->free (top); exit (EXIT_SUCCESS); } /* Call config and config_complete to parse the parameters. * * If the plugin provides magic_config_key then any "bare" values * (ones not containing "=") are prefixed with this key. * * For backwards compatibility with old plugins, and to support * scripting languages, if magic_config_key == NULL then if the * first parameter is bare it is prefixed with the key "script", and * any other bare parameters are errors. * * Keys must live for the life of nbdkit. Since we want to avoid * modifying argv (so that /proc/PID/cmdline remains sane) but we * need to create a key from argv[i] = "key=value" we must intern * the keys, which are then freed at the end of main(). */ magic_config_key = top->magic_config_key (top); for (i = 0; optind < argc; ++i, ++optind) { size_t n; p = strchr (argv[optind], '='); n = p - argv[optind]; if (p && is_config_key (argv[optind], n)) { /* Is it key=value? */ const char *key = nbdkit_strndup_intern (argv[optind], n); if (key == NULL) exit (EXIT_FAILURE); top->config (top, key, p+1); } else if (magic_config_key == NULL) { if (i == 0) /* magic script parameter */ top->config (top, "script", argv[optind]); else { fprintf (stderr, "%s: expecting key=value on the command line but got: %s\n", program_name, argv[optind]); exit (EXIT_FAILURE); } } else { /* magic config key */ top->config (top, magic_config_key, argv[optind]); } } /* This must run after parsing the parameters so that the script can * be loaded for scripting languages. But it must be called before * config_complete so that the plugin doesn't check for missing * parameters. */ if (dump_plugin) { top->dump_fields (top); top->free (top); free_interns (); exit (EXIT_SUCCESS); } top->config_complete (top); /* Select the correct thread model based on config. */ lock_init_thread_model (); /* Tell the plugin that we are about to start serving. This must be * called before we change user, fork, or open any sockets. */ top->get_ready (top); /* Print the URI. Do it just before we close stdio, especially * before setting 'configured' to true which makes nbdkit_stdio_safe * false. */ if (print_uri && uri && nbdkit_stdio_safe ()) { printf ("%s\n", uri); printf ("Shell-quoted URI: "); shell_quote (uri, stdout); printf ("\n"); printf ("Command to query the NBD endpoint:\n"); printf (" nbdinfo "); shell_quote (uri, stdout); printf ("\n"); fflush (stdout); } switch_stdio (); configured = true; start_serving (); top->cleanup (top); top->free (top); top = NULL; free (unixsocket); free (pidfile); free (uri); if (random_fifo) { unlink (random_fifo); free (random_fifo); } if (random_fifo_dir) { rmdir (random_fifo_dir); free (random_fifo_dir); } crypto_free (); close_quit_pipe (); free_interns (); /* Note: Don't exit here, otherwise this won't work when compiled * for libFuzzer. */ return EXIT_SUCCESS; } /* Implementation of '-U -' */ static char * make_random_fifo (void) { char *sock; random_fifo_dir = make_temporary_directory (); if (random_fifo_dir == NULL) { perror ("make_temporary_directory"); return NULL; } if (asprintf (&random_fifo, "%s" DIR_SEPARATOR_STR "socket", random_fifo_dir) == -1) { perror ("asprintf"); goto error; } sock = strdup (random_fifo); if (sock == NULL) { perror ("strdup"); goto error; } return sock; error: free (random_fifo); random_fifo = NULL; rmdir (random_fifo_dir); free (random_fifo_dir); random_fifo_dir = NULL; return NULL; } const char * service_mode_string (enum service_mode sm) { switch (sm) { case SERVICE_MODE_SOCKET_ACTIVATION: return "socket activation"; case SERVICE_MODE_LISTEN_STDIN: return "listen stdin"; case SERVICE_MODE_UNIXSOCKET: return "unix socket"; case SERVICE_MODE_VSOCK: return "vsock"; case SERVICE_MODE_TCPIP: return "TCP/IP"; default: abort (); } } /* Is it the name of a possible nbdkit--plugin or * nbdkit--filter that might be a Fedora or Debian package? * This matches more than all possible names, but it's just a guide * for help output. */ static int is_possible_package_name (const char *name) { size_t i, n = strlen (name); for (i = 0; i < n; ++i) { char c = name[i]; if (ascii_isalnum (c)) continue; if (c == '-' || c == '_' || c == '.') continue; return 0; } return 1; } /* Common error handling for dlopen(3) failures in open_plugin_so or * open_filter_so. * * The error message is held implicitly in dlerror(3). * * 'what' == "plugin" | "filter" * * 'filename' is the file we were trying to dlopen. * * 'short_name' is the plugin/filter short name that was passed on the * nbdkit command line, or NULL if a short name was used (eg the * plugin was opened using a full path). */ static void failed_to_load_error (const char *what, const char *filename, const char *short_name) { fprintf (stderr, "%s: error: cannot open %s \"", program_name, what); c_string_quote (filename, stderr); fprintf (stderr, "\": "); c_string_quote (dlerror (), stderr); fprintf (stderr, "\n"); if (short_name && is_possible_package_name (short_name)) { fprintf (stderr, "\n" "To add this functionality you might need to install a separate\n" "%s package such as nbdkit-%s-%s (Fedora) or\n" "nbdkit-%s-%s (Debian).\n", what, short_name, what, what, short_name); } fprintf (stderr, "\n" "Use '%s --help' or " "read the nbdkit(1) manual page for documentation.\n", program_name); exit (EXIT_FAILURE); } static struct backend * open_plugin_so (size_t i, const char *name, int short_name) { struct backend *ret; const char *orig_name = name; char *filename = (char *) name; bool free_filename = false; void *dl; struct nbdkit_plugin *(*plugin_init) (void); char *error; if (short_name) { /* Short names are rewritten relative to the plugindir. */ if (asprintf (&filename, "%s/nbdkit-%s-plugin." SOEXT, plugindir, name) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } free_filename = true; } dl = dlopen (filename, RTLD_NOW|RTLD_GLOBAL); if (dl == NULL) failed_to_load_error ("plugin", filename, short_name ? orig_name : NULL); /* Initialize the plugin. See dlopen(3) to understand C weirdness. */ dlerror (); plugin_init = dlsym (dl, "plugin_init"); if ((error = dlerror ()) != NULL) { fprintf (stderr, "%s: %s: %s\n", program_name, name, error); exit (EXIT_FAILURE); } if (!plugin_init) { fprintf (stderr, "%s: %s: invalid plugin_init\n", program_name, name); exit (EXIT_FAILURE); } /* Register the plugin. */ ret = plugin_register (i, filename, dl, plugin_init); if (free_filename) free (filename); return ret; } static struct backend * open_filter_so (struct backend *next, size_t i, const char *name, int short_name) { struct backend *ret; const char *orig_name = name; char *filename = (char *) name; bool free_filename = false; void *dl; struct nbdkit_filter *(*filter_init) (void); char *error; if (short_name) { /* Short names are rewritten relative to the filterdir. */ if (asprintf (&filename, "%s/nbdkit-%s-filter." SOEXT, filterdir, name) == -1) { perror ("asprintf"); exit (EXIT_FAILURE); } free_filename = true; } dl = dlopen (filename, RTLD_NOW|RTLD_GLOBAL); if (dl == NULL) failed_to_load_error ("filter", filename, short_name ? orig_name : NULL); /* Initialize the filter. See dlopen(3) to understand C weirdness. */ dlerror (); filter_init = dlsym (dl, "filter_init"); if ((error = dlerror ()) != NULL) { fprintf (stderr, "%s: %s: %s\n", program_name, name, error); exit (EXIT_FAILURE); } if (!filter_init) { fprintf (stderr, "%s: %s: invalid filter_init\n", program_name, name); exit (EXIT_FAILURE); } /* Register the filter. */ ret = filter_register (next, i, filename, dl, filter_init); if (free_filename) free (filename); return ret; } static void start_serving (void) { sockets socks = empty_vector; size_t i; set_up_quit_pipe (); #if !ENABLE_LIBFUZZER set_up_signals (); #endif /* Lock the process into memory if requested. */ if (swap) { #ifdef HAVE_MLOCKALL if (mlockall (MCL_CURRENT | MCL_FUTURE) == -1) { fprintf (stderr, "%s: --swap: mlockall: %m\n", program_name); exit (EXIT_FAILURE); } debug ("mlockall done"); #else fprintf (stderr, "%s: mlockall (--swap option) " "is not supported on this platform\n", program_name); exit (EXIT_FAILURE); #endif } switch (service_mode) { case SERVICE_MODE_SOCKET_ACTIVATION: /* Socket activation: the ‘socket_activation’ variable (> 0) is * the number of file descriptors from FIRST_SOCKET_ACTIVATION_FD * to FIRST_SOCKET_ACTIVATION_FD+socket_activation-1. */ if (sockets_reserve_exactly (&socks, socket_activation) == -1) { perror ("realloc"); exit (EXIT_FAILURE); } for (i = 0; i < socket_activation; ++i) { int s = FIRST_SOCKET_ACTIVATION_FD + i, r; /* This can't fail because of the reservation above. */ r = sockets_append (&socks, s); assert (r == 0); } debug ("using socket activation, nr_socks = %zu", socks.len); change_user (); write_pidfile (); top->after_fork (top); accept_incoming_connections (&socks); break; case SERVICE_MODE_LISTEN_STDIN: /* Handling a single connection on stdin/stdout. */ change_user (); write_pidfile (); top->after_fork (top); threadlocal_new_server_thread (); handle_single_connection (saved_stdin, saved_stdout); break; case SERVICE_MODE_UNIXSOCKET: bind_unix_socket (&socks); goto serve_socks; case SERVICE_MODE_VSOCK: bind_vsock (&socks); goto serve_socks; case SERVICE_MODE_TCPIP: bind_tcpip_socket (&socks); serve_socks: /* Common code for handling multiple connections on TCP/IP, Unix * domain socket or AF_VSOCK. */ run_command (); change_user (); fork_into_background (); write_pidfile (); top->after_fork (top); accept_incoming_connections (&socks); break; default: abort (); } } static void write_pidfile (void) { int fd; pid_t pid; char pidstr[64]; size_t len; if (!pidfile) return; pid = getpid (); /* Don't put a trailing \n after the PID file on Windows. It is * turned into \r\n which causes problems if you process the file * using a Unix tool like bash, especially when running the test * suite. */ snprintf (pidstr, sizeof pidstr, "%d" #ifndef WIN32 "\n" #endif , (int) pid); len = strlen (pidstr); fd = open (pidfile, O_WRONLY|O_TRUNC|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644); if (fd == -1) { perror (pidfile); exit (EXIT_FAILURE); } if (write (fd, pidstr, len) < len || close (fd) == -1) { perror (pidfile); exit (EXIT_FAILURE); } debug ("written pidfile %s", pidfile); } /* When parsing plugin and filter config key=value from the command * line, is the key a simple alphanumeric with period, underscore or * dash? */ static bool is_config_key (const char *key, size_t len) { static const char allowed_first[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; static const char allowed[] = "._-" "0123456789" "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (len == 0) return false; if (strchr (allowed_first, key[0]) == NULL) return false; /* This works in context of the caller since key[len] == '='. */ if (strspn (key, allowed) != len) return false; return true; } /* Refuse to run if stdin/out/err are closed, whether or not -s is used. */ static void error_if_stdio_closed (void) { #ifdef F_GETFL if (fcntl (STDERR_FILENO, F_GETFL) == -1) { /* Nowhere we can report the error. Oh well. */ exit (EXIT_FAILURE); } if (fcntl (STDIN_FILENO, F_GETFL) == -1 || fcntl (STDOUT_FILENO, F_GETFL) == -1) { perror ("expecting stdin/stdout to be opened"); exit (EXIT_FAILURE); } #endif } /* Sanitize stdin/stdout to /dev/null, after saving the originals * when needed. We are still single-threaded at this point, and * already checked that stdin/out were open, so we don't have to * worry about other threads accidentally grabbing our intended fds, * or races on FD_CLOEXEC. POSIX says that 'fflush(NULL)' is * supposed to reset the underlying offset of seekable stdin, but * glibc is buggy and requires an explicit fflush(stdin) as * well. https://sourceware.org/bugzilla/show_bug.cgi?id=12799 */ static void switch_stdio (void) { #if defined (F_DUPFD_CLOEXEC) || defined (F_DUPFD) fflush (stdin); fflush (NULL); if (listen_stdin || run) { #ifndef F_DUPFD_CLOEXEC #define F_DUPFD_CLOEXEC F_DUPFD #endif saved_stdin = fcntl (STDIN_FILENO, F_DUPFD_CLOEXEC, STDERR_FILENO + 1); saved_stdout = fcntl (STDOUT_FILENO, F_DUPFD_CLOEXEC, STDERR_FILENO + 1); #if F_DUPFD == F_DUPFD_CLOEXEC saved_stdin = set_cloexec (saved_stdin); saved_stdout = set_cloexec (saved_stdout); #endif if (saved_stdin == -1 || saved_stdout == -1) { perror ("fcntl"); exit (EXIT_FAILURE); } } #endif #ifndef WIN32 close (STDIN_FILENO); close (STDOUT_FILENO); if (open ("/dev/null", O_RDONLY) != STDIN_FILENO || open ("/dev/null", O_WRONLY) != STDOUT_FILENO) { perror ("open"); exit (EXIT_FAILURE); } #endif } /* On Windows the Winsock library must be initialized early. * https://docs.microsoft.com/en-us/windows/win32/winsock/initializing-winsock */ static void winsock_init (void) { #ifdef WIN32 WSADATA wsaData; int result; result = WSAStartup (MAKEWORD (2, 2), &wsaData); if (result != 0) { fprintf (stderr, "WSAStartup failed: %d\n", result); exit (EXIT_FAILURE); } #endif } nbdkit-1.42.2/server/plugins.c0000644000175000017500000006274214771245250011711 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #include "internal.h" #include "minmax.h" #include "ispowerof2.h" /* We extend the generic backend struct with extra fields relating * to this plugin. */ struct backend_plugin { struct backend backend; struct nbdkit_plugin plugin; }; static void plugin_free (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); backend_unload (b, p->plugin.unload); free (p); } static int plugin_thread_model (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int model = p->plugin._thread_model; int r; #if !(defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2 && \ defined HAVE_ACCEPT4) if (model > NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { debug ("system lacks atomic CLOEXEC, serializing to avoid fd leaks"); model = NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS; } #endif if (p->plugin.thread_model) { r = p->plugin.thread_model (); if (r == -1) exit (EXIT_FAILURE); if (r < model) model = r; } return model; } static const char * plugin_name (struct backend *b) { return b->name; } static void plugin_usage (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); const char *t; printf ("plugin: %s", b->name); if (p->plugin.longname) printf (" (%s)", p->plugin.longname); printf ("\n"); printf ("(%s)\n", b->filename); if (p->plugin.description) { printf ("%s", p->plugin.description); if ((t = strrchr (p->plugin.description, '\n')) == NULL || t[1]) printf ("\n"); } if (p->plugin.config_help) { printf ("%s", p->plugin.config_help); if ((t = strrchr (p->plugin.config_help, '\n')) == NULL || t[1]) printf ("\n"); } } static const char * plugin_version (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); return p->plugin.version; } /* This implements the --dump-plugin option. */ static void plugin_dump_fields (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); char *path; path = nbdkit_realpath (b->filename); printf ("path=%s\n", path); free (path); printf ("name=%s\n", b->name); if (p->plugin.version) printf ("version=%s\n", p->plugin.version); printf ("api_version=%d\n", p->plugin._api_version); printf ("struct_size=%" PRIu64 "\n", p->plugin._struct_size); printf ("max_thread_model=%s\n", name_of_thread_model (p->plugin._thread_model)); printf ("thread_model=%s\n", name_of_thread_model (top->thread_model (top))); printf ("errno_is_preserved=%d\n", !!p->plugin.errno_is_preserved); if (p->plugin.magic_config_key) printf ("magic_config_key=%s\n", p->plugin.magic_config_key); #define HAS(field) if (p->plugin.field) printf ("has_%s=1\n", #field) HAS (longname); HAS (description); HAS (load); HAS (unload); HAS (dump_plugin); HAS (config); HAS (config_complete); HAS (config_help); HAS (thread_model); HAS (get_ready); HAS (after_fork); HAS (cleanup); HAS (preconnect); HAS (list_exports); HAS (default_export); HAS (open); HAS (close); HAS (export_description); HAS (get_size); HAS (block_size); HAS (can_write); HAS (can_flush); HAS (is_rotational); HAS (can_trim); HAS (can_zero); HAS (can_fast_zero); HAS (can_extents); HAS (can_fua); HAS (can_multi_conn); HAS (can_cache); HAS (pread); HAS (pwrite); HAS (flush); HAS (trim); HAS (zero); HAS (extents); HAS (cache); HAS (_pread_v1); HAS (_pwrite_v1); HAS (_flush_v1); HAS (_trim_v1); HAS (_zero_v1); #undef HAS /* Custom fields. */ if (p->plugin.dump_plugin) p->plugin.dump_plugin (); } static void plugin_config (struct backend *b, const char *key, const char *value) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: config key=%s, value=%s", b->name, key, value); if (p->plugin.config == NULL) { fprintf (stderr, "%s: %s: this plugin does not need command line configuration\n" "Try using: %s --help %s\n", program_name, b->filename, program_name, b->filename); exit (EXIT_FAILURE); } if (p->plugin.config (key, value) == -1) exit (EXIT_FAILURE); } static void plugin_config_complete (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: config_complete", b->name); if (!p->plugin.config_complete) return; if (p->plugin.config_complete () == -1) exit (EXIT_FAILURE); } static const char * plugin_magic_config_key (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); return p->plugin.magic_config_key; } static void plugin_get_ready (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: get_ready", b->name); if (!p->plugin.get_ready) return; if (p->plugin.get_ready () == -1) exit (EXIT_FAILURE); } static void plugin_after_fork (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: after_fork", b->name); if (!p->plugin.after_fork) return; if (p->plugin.after_fork () == -1) exit (EXIT_FAILURE); } static void plugin_cleanup (struct backend *b) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: cleanup", b->name); if (p->plugin.cleanup) p->plugin.cleanup (); } static int plugin_preconnect (struct backend *b, int readonly) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); debug ("%s: preconnect", b->name); if (!p->plugin.preconnect) return 0; return p->plugin.preconnect (readonly); } static int plugin_list_exports (struct backend *b, int readonly, int is_tls, struct nbdkit_exports *exports) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (!p->plugin.list_exports) return nbdkit_use_default_export (exports); return p->plugin.list_exports (readonly, is_tls, exports); } static const char * plugin_default_export (struct backend *b, int readonly, int is_tls) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (!p->plugin.default_export) return ""; return p->plugin.default_export (readonly, is_tls); } static void * plugin_open (struct context *c, int readonly, const char *exportname, int is_tls) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); void *r; assert (p->plugin.open != NULL); /* Save the exportname since the lifetime of the string passed in * here is likely to be brief. In addition this provides a place * for nbdkit_export_name to retrieve it if called from the plugin. * While readonly and the export name can be altered in plugins, the * tls mode cannot. * * In API V3 we propose to pass the exportname and tls mode as extra * parameters to the (new) plugin.open and deprecate * nbdkit_export_name and nbdkit_is_tls for V3 users. Even then we * will still need to save the export name in the handle because of * the lifetime issue. */ if (c->conn) { assert (c->conn->exportname == NULL); c->conn->exportname = nbdkit_strdup_intern (exportname); if (c->conn->exportname == NULL) return NULL; } r = p->plugin.open (readonly); if (r == NULL && c->conn) c->conn->exportname = NULL; return r; } /* We don't expose .prepare and .finalize to plugins since they aren't * necessary. Plugins can easily do the same work in .open and * .close. */ static int plugin_prepare (struct context *c, int readonly) { return 0; } static int plugin_finalize (struct context *c) { return 0; } static void plugin_close (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); assert (c->handle); if (p->plugin.close) p->plugin.close (c->handle); if (c->conn) c->conn->exportname = NULL; } static const char * plugin_export_description (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.export_description) return p->plugin.export_description (c->handle); else return NULL; } static int64_t plugin_get_size (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); assert (p->plugin.get_size != NULL); return p->plugin.get_size (c->handle); } static int plugin_block_size (struct context *c, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.block_size) { if (p->plugin.block_size (c->handle, minimum, preferred, maximum) == -1) return -1; /* To make scripting easier, it's permitted to set * minimum = preferred = maximum = 0 and return 0. * That means "no information", and works the same * way as the else clause below. */ if (*minimum == 0 && *preferred == 0 && *maximum == 0) return 0; if (*minimum < 1 || *minimum > 65536) { nbdkit_error ("plugin must set minimum block size between 1 and 64K"); return -1; } if (! is_power_of_2 (*minimum)) { nbdkit_error ("plugin must set minimum block size to a power of 2"); return -1; } if (! is_power_of_2 (*preferred)) { nbdkit_error ("plugin must set preferred block size to a power of 2"); return -1; } if (*preferred < 512 || *preferred > 32 * 1024 * 1024) { nbdkit_error ("plugin must set preferred block size " "between 512 and 32M"); return -1; } if (*maximum != (uint32_t)-1 && (*maximum % *minimum) != 0) { nbdkit_error ("plugin must set maximum block size " "to -1 or a multiple of minimum block size"); return -1; } if (*minimum > *preferred || *preferred > *maximum) { nbdkit_error ("plugin must set minimum block size " "<= preferred <= maximum"); return -1; } return 0; } else { /* If there is no .block_size call then return minimum = preferred * = maximum = 0, which is a sentinel meaning don't send the * NBD_INFO_BLOCK_SIZE message. */ *minimum = *preferred = *maximum = 0; return 0; } } static int normalize_bool (int value) { if (value == -1 || value == 0) return value; /* Normalize all other non-zero values to true */ return 1; } static int plugin_can_write (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_write) return normalize_bool (p->plugin.can_write (c->handle)); else return p->plugin.pwrite || p->plugin._pwrite_v1; } static int plugin_can_flush (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_flush) return normalize_bool (p->plugin.can_flush (c->handle)); else return p->plugin.flush || p->plugin._flush_v1; } static int plugin_is_rotational (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.is_rotational) return normalize_bool (p->plugin.is_rotational (c->handle)); else return 0; /* assume false */ } static int plugin_can_trim (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_trim) return normalize_bool (p->plugin.can_trim (c->handle)); else return p->plugin.trim || p->plugin._trim_v1; } static int plugin_can_zero (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; /* Note the special case here: the plugin's .can_zero returns a bool * which controls only whether we call .zero; while the backend * expects .can_zero to return a tri-state on level of support. */ if (p->plugin.can_zero) { r = p->plugin.can_zero (c->handle); if (r == -1) return -1; return r ? NBDKIT_ZERO_NATIVE : NBDKIT_ZERO_EMULATE; } if (p->plugin.zero || p->plugin._zero_v1) return NBDKIT_ZERO_NATIVE; return NBDKIT_ZERO_EMULATE; } static int plugin_can_fast_zero (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; if (p->plugin.can_fast_zero) return normalize_bool (p->plugin.can_fast_zero (c->handle)); /* Advertise support for fast zeroes if no .zero or .can_zero is * false: in those cases, we fail fast instead of using .pwrite. * This also works when v1 plugin has only ._zero_v1. */ if (p->plugin.zero == NULL) return 1; r = backend_can_zero (c); if (r == -1) return -1; return !r; } static int plugin_can_extents (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_extents) return normalize_bool (p->plugin.can_extents (c->handle)); else return p->plugin.extents != NULL; } static int plugin_can_fua (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; /* The plugin must use API version 2 and have .can_fua return NBDKIT_FUA_NATIVE before we will pass the FUA flag on. */ if (p->plugin.can_fua) { r = p->plugin.can_fua (c->handle); if (r > NBDKIT_FUA_EMULATE && p->plugin._api_version == 1) r = NBDKIT_FUA_EMULATE; return r; } /* We intend to call .flush even if .can_flush returns false. */ if (p->plugin.flush || p->plugin._flush_v1) return NBDKIT_FUA_EMULATE; return NBDKIT_FUA_NONE; } static int plugin_can_multi_conn (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_multi_conn) return normalize_bool (p->plugin.can_multi_conn (c->handle)); else return 0; /* assume false */ } static int plugin_can_cache (struct context *c) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p->plugin.can_cache) return p->plugin.can_cache (c->handle); if (p->plugin.cache) return NBDKIT_CACHE_NATIVE; return NBDKIT_CACHE_NONE; } /* Plugins and filters can call this to set the true errno, in cases * where !errno_is_preserved. */ NBDKIT_DLL_PUBLIC void nbdkit_set_error (int err) { threadlocal_set_errno (err); } /* Grab the appropriate error value. */ static int get_errno (struct backend_plugin *p) { int ret = threadlocal_get_errno (); if (!ret && p->plugin.errno_is_preserved != 0) ret = errno; return ret ? ret : EIO; } static int plugin_pread (struct context *c, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; assert (p->plugin.pread || p->plugin._pread_v1); if (p->plugin.pread) r = p->plugin.pread (c->handle, buf, count, offset, 0); else r = p->plugin._pread_v1 (c->handle, buf, count, offset); if (r == -1) *err = get_errno (p); return r; } static int plugin_flush (struct context *c, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; if (p->plugin.flush) r = p->plugin.flush (c->handle, 0); else if (p->plugin._flush_v1) r = p->plugin._flush_v1 (c->handle); else { *err = EINVAL; return -1; } if (r == -1) *err = get_errno (p); return r; } static int plugin_pwrite (struct context *c, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; int r; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); bool fua = flags & NBDKIT_FLAG_FUA; bool need_flush = false; if (fua && backend_can_fua (c) != NBDKIT_FUA_NATIVE) { flags &= ~NBDKIT_FLAG_FUA; need_flush = true; } if (p->plugin.pwrite) r = p->plugin.pwrite (c->handle, buf, count, offset, flags); else if (p->plugin._pwrite_v1) r = p->plugin._pwrite_v1 (c->handle, buf, count, offset); else { *err = EROFS; return -1; } if (r != -1 && need_flush) r = plugin_flush (c, 0, err); if (r == -1 && !*err) *err = get_errno (p); return r; } static int plugin_trim (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; int r; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); bool fua = flags & NBDKIT_FLAG_FUA; bool need_flush = false; if (fua && backend_can_fua (c) != NBDKIT_FUA_NATIVE) { flags &= ~NBDKIT_FLAG_FUA; need_flush = true; } if (p->plugin.trim) r = p->plugin.trim (c->handle, count, offset, flags); else if (p->plugin._trim_v1) r = p->plugin._trim_v1 (c->handle, count, offset); else { *err = EINVAL; return -1; } if (r != -1 && need_flush) r = plugin_flush (c, 0, err); if (r == -1 && !*err) *err = get_errno (p); return r; } static int plugin_zero (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r = -1; bool may_trim = flags & NBDKIT_FLAG_MAY_TRIM; bool fua = flags & NBDKIT_FLAG_FUA; bool fast_zero = flags & NBDKIT_FLAG_FAST_ZERO; bool emulate = false; bool need_flush = false; if (fua && backend_can_fua (c) != NBDKIT_FUA_NATIVE) { flags &= ~NBDKIT_FLAG_FUA; need_flush = true; } if (!count) return 0; if (backend_can_zero (c) == NBDKIT_ZERO_NATIVE) { errno = 0; if (p->plugin.zero) r = p->plugin.zero (c->handle, count, offset, flags); else if (p->plugin._zero_v1) { if (fast_zero) { *err = EOPNOTSUPP; return -1; } r = p->plugin._zero_v1 (c->handle, count, offset, may_trim); } else emulate = true; if (r == -1) *err = emulate ? EOPNOTSUPP : get_errno (p); if (r == 0 || (*err != EOPNOTSUPP && *err != ENOTSUP)) goto done; } if (fast_zero) { assert (r == -1); *err = EOPNOTSUPP; goto done; } flags &= ~NBDKIT_FLAG_MAY_TRIM; threadlocal_set_errno (0); *err = 0; while (count) { /* Always contains zeroes, but we can't use const or else gcc 9 * will use .rodata instead of .bss and inflate the binary size. */ static /* const */ char buf[MAX_REQUEST_SIZE]; uint32_t limit = MIN (count, sizeof buf); r = plugin_pwrite (c, buf, limit, offset, flags, err); if (r == -1) break; count -= limit; } done: if (r != -1 && need_flush) r = plugin_flush (c, 0, err); if (r == -1 && !*err) *err = get_errno (p); return r; } static int plugin_extents (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; if (p->plugin.extents == NULL) { /* Possible if .can_extents lied */ *err = EINVAL; return -1; } r = p->plugin.extents (c->handle, count, offset, flags, extents); if (r >= 0 && nbdkit_extents_count (extents) < 1) { nbdkit_error ("extents: plugin must return at least one extent"); nbdkit_set_error (EINVAL); r = -1; } if (r == -1) *err = get_errno (p); return r; } static int plugin_cache (struct context *c, uint32_t count, uint64_t offset, uint32_t flags, int *err) { struct backend *b = c->b; struct backend_plugin *p = container_of (b, struct backend_plugin, backend); int r; /* A plugin may advertise caching but not provide .cache; in that * case, caching is explicitly a no-op. */ if (!p->plugin.cache) return 0; r = p->plugin.cache (c->handle, count, offset, flags); if (r == -1) *err = get_errno (p); return r; } static struct backend plugin_functions = { .free = plugin_free, .thread_model = plugin_thread_model, .plugin_name = plugin_name, .usage = plugin_usage, .version = plugin_version, .dump_fields = plugin_dump_fields, .config = plugin_config, .config_complete = plugin_config_complete, .magic_config_key = plugin_magic_config_key, .get_ready = plugin_get_ready, .after_fork = plugin_after_fork, .cleanup = plugin_cleanup, .preconnect = plugin_preconnect, .list_exports = plugin_list_exports, .default_export = plugin_default_export, .open = plugin_open, .prepare = plugin_prepare, .finalize = plugin_finalize, .close = plugin_close, .export_description = plugin_export_description, .get_size = plugin_get_size, .block_size = plugin_block_size, .can_write = plugin_can_write, .can_flush = plugin_can_flush, .is_rotational = plugin_is_rotational, .can_trim = plugin_can_trim, .can_zero = plugin_can_zero, .can_fast_zero = plugin_can_fast_zero, .can_extents = plugin_can_extents, .can_fua = plugin_can_fua, .can_multi_conn = plugin_can_multi_conn, .can_cache = plugin_can_cache, .pread = plugin_pread, .pwrite = plugin_pwrite, .flush = plugin_flush, .trim = plugin_trim, .zero = plugin_zero, .extents = plugin_extents, .cache = plugin_cache, }; /* Register and load a plugin. */ struct backend * plugin_register (size_t index, const char *filename, void *dl, plugin_init_function plugin_init) { struct backend_plugin *p; const struct nbdkit_plugin *plugin; size_t size; p = malloc (sizeof *p); if (p == NULL) { perror ("strdup"); exit (EXIT_FAILURE); } p->backend = plugin_functions; backend_init (&p->backend, NULL, index, filename, dl, "plugin"); /* Call the initialization function which returns the address of the * plugin's own 'struct nbdkit_plugin'. */ plugin = plugin_init (); if (!plugin) { fprintf (stderr, "%s: %s: plugin registration function failed\n", program_name, filename); exit (EXIT_FAILURE); } /* Check for incompatible future versions. */ if (plugin->_api_version < 0 || plugin->_api_version > MAX_API_VERSION) { fprintf (stderr, "%s: %s: plugin is incompatible with this version of nbdkit " "(_api_version = %d)\n", program_name, filename, plugin->_api_version); exit (EXIT_FAILURE); } /* Since the plugin might be much older than the current version of * nbdkit, only copy up to the self-declared _struct_size of the * plugin and zero out the rest. If the plugin is much newer then * we'll only call the "old" fields. */ size = sizeof p->plugin; /* our struct */ memset (&p->plugin, 0, size); if (size > plugin->_struct_size) size = plugin->_struct_size; memcpy (&p->plugin, plugin, size); /* Check for the minimum fields which must exist in the * plugin struct. */ if (p->plugin.open == NULL) { fprintf (stderr, "%s: %s: plugin must have a .open callback\n", program_name, filename); exit (EXIT_FAILURE); } if (p->plugin.get_size == NULL) { fprintf (stderr, "%s: %s: plugin must have a .get_size callback\n", program_name, filename); exit (EXIT_FAILURE); } if (p->plugin.pread == NULL && p->plugin._pread_v1 == NULL) { fprintf (stderr, "%s: %s: plugin must have a .pread callback\n", program_name, filename); exit (EXIT_FAILURE); } backend_load (&p->backend, p->plugin.name, p->plugin.load); return (struct backend *) p; } nbdkit-1.42.2/server/protocol.c0000644000175000017500000005470414676465664012111 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include "internal.h" #include "byte-swapping.h" #include "minmax.h" #include "nbd-protocol.h" #include "protostrings.h" static bool validate_request (uint16_t cmd, uint16_t flags, uint64_t offset, uint32_t count, uint32_t *error) { GET_CONN; /* Readonly connection? */ if (conn->eflags & NBD_FLAG_READ_ONLY && (cmd == NBD_CMD_WRITE || cmd == NBD_CMD_TRIM || cmd == NBD_CMD_WRITE_ZEROES)) { nbdkit_error ("invalid request: %s: write request on readonly connection", name_of_nbd_cmd (cmd)); *error = EROFS; return false; } /* Validate cmd, offset, count. */ switch (cmd) { case NBD_CMD_READ: case NBD_CMD_CACHE: case NBD_CMD_WRITE: case NBD_CMD_TRIM: case NBD_CMD_WRITE_ZEROES: case NBD_CMD_BLOCK_STATUS: if (!backend_valid_range (conn->top_context, offset, count)) { /* XXX Allow writes to extend the disk? */ nbdkit_error ("invalid request: %s: offset and count are out of range: " "offset=%" PRIu64 " count=%" PRIu32, name_of_nbd_cmd (cmd), offset, count); *error = (cmd == NBD_CMD_WRITE || cmd == NBD_CMD_WRITE_ZEROES) ? ENOSPC : EINVAL; return false; } break; case NBD_CMD_FLUSH: if (offset != 0 || count != 0) { nbdkit_error ("invalid request: %s: expecting offset and count = 0", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } break; default: nbdkit_error ("invalid request: unknown command (%" PRIu32 ") ignored", cmd); *error = EINVAL; return false; } /* Validate flags */ if (flags & ~(NBD_CMD_FLAG_FUA | NBD_CMD_FLAG_NO_HOLE | NBD_CMD_FLAG_DF | NBD_CMD_FLAG_REQ_ONE | NBD_CMD_FLAG_FAST_ZERO)) { nbdkit_error ("invalid request: unknown flag (0x%x)", flags); *error = EINVAL; return false; } if ((flags & NBD_CMD_FLAG_NO_HOLE) && cmd != NBD_CMD_WRITE_ZEROES) { nbdkit_error ("invalid request: NO_HOLE flag needs WRITE_ZEROES request"); *error = EINVAL; return false; } if ((flags & NBD_CMD_FLAG_FAST_ZERO) && cmd != NBD_CMD_WRITE_ZEROES) { nbdkit_error ("invalid request: " "FAST_ZERO flag needs WRITE_ZEROES request"); *error = EINVAL; return false; } if (flags & NBD_CMD_FLAG_DF) { if (cmd != NBD_CMD_READ) { nbdkit_error ("invalid request: DF flag needs READ request"); *error = EINVAL; return false; } if (!conn->structured_replies) { nbdkit_error ("invalid request: " "%s: structured replies was not negotiated", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } } if ((flags & NBD_CMD_FLAG_REQ_ONE) && cmd != NBD_CMD_BLOCK_STATUS) { nbdkit_error ("invalid request: REQ_ONE flag needs BLOCK_STATUS request"); *error = EINVAL; return false; } if (flags & NBD_CMD_FLAG_FUA && !(conn->eflags & NBD_FLAG_SEND_FUA)) { nbdkit_error ("invalid request: FUA flag not supported"); *error = EINVAL; return false; } /* Refuse over-large read and write requests. */ if ((cmd == NBD_CMD_WRITE || cmd == NBD_CMD_READ) && count > MAX_REQUEST_SIZE) { nbdkit_error ("invalid request: %s: data request is too large (%" PRIu32 " > %d)", name_of_nbd_cmd (cmd), count, MAX_REQUEST_SIZE); *error = ENOMEM; return false; } /* Flush allowed? */ if (cmd == NBD_CMD_FLUSH && !(conn->eflags & NBD_FLAG_SEND_FLUSH)) { nbdkit_error ("invalid request: %s: flush operation not supported", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } /* Trim allowed? */ if (cmd == NBD_CMD_TRIM && !(conn->eflags & NBD_FLAG_SEND_TRIM)) { nbdkit_error ("invalid request: %s: trim operation not supported", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } /* Zero allowed? */ if (cmd == NBD_CMD_WRITE_ZEROES && !(conn->eflags & NBD_FLAG_SEND_WRITE_ZEROES)) { nbdkit_error ("invalid request: %s: write zeroes operation not supported", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } /* Cache allowed? */ if (cmd == NBD_CMD_CACHE && !(conn->eflags & NBD_FLAG_SEND_CACHE)) { nbdkit_error ("invalid request: %s: cache operation not supported", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } /* Block status allowed? */ if (cmd == NBD_CMD_BLOCK_STATUS) { if (!conn->structured_replies) { nbdkit_error ("invalid request: " "%s: structured replies was not negotiated", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } if (!conn->meta_context_base_allocation) { nbdkit_error ("invalid request: " "%s: base:allocation was not negotiated", name_of_nbd_cmd (cmd)); *error = EINVAL; return false; } } return true; /* Command validates. */ } /* This is called with the request lock held to actually execute the * request (by calling the plugin). Note that the request fields have * been validated already in 'validate_request' so we don't have to * check them again. * * 'buf' is either the data to be written or the data to be returned, * and points to a buffer of size 'count' bytes. * * 'extents' is an empty extents list used for block status requests * only. * * In all cases, the return value is the system errno value that will * later be converted to the nbd error to send back to the client (0 * for success). */ static uint32_t handle_request (uint16_t cmd, uint16_t flags, uint64_t offset, uint32_t count, void *buf, struct nbdkit_extents *extents) { GET_CONN; struct context *c = conn->top_context; uint32_t f = 0; int err = 0; /* Clear the error, so that we know if the plugin calls * nbdkit_set_error() or relied on errno. */ threadlocal_set_errno (0); /* Also clear the last error in this thread so we will only save * nbdkit_error() from this request. */ threadlocal_clear_last_error (); switch (cmd) { case NBD_CMD_READ: if (backend_pread (c, buf, count, offset, 0, &err) == -1) return err; break; case NBD_CMD_WRITE: if (flags & NBD_CMD_FLAG_FUA) f |= NBDKIT_FLAG_FUA; if (backend_pwrite (c, buf, count, offset, f, &err) == -1) return err; break; case NBD_CMD_FLUSH: if (backend_flush (c, 0, &err) == -1) return err; break; case NBD_CMD_TRIM: if (flags & NBD_CMD_FLAG_FUA) f |= NBDKIT_FLAG_FUA; if (backend_trim (c, count, offset, f, &err) == -1) return err; break; case NBD_CMD_CACHE: if (backend_cache (c, count, offset, 0, &err) == -1) return err; break; case NBD_CMD_WRITE_ZEROES: if (!(flags & NBD_CMD_FLAG_NO_HOLE)) f |= NBDKIT_FLAG_MAY_TRIM; if (flags & NBD_CMD_FLAG_FUA) f |= NBDKIT_FLAG_FUA; if (flags & NBD_CMD_FLAG_FAST_ZERO) f |= NBDKIT_FLAG_FAST_ZERO; if (backend_zero (c, count, offset, f, &err) == -1) return err; break; case NBD_CMD_BLOCK_STATUS: if (flags & NBD_CMD_FLAG_REQ_ONE) f |= NBDKIT_FLAG_REQ_ONE; if (backend_extents (c, count, offset, f, extents, &err) == -1) return err; break; default: abort (); } return 0; } static int skip_over_write_buffer (int sock, size_t count) { char buf[BUFSIZ]; ssize_t r; if (count > MAX_REQUEST_SIZE * 2) { nbdkit_error ("write request too large to skip"); return -1; } while (count > 0) { r = read (sock, buf, count > BUFSIZ ? BUFSIZ : count); if (r == -1) { nbdkit_error ("skipping write buffer: %m"); return -1; } if (r == 0) { nbdkit_error ("unexpected early EOF"); errno = EBADMSG; return -1; } count -= r; } return 0; } /* Convert a system errno to an NBD_E* error code. */ static int nbd_errno (int error, uint16_t flags) { switch (error) { case 0: return NBD_SUCCESS; case EROFS: case EPERM: return NBD_EPERM; case EIO: return NBD_EIO; case ENOMEM: return NBD_ENOMEM; #ifdef EDQUOT case EDQUOT: #endif case EFBIG: case ENOSPC: return NBD_ENOSPC; #ifdef ESHUTDOWN case ESHUTDOWN: return NBD_ESHUTDOWN; #endif case ENOTSUP: #if ENOTSUP != EOPNOTSUPP case EOPNOTSUPP: #endif if (flags & NBD_CMD_FLAG_FAST_ZERO) return NBD_ENOTSUP; return NBD_EINVAL; case EOVERFLOW: if (flags & NBD_CMD_FLAG_DF) return NBD_EOVERFLOW; return NBD_EINVAL; case EINVAL: default: return NBD_EINVAL; } } static bool send_simple_reply (uint64_t cookie, uint16_t cmd, uint16_t flags, const char *buf, uint32_t count, uint32_t error) { GET_CONN; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); struct nbd_simple_reply reply; int r; int f = (cmd == NBD_CMD_READ && !error) ? SEND_MORE : 0; reply.magic = htobe32 (NBD_SIMPLE_REPLY_MAGIC); reply.cookie = cookie; reply.error = htobe32 (nbd_errno (error, flags)); r = conn->send (&reply, sizeof reply, f); if (r == -1) { nbdkit_error ("write reply: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } /* Send the read data buffer. */ if (cmd == NBD_CMD_READ && !error) { r = conn->send (buf, count, 0); if (r == -1) { nbdkit_error ("write data: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } } return false; } static bool send_structured_reply_read (uint64_t cookie, uint16_t cmd, const char *buf, uint32_t count, uint64_t offset) { GET_CONN; /* Once we are really using structured replies and sending data back * in chunks, we'll be able to grab the write lock for each chunk, * allowing other threads to interleave replies. As we're not doing * that yet we acquire the lock for the whole function. */ ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); struct nbd_structured_reply reply; struct nbd_chunk_offset_data offset_data; int r; assert (cmd == NBD_CMD_READ); reply.magic = htobe32 (NBD_STRUCTURED_REPLY_MAGIC); reply.cookie = cookie; reply.flags = htobe16 (NBD_REPLY_FLAG_DONE); reply.type = htobe16 (NBD_REPLY_TYPE_OFFSET_DATA); reply.length = htobe32 (count + sizeof offset_data); r = conn->send (&reply, sizeof reply, SEND_MORE); if (r == -1) { nbdkit_error ("write reply: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } /* Send the offset + read data buffer. */ offset_data.offset = htobe64 (offset); r = conn->send (&offset_data, sizeof offset_data, SEND_MORE); if (r == -1) { nbdkit_error ("write data: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } r = conn->send (buf, count, 0); if (r == -1) { nbdkit_error ("write data: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } return false; } /* Convert a list of extents into NBD_REPLY_TYPE_BLOCK_STATUS blocks. * The rules here are very complicated. Read the spec carefully! */ static struct nbd_block_descriptor_32 * extents_to_block_descriptors (struct nbdkit_extents *extents, uint16_t flags, uint32_t count, uint64_t offset, size_t *nr_blocks) { const bool req_one = flags & NBD_CMD_FLAG_REQ_ONE; const size_t nr_extents = nbdkit_extents_count (extents); size_t i; struct nbd_block_descriptor_32 *blocks; /* This is checked in server/plugins.c. */ assert (nr_extents >= 1); /* We may send fewer than nr_extents blocks, but never more. */ blocks = calloc (req_one ? 1 : nr_extents, sizeof (struct nbd_block_descriptor_32)); if (blocks == NULL) { nbdkit_error ("calloc: %m"); return NULL; } if (req_one) { const struct nbdkit_extent e = nbdkit_get_extent (extents, 0); /* Checked as a side effect of how the extent list is created. */ assert (e.length > 0); *nr_blocks = 1; /* Must not exceed count of the original request. */ blocks[0].length = MIN (e.length, (uint64_t) count); blocks[0].status_flags = e.type & 3; } else { uint64_t pos = offset; *nr_blocks = 0; for (i = 0; i < nr_extents; ++i) { const struct nbdkit_extent e = nbdkit_get_extent (extents, i); uint64_t length; if (i == 0) assert (e.offset == offset); /* Must not exceed UINT32_MAX. */ blocks[i].length = length = MIN (e.length, UINT32_MAX); blocks[i].status_flags = e.type & 3; (*nr_blocks)++; pos += length; if (pos > offset + count) /* this must be the last block */ break; /* If we reach here then we must have consumed this whole * extent. This is currently true because the server only sends * 32 bit requests, but if we move to 64 bit requests we will * need to revisit this code so it can split extents into * multiple blocks. XXX */ assert (e.length <= length); } } #if 0 for (i = 0; i < *nr_blocks; ++i) debug ("block status: sending block %" PRIu32 " type %" PRIu32, blocks[i].length, blocks[i].status_flags); #endif /* Convert to big endian for the protocol. */ for (i = 0; i < *nr_blocks; ++i) { blocks[i].length = htobe32 (blocks[i].length); blocks[i].status_flags = htobe32 (blocks[i].status_flags); } return blocks; } static bool send_structured_reply_block_status (uint64_t cookie, uint16_t cmd, uint16_t flags, uint32_t count, uint64_t offset, struct nbdkit_extents *extents) { GET_CONN; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); struct nbd_structured_reply reply; CLEANUP_FREE struct nbd_block_descriptor_32 *blocks = NULL; size_t nr_blocks; uint32_t context_id; size_t i; int r; assert (conn->meta_context_base_allocation); assert (cmd == NBD_CMD_BLOCK_STATUS); blocks = extents_to_block_descriptors (extents, flags, count, offset, &nr_blocks); if (blocks == NULL) return connection_set_status (STATUS_DEAD); reply.magic = htobe32 (NBD_STRUCTURED_REPLY_MAGIC); reply.cookie = cookie; reply.flags = htobe16 (NBD_REPLY_FLAG_DONE); reply.type = htobe16 (NBD_REPLY_TYPE_BLOCK_STATUS); reply.length = htobe32 (sizeof context_id + nr_blocks * sizeof (struct nbd_block_descriptor_32)); r = conn->send (&reply, sizeof reply, SEND_MORE); if (r == -1) { nbdkit_error ("write reply: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } /* Send the base:allocation context ID. */ context_id = htobe32 (base_allocation_id); r = conn->send (&context_id, sizeof context_id, SEND_MORE); if (r == -1) { nbdkit_error ("write reply: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } /* Send each block descriptor. */ for (i = 0; i < nr_blocks; ++i) { r = conn->send (&blocks[i], sizeof blocks[i], i == nr_blocks - 1 ? 0 : SEND_MORE); if (r == -1) { nbdkit_error ("write reply: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } } return false; } static bool send_structured_reply_error (uint64_t cookie, uint16_t cmd, uint16_t flags, uint32_t error) { GET_CONN; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); struct nbd_structured_reply reply; struct nbd_chunk_error error_data; int r; reply.magic = htobe32 (NBD_STRUCTURED_REPLY_MAGIC); reply.cookie = cookie; reply.flags = htobe16 (NBD_REPLY_FLAG_DONE); reply.type = htobe16 (NBD_REPLY_TYPE_ERROR); reply.length = htobe32 (0 /* no human readable error */ + sizeof error_data); r = conn->send (&reply, sizeof reply, SEND_MORE); if (r == -1) { nbdkit_error ("write error reply: %m"); return connection_set_status (STATUS_DEAD); } /* Send the error. */ error_data.error = htobe32 (nbd_errno (error, flags)); error_data.len = htobe16 (0); r = conn->send (&error_data, sizeof error_data, 0); if (r == -1) { nbdkit_error ("write data: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } /* No human readable error message at the moment. */ return false; } /* Do a recv/send sequence. Return true if the caller should shutdown. */ bool protocol_recv_request_send_reply (void) { GET_CONN; int r; conn_status cs; struct nbd_request request; uint16_t cmd, flags; uint32_t magic, count, error = 0; uint64_t offset; char *buf = NULL; CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents = NULL; /* Read the request packet. */ { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->read_lock); r = conn->recv (&request, sizeof request); cs = connection_get_status (); if (cs <= STATUS_CLIENT_DONE) return false; if (r == -1) { nbdkit_error ("read request: %m"); return connection_set_status (STATUS_DEAD); } if (r == 0) { debug ("client closed input socket, closing connection"); return connection_set_status (STATUS_CLIENT_DONE); /* disconnect */ } magic = be32toh (request.magic); if (magic != NBD_REQUEST_MAGIC) { nbdkit_error ("invalid request: 'magic' field is incorrect (0x%x)", magic); return connection_set_status (STATUS_DEAD); } flags = be16toh (request.flags); cmd = be16toh (request.type); offset = be64toh (request.offset); count = be32toh (request.count); if (cmd == NBD_CMD_DISC) { debug ("client sent %s, closing connection", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_CLIENT_DONE); /* disconnect */ } /* Validate the request. */ if (!validate_request (cmd, flags, offset, count, &error)) { if (cmd == NBD_CMD_WRITE && skip_over_write_buffer (conn->sockin, count) < 0) { return connection_set_status (STATUS_DEAD); } goto send_reply; } /* Get the data buffer used for either read or write requests. * This is a common per-thread data buffer, it must not be freed. */ if (cmd == NBD_CMD_READ || cmd == NBD_CMD_WRITE) { buf = threadlocal_buffer ((size_t) count); if (buf == NULL) { error = ENOMEM; if (cmd == NBD_CMD_WRITE && skip_over_write_buffer (conn->sockin, count) < 0) { return connection_set_status (STATUS_DEAD); } goto send_reply; } } /* Allocate the extents list for block status only. */ if (cmd == NBD_CMD_BLOCK_STATUS) { extents = nbdkit_extents_new (offset, backend_get_size (conn->top_context)); if (extents == NULL) { error = ENOMEM; goto send_reply; } } /* Receive the write data buffer. */ if (cmd == NBD_CMD_WRITE) { r = conn->recv (buf, count); if (r == 0) { errno = EBADMSG; r = -1; } if (r == -1) { nbdkit_error ("read data: %s: %m", name_of_nbd_cmd (cmd)); return connection_set_status (STATUS_DEAD); } } } /* Perform the request. Only this part happens inside the request lock. */ if (quit || cs < STATUS_ACTIVE) { error = ESHUTDOWN; } else { lock_request (); error = handle_request (cmd, flags, offset, count, buf, extents); assert ((int) error >= 0); unlock_request (); } /* Send the reply packet. */ send_reply: if (connection_get_status () < STATUS_CLIENT_DONE) return false; if (error != 0) { /* Since we're about to send only the limited NBD_E* errno to the * client, don't lose the information about what really happened * on the server side. Make sure there is a way for the operator * to retrieve the real error. */ debug ("sending error reply: %s", strerror (error)); } /* Currently we prefer to send simple replies for everything except * where we have to (ie. NBD_CMD_READ and NBD_CMD_BLOCK_STATUS when * structured_replies have been negotiated). However this prevents * us from sending human-readable error messages to the client, so * we should reconsider this in future. */ if (!conn->structured_replies || (cmd != NBD_CMD_READ && cmd != NBD_CMD_BLOCK_STATUS)) return send_simple_reply (request.cookie, cmd, flags, buf, count, error); if (error) return send_structured_reply_error (request.cookie, cmd, flags, error); if (cmd == NBD_CMD_READ) return send_structured_reply_read (request.cookie, cmd, buf, count, offset); /* NBD_CMD_BLOCK_STATUS */ return send_structured_reply_block_status (request.cookie, cmd, flags, count, offset, extents); } nbdkit-1.42.2/server/protocol-handshake.c0000644000175000017500000001123514676465664014025 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" #include "byte-swapping.h" #include "nbd-protocol.h" int protocol_handshake (void) { int r; lock_request (); if (!newstyle) r = protocol_handshake_oldstyle (); else r = protocol_handshake_newstyle (); unlock_request (); return r; } /* Common code used by oldstyle and newstyle protocols to: * * - call the backend .open method * * - get the export size * * - compute the eflags (same between oldstyle and newstyle * protocols) * * The protocols must defer this as late as possible so that * unauthorized clients can't cause unnecessary work in .open by * simply opening a TCP connection. */ int protocol_common_open (uint64_t *exportsize, uint16_t *flags, const char *exportname) { GET_CONN; int64_t size; uint16_t eflags = NBD_FLAG_HAS_FLAGS; int fl; conn->top_context = backend_open (top, read_only, exportname, false); if (conn->top_context == NULL) return -1; /* Prepare (for filters), called just after open. */ if (backend_prepare (conn->top_context) == -1) return -1; size = backend_get_size (conn->top_context); if (size == -1) return -1; if (size < 0) { nbdkit_error (".get_size function returned invalid value " "(%" PRIi64 ")", size); return -1; } /* Check all flags even if they won't be advertised, to prime the * cache and make later request validation easier. */ fl = backend_can_write (conn->top_context); if (fl == -1) return -1; if (!fl) eflags |= NBD_FLAG_READ_ONLY; fl = backend_can_zero (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_WRITE_ZEROES; fl = backend_can_fast_zero (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FAST_ZERO; fl = backend_can_trim (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_TRIM; fl = backend_can_fua (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FUA; fl = backend_can_flush (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FLUSH; fl = backend_is_rotational (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_ROTATIONAL; /* multi-conn is useless if parallel connections are not allowed. */ fl = backend_can_multi_conn (conn->top_context); if (fl == -1) return -1; if (fl && (thread_model > NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS)) eflags |= NBD_FLAG_CAN_MULTI_CONN; fl = backend_can_cache (conn->top_context); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_CACHE; /* The result of this is not directly advertised as part of the * handshake, but priming the cache here makes BLOCK_STATUS handling * not have to worry about errors, and makes test-layers easier to * write. */ fl = backend_can_extents (conn->top_context); if (fl == -1) return -1; if (conn->structured_replies) eflags |= NBD_FLAG_SEND_DF; *exportsize = size; *flags = eflags; return 0; } nbdkit-1.42.2/server/protocol-handshake-oldstyle.c0000644000175000017500000000510214534316443015635 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" #include "byte-swapping.h" #include "nbd-protocol.h" int protocol_handshake_oldstyle (void) { GET_CONN; struct nbd_old_handshake handshake; uint64_t exportsize; uint16_t gflags, eflags; assert (tls != 2); /* Already filtered in main */ /* With oldstyle, our only option if .open or friends fail is to * disconnect, as we cannot report the problem to the client. */ if (protocol_common_open (&exportsize, &eflags, "") == -1) return -1; gflags = 0; debug ("oldstyle negotiation: flags: global 0x%x export 0x%x", gflags, eflags); memset (&handshake, 0, sizeof handshake); handshake.nbdmagic = htobe64 (NBD_MAGIC); handshake.version = htobe64 (NBD_OLD_VERSION); handshake.exportsize = htobe64 (exportsize); handshake.gflags = htobe16 (gflags); handshake.eflags = htobe16 (eflags); if (conn->send (&handshake, sizeof handshake, 0) == -1) { nbdkit_error ("write: %m"); return -1; } return 0; } nbdkit-1.42.2/server/protocol-handshake-newstyle.c0000644000175000017500000010466614676465664015710 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" #include "byte-swapping.h" #include "nbd-protocol.h" #include "protostrings.h" #include "strndup.h" /* Initial bound of client options we allow before giving up. * However, a client that issues NBD_OPT_LIST is permitted to follow * up with another round of options per export listed. */ #define MAX_NR_OPTIONS 32 /* Receive newstyle options. */ static int send_newstyle_option_reply (uint32_t option, uint32_t reply) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; const char *last_error = NULL; uint32_t replylen = 0; if (NBD_REP_IS_ERR (reply)) { last_error = threadlocal_get_last_error (); /* Note that calling nbdkit_error will invalidate last_error, so * be careful below. */ if (last_error) { size_t len = strlen (last_error); if (len <= NBD_MAX_STRING) replylen = len; } } fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (replylen); debug ("replying to %s with %s", name_of_nbd_opt (option), name_of_nbd_rep (reply)); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, replylen > 0 ? SEND_MORE : 0) == -1) goto err; if (replylen > 0 && conn->send (last_error, replylen, 0) == -1) goto err; return 0; err: /* The protocol document says that the client is allowed to simply * drop the connection after sending NBD_OPT_ABORT, or may read * the reply. */ if (option == NBD_OPT_ABORT) debug ("write: %s: %m", name_of_nbd_opt (option)); else nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } /* Reply to NBD_OPT_LIST with the plugin's list of export names. */ static int send_newstyle_option_reply_exportnames (uint32_t option, size_t *nr_options) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; size_t i, list_len; CLEANUP_EXPORTS_FREE struct nbdkit_exports *exps = NULL; exps = nbdkit_exports_new (); if (exps == NULL) return send_newstyle_option_reply (option, NBD_REP_ERR_TOO_BIG); if (backend_list_exports (top, read_only, exps) == -1) return send_newstyle_option_reply (option, NBD_REP_ERR_PLATFORM); /* Allow additional per-export NBD_OPT_INFO and friends. */ list_len = nbdkit_exports_count (exps); *nr_options += MAX_NR_OPTIONS * list_len; for (i = 0; i < list_len; i++) { const struct nbdkit_export export = nbdkit_get_export (exps, i); size_t name_len = strlen (export.name); size_t desc_len = export.description ? strlen (export.description) : 0; uint32_t len; fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (NBD_REP_SERVER); fixed_new_option_reply.replylen = htobe32 (name_len + sizeof (len) + desc_len); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } len = htobe32 (name_len); if (conn->send (&len, sizeof len, SEND_MORE) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (option), "sending length"); return -1; } if (conn->send (export.name, name_len, SEND_MORE) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (option), "sending export name"); return -1; } if (conn->send (export.description, desc_len, 0) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (option), "sending export description"); return -1; } } return send_newstyle_option_reply (option, NBD_REP_ACK); } static int send_newstyle_option_reply_info_export (uint32_t option, uint32_t reply, uint16_t info, uint64_t exportsize) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; struct nbd_fixed_new_option_reply_info_export export; fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (sizeof export); export.info = htobe16 (info); export.exportsize = htobe64 (exportsize); export.eflags = htobe16 (conn->eflags); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1 || conn->send (&export, sizeof export, 0) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } return 0; } /* Can be used for NBD_INFO_NAME and NBD_INFO_DESCRIPTION. */ static int send_newstyle_option_reply_info_str (uint32_t option, uint32_t reply, uint16_t info, const char *str, size_t len) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; struct nbd_fixed_new_option_reply_info_name_or_desc name; if (len == -1) len = strlen (str); assert (len <= NBD_MAX_STRING); fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (sizeof info + len); name.info = htobe16 (info); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1 || conn->send (&name, sizeof name, SEND_MORE) == -1 || conn->send (str, len, 0) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } return 0; } /* Send reply containing NBD_INFO_BLOCK_SIZE. */ static int send_newstyle_option_reply_info_block_size (uint32_t option, uint32_t reply, uint16_t info, uint32_t minimum, uint32_t preferred, uint32_t maximum) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; struct nbd_fixed_new_option_reply_info_block_size block_size; fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (14); block_size.info = htobe16 (info); block_size.minimum = htobe32 (minimum); block_size.preferred = htobe32 (preferred); block_size.maximum = htobe32 (maximum); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1 || conn->send (&block_size, sizeof block_size, 0) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } return 0; } static int send_newstyle_option_reply_meta_context (uint32_t option, uint32_t reply, uint32_t context_id, const char *name) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; struct nbd_fixed_new_option_reply_meta_context context; const size_t namelen = strlen (name); debug ("newstyle negotiation: %s: replying with %s id %d", name_of_nbd_opt (option), name, context_id); fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); fixed_new_option_reply.option = htobe32 (option); fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (sizeof context + namelen); context.context_id = htobe32 (context_id); if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1 || conn->send (&context, sizeof context, SEND_MORE) == -1 || conn->send (name, namelen, 0) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } return 0; } /* Sub-function during negotiate_handshake_newstyle, to uniformly handle * a client hanging up on a message boundary. */ static int ATTRIBUTE_FORMAT_PRINTF (3, 4) conn_recv_full (void *buf, size_t len, const char *fmt, ...) { GET_CONN; int r = conn->recv (buf, len); va_list args; if (r == -1) { va_start (args, fmt); nbdkit_verror (fmt, args); va_end (args); return -1; } if (r == 0) { /* During negotiation, client EOF on message boundary is less * severe than failure in the middle of the buffer. */ debug ("client closed input socket, closing connection"); return -1; } return r; } /* Sub-function of negotiate_handshake_newstyle_options below. It * must be called on all non-error paths out of the options for-loop * in that function, and must not cause any wire traffic. */ static int finish_newstyle_options (uint64_t *exportsize, const char *exportname_in, uint32_t exportnamelen) { GET_CONN; /* Since the exportname string passed here comes directly out of the * NBD protocol make a temporary copy of the exportname into a * \0-terminated buffer. */ CLEANUP_FREE char *exportname = strndup (exportname_in, exportnamelen); if (exportname == NULL) { nbdkit_error ("strndup: %m"); return -1; } /* The NBD spec says that if the client later uses NBD_OPT_GO on a * different export, then the context from the earlier * NBD_OPT_SET_META_CONTEXT is not usable so discard it. */ if (conn->exportname_from_set_meta_context && strcmp (conn->exportname_from_set_meta_context, exportname) != 0) { debug ("newstyle negotiation: NBD_OPT_SET_META_CONTEXT export name \"%s\" " "≠ final client exportname \"%s\", " "so discarding the previous context", conn->exportname_from_set_meta_context, exportname); conn->meta_context_base_allocation = false; } if (protocol_common_open (exportsize, &conn->eflags, exportname) == -1) return -1; debug ("newstyle negotiation: flags: export 0x%x", conn->eflags); return 0; } /* Check that the string sent as part of @option, beginning at @buf, * and with a client-reported length of @len, fits within @maxlen * bytes and is well-formed. If not, report an error mentioning * @name. */ static int check_string (uint32_t option, char *buf, uint32_t len, uint32_t maxlen, const char *name) { if (len > NBD_MAX_STRING || len > maxlen) { nbdkit_error ("%s: %s too long", name_of_nbd_opt (option), name); return -1; } if (strnlen (buf, len) != len) { nbdkit_error ("%s: %s may not include NUL bytes", name_of_nbd_opt (option), name); return -1; } /* TODO: Check for valid UTF-8? */ return 0; } /* Sub-function of negotiate_handshake_newstyle_options, to grab and * validate an export name. */ static int check_export_name (uint32_t option, char *buf, uint32_t exportnamelen, uint32_t maxlen) { GET_CONN; if (check_string (option, buf, exportnamelen, maxlen, "export name") == -1) return -1; debug ("newstyle negotiation: %s: client requested export '%.*s'", name_of_nbd_opt (option), (int) exportnamelen, buf); return 0; } static int negotiate_handshake_newstyle_options (void) { GET_CONN; struct nbd_new_option new_option; size_t nr_options; bool list_seen = false; uint64_t version; uint32_t option; uint32_t optlen; struct nbd_export_name_option_reply handshake_finish; const char *optname; uint64_t exportsize; struct backend *b; for (nr_options = MAX_NR_OPTIONS; nr_options > 0; --nr_options) { CLEANUP_FREE char *data = NULL; if (conn_recv_full (&new_option, sizeof new_option, "reading option: conn->recv: %m") == -1) return -1; version = be64toh (new_option.version); if (version != NBD_NEW_VERSION) { nbdkit_error ("unknown option version %" PRIx64 ", expecting %" PRIx64, version, NBD_NEW_VERSION); return -1; } /* There is a maximum option length we will accept, regardless * of the option type. */ optlen = be32toh (new_option.optlen); if (optlen > MAX_REQUEST_SIZE) { nbdkit_error ("client option data too long (%" PRIu32 ")", optlen); return -1; } data = malloc (optlen + 1); /* Allowing a trailing NUL helps some uses */ if (data == NULL) { nbdkit_error ("malloc: %m"); return -1; } option = be32toh (new_option.option); optname = name_of_nbd_opt (option); /* If the client lacks fixed newstyle support, it should only send * NBD_OPT_EXPORT_NAME. */ if (!(conn->cflags & NBD_FLAG_FIXED_NEWSTYLE) && option != NBD_OPT_EXPORT_NAME) { if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID)) return -1; continue; } /* In --tls=require / FORCEDTLS mode the only options allowed * before TLS negotiation are NBD_OPT_ABORT and NBD_OPT_STARTTLS. */ if (tls == 2 && !conn->using_tls && !(option == NBD_OPT_ABORT || option == NBD_OPT_STARTTLS)) { if (option == NBD_OPT_EXPORT_NAME) { debug ("newstyle negotiation: can't reply NBD_REP_ERR_TLS_REQD to %s", name_of_nbd_opt (option)); return -1; } if (send_newstyle_option_reply (option, NBD_REP_ERR_TLS_REQD)) return -1; if (conn_recv_full (data, optlen, "waiting for starttls: %m") == -1) return -1; continue; } switch (option) { case NBD_OPT_EXPORT_NAME: if (conn_recv_full (data, optlen, "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; if (check_export_name (option, data, optlen, optlen) == -1) return -1; /* We have to finish the handshake by sending handshake_finish. * On failure, we have to disconnect. */ if (finish_newstyle_options (&exportsize, data, optlen) == -1) return -1; memset (&handshake_finish, 0, sizeof handshake_finish); handshake_finish.exportsize = htobe64 (exportsize); handshake_finish.eflags = htobe16 (conn->eflags); if (conn->send (&handshake_finish, (conn->cflags & NBD_FLAG_NO_ZEROES) ? offsetof (struct nbd_export_name_option_reply, zeroes) : sizeof handshake_finish, 0) == -1) { nbdkit_error ("write: %s: %m", optname); return -1; } break; case NBD_OPT_ABORT: if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; debug ("client sent %s to abort the connection", name_of_nbd_opt (option)); return -1; case NBD_OPT_LIST: if (optlen != 0) { debug ("ignoring request, client sent unexpected payload: %s", name_of_nbd_opt (option)); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; if (conn_recv_full (data, optlen, "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; continue; } if (list_seen) { debug ("newstyle negotiation: %s: export list already advertised", name_of_nbd_opt (option)); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } else { /* Send back the exportname list. */ debug ("newstyle negotiation: %s: advertising exports", name_of_nbd_opt (option)); if (send_newstyle_option_reply_exportnames (option, &nr_options) == -1) return -1; list_seen = true; } break; case NBD_OPT_STARTTLS: if (optlen != 0) { debug ("ignoring request, client sent unexpected payload: %s", name_of_nbd_opt (option)); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; if (conn_recv_full (data, optlen, "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; continue; } if (tls == 0) { /* --tls=off (NOTLS mode). */ #ifdef HAVE_GNUTLS #define NO_TLS_REPLY NBD_REP_ERR_POLICY #else #define NO_TLS_REPLY NBD_REP_ERR_UNSUP #endif if (send_newstyle_option_reply (option, NO_TLS_REPLY) == -1) return -1; } else /* --tls=on or --tls=require */ { /* We can't upgrade to TLS twice on the same connection. */ if (conn->using_tls) { if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } /* We have to send the (unencrypted) reply before starting * the handshake. */ if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; /* Upgrade the connection to TLS. Also performs access control. */ if (crypto_negotiate_tls (conn->sockin, conn->sockout) == -1) return -1; conn->using_tls = true; debug ("using TLS on this connection"); /* Wipe out any cached state. */ conn->structured_replies = false; free (conn->exportname_from_set_meta_context); conn->exportname_from_set_meta_context = NULL; conn->meta_context_base_allocation = false; for_each_backend (b) { free (conn->default_exportname[b->i]); conn->default_exportname[b->i] = NULL; } } break; case NBD_OPT_INFO: case NBD_OPT_GO: if (conn_recv_full (data, optlen, "read: %s: %m", optname) == -1) return -1; if (optlen < 6) { /* 32 bit export length + 16 bit nr info */ debug ("newstyle negotiation: %s option length < 6", optname); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } { uint32_t exportnamelen; uint16_t nrinfos; uint16_t info; size_t i; /* Validate the name length and number of INFO requests. */ memcpy (&exportnamelen, &data[0], 4); exportnamelen = be32toh (exportnamelen); if (exportnamelen > optlen-6 /* NB optlen >= 6, see above */) { debug ("newstyle negotiation: %s: export name too long", optname); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } memcpy (&nrinfos, &data[exportnamelen+4], 2); nrinfos = be16toh (nrinfos); if (optlen != 4 + exportnamelen + 2 + 2*nrinfos) { debug ("newstyle negotiation: %s: " "number of information requests incorrect", optname); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } /* As with NBD_OPT_EXPORT_NAME we print the export name and * save it in the connection. If an earlier * NBD_OPT_SET_META_CONTEXT used an export name, it must match * or else we drop the support for that context. */ if (check_export_name (option, &data[4], exportnamelen, optlen - 6) == -1) { if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } /* The spec is confusing, but it is required that we send back * NBD_INFO_EXPORT, even if the client did not request it! * qemu client in particular does not request this, but will * fail if we don't send it. Note that if .open fails, but we * succeed at .close, then we merely return an error to the * client and let them try another NBD_OPT, rather than * disconnecting. */ if (finish_newstyle_options (&exportsize, &data[4], exportnamelen) == -1) { if (conn->top_context) { if (backend_finalize (conn->top_context) == -1) return -1; backend_close (conn->top_context); conn->top_context = NULL; } if (send_newstyle_option_reply (option, NBD_REP_ERR_UNKNOWN) == -1) return -1; continue; } assert (conn->top_context); if (send_newstyle_option_reply_info_export (option, NBD_REP_INFO, NBD_INFO_EXPORT, exportsize) == -1) return -1; /* For now we send NBD_INFO_NAME, NBD_INFO_DESCRIPTION and * NBD_INFO_BLOCK_SIZE if requested, and ignore all other info * requests (including NBD_INFO_EXPORT if it was requested, * because we replied already above). */ for (i = 0; i < nrinfos; ++i) { memcpy (&info, &data[4 + exportnamelen + 2 + i*2], 2); info = be16toh (info); switch (info) { case NBD_INFO_EXPORT: /* ignore - reply sent above */ break; case NBD_INFO_NAME: { const char *name = &data[4]; size_t namelen = exportnamelen; if (exportnamelen == 0) { name = backend_default_export (top, read_only); if (!name) { debug ("newstyle negotiation: %s: " "NBD_INFO_NAME: no name to send", optname); break; } namelen = -1; } if (send_newstyle_option_reply_info_str (option, NBD_REP_INFO, NBD_INFO_NAME, name, namelen) == -1) return -1; } break; case NBD_INFO_DESCRIPTION: { const char *desc = backend_export_description (conn->top_context); if (!desc) { debug ("newstyle negotiation: %s: " "NBD_INFO_DESCRIPTION: no description to send", optname); break; } if (send_newstyle_option_reply_info_str (option, NBD_REP_INFO, NBD_INFO_DESCRIPTION, desc, -1) == -1) return -1; } break; case NBD_INFO_BLOCK_SIZE: { uint32_t minimum, preferred, maximum; if (backend_block_size (conn->top_context, &minimum, &preferred, &maximum) == -1) return -1; if (minimum == 0) { debug ("newstyle negotiation: %s: " "NBD_INFO_BLOCK_SIZE: client requested but " "no plugin or filter provided block size information, " "ignoring client request", optname); break; } if (send_newstyle_option_reply_info_block_size (option, NBD_REP_INFO, NBD_INFO_BLOCK_SIZE, minimum, preferred, maximum) == -1) return -1; } break; default: debug ("newstyle negotiation: %s: " "ignoring NBD_INFO_* request %u (%s)", optname, (unsigned) info, name_of_nbd_info (info)); break; } } } /* Unlike NBD_OPT_EXPORT_NAME, NBD_OPT_GO sends back an ACK * or ERROR packet. If this was NBD_OPT_LIST, call .close. */ if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; if (option == NBD_OPT_INFO) { if (backend_finalize (conn->top_context) == -1) return -1; backend_close (conn->top_context); conn->top_context = NULL; } break; case NBD_OPT_STRUCTURED_REPLY: if (optlen != 0) { debug ("ignoring request, client sent unexpected payload: %s", name_of_nbd_opt (option)); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; if (conn_recv_full (data, optlen, "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; continue; } debug ("newstyle negotiation: %s: client requested structured replies", name_of_nbd_opt (option)); if (no_sr) { /* Must fail with ERR_UNSUP for qemu 4.2 to remain happy; * but failing with ERR_POLICY would have been nicer. */ if (send_newstyle_option_reply (option, NBD_REP_ERR_UNSUP) == -1) return -1; debug ("newstyle negotiation: %s: structured replies are disabled", name_of_nbd_opt (option)); break; } if (conn->structured_replies) { if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; debug ("newstyle negotiation: %s: structured replies already in use", name_of_nbd_opt (option)); break; } if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; conn->structured_replies = true; break; case NBD_OPT_LIST_META_CONTEXT: case NBD_OPT_SET_META_CONTEXT: { uint32_t opt_index; uint32_t exportnamelen; uint32_t nr_queries; uint32_t querylen; const char *what; if (conn_recv_full (data, optlen, "read: %s: %m", optname) == -1) return -1; if (no_mc) { if (send_newstyle_option_reply (option, NBD_REP_ERR_UNSUP) == -1) return -1; continue; } /* Note that we support base:allocation whether or not the plugin * supports can_extents. */ if (option == NBD_OPT_SET_META_CONTEXT && !conn->structured_replies) { if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } /* Minimum length of the option payload is: * 32 bit export name length followed by empty export name * + 32 bit number of queries followed by no queries * = 8 bytes. */ what = "optlen < 8"; if (optlen < 8) { opt_meta_invalid_option_len: debug ("newstyle negotiation: %s: invalid option length: %s", optname, what); if (send_newstyle_option_reply (option, NBD_REP_ERR_INVALID) == -1) return -1; continue; } memcpy (&exportnamelen, &data[0], 4); exportnamelen = be32toh (exportnamelen); what = "validating export name"; if (check_export_name (option, &data[4], exportnamelen, optlen - 8) == -1) goto opt_meta_invalid_option_len; /* Remember the export name: the NBD spec says that if the client * later uses NBD_OPT_GO on a different export, then the context * returned here is not usable. */ if (option == NBD_OPT_SET_META_CONTEXT) { conn->exportname_from_set_meta_context = strndup (&data[4], exportnamelen); if (conn->exportname_from_set_meta_context == NULL) { nbdkit_error ("malloc: %m"); return -1; } } opt_index = 4 + exportnamelen; /* Read the number of queries. */ what = "reading number of queries"; if (opt_index+4 > optlen) goto opt_meta_invalid_option_len; memcpy (&nr_queries, &data[opt_index], 4); nr_queries = be32toh (nr_queries); opt_index += 4; /* for LIST: nr_queries == 0 means return all meta contexts * for SET: nr_queries == 0 means reset all contexts */ debug ("newstyle negotiation: %s: %s count: %d", optname, option == NBD_OPT_LIST_META_CONTEXT ? "query" : "set", nr_queries); if (option == NBD_OPT_SET_META_CONTEXT) conn->meta_context_base_allocation = false; if (nr_queries == 0) { if (option == NBD_OPT_LIST_META_CONTEXT) { if (send_newstyle_option_reply_meta_context (option, NBD_REP_META_CONTEXT, 0, "base:allocation") == -1) return -1; } if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; } else { /* Read and answer each query. */ while (nr_queries > 0) { what = "reading query string length"; if (opt_index+4 > optlen) goto opt_meta_invalid_option_len; memcpy (&querylen, &data[opt_index], 4); querylen = be32toh (querylen); opt_index += 4; what = "reading query string"; if (check_string (option, &data[opt_index], querylen, optlen - opt_index, "meta context query") == -1) goto opt_meta_invalid_option_len; debug ("newstyle negotiation: %s: %s %.*s", optname, option == NBD_OPT_LIST_META_CONTEXT ? "query" : "set", (int) querylen, &data[opt_index]); /* For LIST, "base:" returns all supported contexts in the * base namespace. We only support "base:allocation". */ if (option == NBD_OPT_LIST_META_CONTEXT && querylen == 5 && strncmp (&data[opt_index], "base:", 5) == 0) { if (send_newstyle_option_reply_meta_context (option, NBD_REP_META_CONTEXT, 0, "base:allocation") == -1) return -1; } /* "base:allocation" requested by name. */ else if (querylen == 15 && strncmp (&data[opt_index], "base:allocation", 15) == 0) { if (send_newstyle_option_reply_meta_context (option, NBD_REP_META_CONTEXT, option == NBD_OPT_SET_META_CONTEXT ? base_allocation_id : 0, "base:allocation") == -1) return -1; if (option == NBD_OPT_SET_META_CONTEXT) conn->meta_context_base_allocation = true; } /* Every other query must be ignored. */ opt_index += querylen; nr_queries--; } if (send_newstyle_option_reply (option, NBD_REP_ACK) == -1) return -1; } debug ("newstyle negotiation: %s: reply complete", optname); } break; default: /* Unknown option. */ if (send_newstyle_option_reply (option, NBD_REP_ERR_UNSUP) == -1) return -1; if (conn_recv_full (data, optlen, "reading unknown option data: conn->recv: %m") == -1) return -1; } /* Note, since it's not very clear from the protocol doc, that the * client must send NBD_OPT_EXPORT_NAME or NBD_OPT_GO last, and * that ends option negotiation. */ if (option == NBD_OPT_EXPORT_NAME || option == NBD_OPT_GO) break; } if (nr_options == 0) { nbdkit_error ("client spent too much time negotiating without selecting " "an export"); return -1; } /* In --tls=require / FORCEDTLS mode, we must have upgraded to TLS * by the time we finish option negotiation. If not, give up. */ if (tls == 2 && !conn->using_tls) { nbdkit_error ("non-TLS client tried to connect in --tls=require mode"); return -1; } return 0; } int protocol_handshake_newstyle (void) { GET_CONN; struct nbd_new_handshake handshake; uint16_t gflags; gflags = (NBD_FLAG_FIXED_NEWSTYLE | NBD_FLAG_NO_ZEROES) & mask_handshake; debug ("newstyle negotiation: flags: global 0x%x", gflags); handshake.nbdmagic = htobe64 (NBD_MAGIC); handshake.version = htobe64 (NBD_NEW_VERSION); handshake.gflags = htobe16 (gflags); if (conn->send (&handshake, sizeof handshake, 0) == -1) { nbdkit_error ("write: %s: %m", "sending newstyle handshake"); return -1; } /* Client now sends us its 32 bit flags word ... */ if (conn_recv_full (&conn->cflags, sizeof conn->cflags, "reading initial client flags: conn->recv: %m") == -1) return -1; conn->cflags = be32toh (conn->cflags); /* ... which we check for accuracy. */ debug ("newstyle negotiation: client flags: 0x%x", conn->cflags); if (conn->cflags & ~gflags) { nbdkit_error ("client requested unexpected flags 0x%x", conn->cflags); return -1; } /* Receive newstyle options. */ if (negotiate_handshake_newstyle_options () == -1) return -1; return 0; } nbdkit-1.42.2/server/public.c0000644000175000017500000007024314676465664011522 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* This file contains the public utility APIs to be exported by nbdkit * for use by filters and plugins, declared in nbdkit-common.h. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_TERMIOS_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UCRED_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #ifdef WIN32 /* For nanosleep on Windows. */ #include #endif #include "array-size.h" #include "ascii-ctype.h" #include "ascii-string.h" #include "get_current_dir_name.h" #include "getline.h" #include "human-size.h" #include "poll.h" #include "realpath.h" #include "strndup.h" #include "internal.h" #ifndef WIN32 NBDKIT_DLL_PUBLIC char * nbdkit_absolute_path (const char *path) { CLEANUP_FREE char *pwd = NULL; char *ret; if (path == NULL || *path == '\0') { nbdkit_error ("cannot convert null or empty path to an absolute path"); return NULL; } if (*path == '/') { ret = strdup (path); if (!ret) { nbdkit_error ("strdup: %m"); return NULL; } return ret; } pwd = get_current_dir_name (); if (pwd == NULL) { nbdkit_error ("get_current_dir_name: %m"); return NULL; } if (asprintf (&ret, "%s" DIR_SEPARATOR_STR "%s", pwd, path) == -1) { nbdkit_error ("asprintf: %m"); return NULL; } return ret; } #else /* WIN32 */ /* On Windows realpath() is replaced by GetFullPathName which doesn't * bother to check if the final path exists. Therefore we can simply * replace nbdkit_absolute_path with nbdkit_realpath and everything * should work the same. */ NBDKIT_DLL_PUBLIC char * nbdkit_absolute_path (const char *path) { return nbdkit_realpath (path); } #endif /* WIN32 */ NBDKIT_DLL_PUBLIC char * nbdkit_realpath (const char *path) { char *ret; if (path == NULL || *path == '\0') { nbdkit_error ("cannot resolve a null or empty path"); return NULL; } ret = realpath (path, NULL); if (ret == NULL) { nbdkit_error ("realpath: %s: %m", path); return NULL; } return ret; } /* Common code for parsing integers. */ #define PARSE_COMMON_TAIL \ if (errno != 0) { \ nbdkit_error ("%s: could not parse number: \"%s\": %m", \ what, str); \ return -1; \ } \ if (end == str) { \ nbdkit_error ("%s: empty string where we expected a number", \ what); \ return -1; \ } \ if (*end) { \ nbdkit_error ("%s: could not parse number: \"%s\": trailing garbage", \ what, str); \ return -1; \ } \ \ if (rp) \ *rp = r; \ return 0 /* Functions for parsing signed integers. */ NBDKIT_DLL_PUBLIC int nbdkit_parse_int (const char *what, const char *str, int *rp) { long r; char *end; errno = 0; r = strtol (str, &end, 0); #if INT_MAX != LONG_MAX if (r < INT_MIN || r > INT_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_int8_t (const char *what, const char *str, int8_t *rp) { long r; char *end; errno = 0; r = strtol (str, &end, 0); if (r < INT8_MIN || r > INT8_MAX) errno = ERANGE; PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp) { long r; char *end; errno = 0; r = strtol (str, &end, 0); if (r < INT16_MIN || r > INT16_MAX) errno = ERANGE; PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_int32_t (const char *what, const char *str, int32_t *rp) { long r; char *end; errno = 0; r = strtol (str, &end, 0); #if INT32_MAX != LONG_MAX if (r < INT32_MIN || r > INT32_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp) { long long r; char *end; errno = 0; r = strtoll (str, &end, 0); #if INT64_MAX != LONGLONG_MAX if (r < INT64_MIN || r > INT64_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } /* Functions for parsing unsigned integers. */ /* strtou* functions have surprising behaviour if the first character * (after whitespace) is '-', so reject this early. */ #define PARSE_ERROR_IF_NEGATIVE \ do { \ while (ascii_isspace (*str)) \ str++; \ if (*str == '-') { \ nbdkit_error ("%s: negative numbers are not allowed", what); \ return -1; \ } \ } while (0) NBDKIT_DLL_PUBLIC int nbdkit_parse_unsigned (const char *what, const char *str, unsigned *rp) { unsigned long r; char *end; PARSE_ERROR_IF_NEGATIVE; errno = 0; r = strtoul (str, &end, 0); #if UINT_MAX != ULONG_MAX if (r > UINT_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_uint8_t (const char *what, const char *str, uint8_t *rp) { unsigned long r; char *end; PARSE_ERROR_IF_NEGATIVE; errno = 0; r = strtoul (str, &end, 0); if (r > UINT8_MAX) errno = ERANGE; PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_uint16_t (const char *what, const char *str, uint16_t *rp) { unsigned long r; char *end; PARSE_ERROR_IF_NEGATIVE; errno = 0; r = strtoul (str, &end, 0); if (r > UINT16_MAX) errno = ERANGE; PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_uint32_t (const char *what, const char *str, uint32_t *rp) { unsigned long r; char *end; PARSE_ERROR_IF_NEGATIVE; errno = 0; r = strtoul (str, &end, 0); #if UINT32_MAX != ULONG_MAX if (r > UINT32_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } NBDKIT_DLL_PUBLIC int nbdkit_parse_uint64_t (const char *what, const char *str, uint64_t *rp) { unsigned long long r; char *end; PARSE_ERROR_IF_NEGATIVE; errno = 0; r = strtoull (str, &end, 0); #if UINT64_MAX != ULONGLONG_MAX if (r > UINT64_MAX) errno = ERANGE; #endif PARSE_COMMON_TAIL; } /* Parse a string as a size with possible scaling suffix, or return -1 * after reporting the error. */ NBDKIT_DLL_PUBLIC int64_t nbdkit_parse_size (const char *str) { const char *error = NULL, *pstr = NULL; int64_t size; size = human_size_parse (str, &error, &pstr); if (size == -1) { nbdkit_error ("%s: %s", error, pstr); return -1; } return size; } NBDKIT_DLL_PUBLIC int nbdkit_parse_probability (const char *what, const char *str, double *retp) { double d, d2; char c; int n; if (sscanf (str, "%lg%[:/]%lg%n", &d, &c, &d2, &n) == 3 && strcmp (&str[n], "") == 0) { /* N:M or N/M */ if (d == 0.0 && d2 == 0.0) /* 0/0 is OK */ ; else if (d2 == 0) /* N/0 is bad */ goto bad_parse; else d /= d2; } else if (sscanf (str, "%lg%n", &d, &n) == 1) { if (strcmp (&str[n], "%") == 0) /* percentage */ d /= 100.0; else if (strcmp (&str[n], "") == 0) /* probability */ ; else goto bad_parse; } else goto bad_parse; if (!isfinite (d)) /* reject NaN or inf */ goto bad_parse; if (signbit (d)) /* reject negative numbers */ goto bad_parse; if (retp) *retp = d; return 0; bad_parse: nbdkit_error ("%s: could not parse '%s' as a probability", what, str); return -1; } /* Parse a string as a boolean, or return -1 after reporting the error. */ NBDKIT_DLL_PUBLIC int nbdkit_parse_bool (const char *str) { if (!strcmp (str, "1") || !ascii_strcasecmp (str, "true") || !ascii_strcasecmp (str, "t") || !ascii_strcasecmp (str, "yes") || !ascii_strcasecmp (str, "y") || !ascii_strcasecmp (str, "on")) return 1; if (!strcmp (str, "0") || !ascii_strcasecmp (str, "false") || !ascii_strcasecmp (str, "f") || !ascii_strcasecmp (str, "no") || !ascii_strcasecmp (str, "n") || !ascii_strcasecmp (str, "off")) return 0; nbdkit_error ("could not decipher boolean (%s)", str); return -1; } /* Parse a delay or sleep. */ NBDKIT_DLL_PUBLIC int nbdkit_parse_delay (const char *what, const char *str, unsigned *rsec, unsigned *rnsec) { double d; int n; if (sscanf (str, "%lg%n", &d, &n) == 1) { if (strcmp (&str[n], "s") == 0 || strcmp (&str[n], "") == 0) { /* Seconds. */ } else if (strcmp (&str[n], "ms") == 0) { /* Milliseconds. */ d /= 1000; } else if (strcmp (&str[n], "us") == 0 || strcmp (&str[n], "μs") == 0) { /* Microseconds. */ d /= 1000000; } else if (strcmp (&str[n], "ns") == 0) { /* Nanoseconds. */ d /= 1000000000; } else goto bad_parse; } else { bad_parse: nbdkit_error ("%s: could not parse delay or sleep: \"%s\"", what, str); return -1; } if (!isfinite (d)) /* reject NaN or inf */ goto bad_parse; if (signbit (d)) /* reject negative numbers */ goto bad_parse; if (rsec) *rsec = d; if (rnsec) *rnsec = (d - *rsec) * 1000000000.; return 0; } /* Return true if it is safe to read from stdin during configuration. */ NBDKIT_DLL_PUBLIC int nbdkit_stdio_safe (void) { return !listen_stdin && !configured; } /* Read a password from configuration value. */ static int read_password_interactive (char **password); static int read_password_from_fd (const char *what, int fd, char **password); NBDKIT_DLL_PUBLIC int nbdkit_read_password (const char *value, char **password) { *password = NULL; /* Read from stdin interactively. */ if (strcmp (value, "-") == 0) { if (read_password_interactive (password) == -1) return -1; } /* Read from numbered file descriptor. */ else if (value[0] == '-') { #ifndef WIN32 int fd; if (nbdkit_parse_int ("password file descriptor", &value[1], &fd) == -1) return -1; if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) { nbdkit_error ("cannot use password -FD for stdin/stdout/stderr"); return -1; } if (read_password_from_fd (&value[1], fd, password) == -1) return -1; #else /* WIN32 */ /* As far as I know this will never be possible on Windows, so * it's a simple error. */ nbdkit_error ("not possible to read passwords from file descriptors " "under Windows"); return -1; #endif /* WIN32 */ } /* Read password from a file. */ else if (value[0] == '+') { int fd; fd = open (&value[1], O_RDONLY | O_CLOEXEC); if (fd == -1) { nbdkit_error ("open %s: %m", &value[1]); return -1; } if (read_password_from_fd (&value[1], fd, password) == -1) return -1; } /* Parameter is the password. */ else { *password = strdup (value); if (*password == NULL) { nbdkit_error ("strdup: %m"); return -1; } } return 0; } #ifndef WIN32 typedef struct termios echo_mode; static void echo_off (echo_mode *old_mode) { struct termios temp; tcgetattr (STDIN_FILENO, old_mode); temp = *old_mode; temp.c_lflag &= ~ECHO; tcsetattr (STDIN_FILENO, TCSAFLUSH, &temp); } static void echo_restore (const echo_mode *old_mode) { tcsetattr (STDIN_FILENO, TCSAFLUSH, old_mode); } #else /* WIN32 */ /* Windows implementation of tty echo off based on this: * https://stackoverflow.com/a/1455007 */ typedef DWORD echo_mode; static void echo_off (echo_mode *old_mode) { HANDLE h_stdin; DWORD mode; h_stdin = GetStdHandle (STD_INPUT_HANDLE); GetConsoleMode (h_stdin, old_mode); mode = *old_mode; mode &= ~ENABLE_ECHO_INPUT; SetConsoleMode (h_stdin, mode); } static void echo_restore (const echo_mode *old_mode) { HANDLE h_stdin; h_stdin = GetStdHandle (STD_INPUT_HANDLE); SetConsoleMode (h_stdin, *old_mode); } #endif /* WIN32 */ static int read_password_interactive (char **password) { int err; echo_mode orig; ssize_t r; size_t n; if (!nbdkit_stdio_safe ()) { nbdkit_error ("stdin is not available for reading password"); return -1; } if (!isatty (STDIN_FILENO)) { nbdkit_error ("stdin is not a tty, cannot read password interactively"); return -1; } printf ("password: "); /* Set no echo. */ echo_off (&orig); /* To distinguish between error and EOF we have to check errno. * getline can return -1 and errno = 0 which means we got end of * file, which is simply a zero length password. */ errno = 0; r = getline (password, &n, stdin); err = errno; /* Restore echo. */ echo_restore (&orig); /* Complete the printf above. */ printf ("\n"); if (r == -1) { if (err == 0) { /* EOF, not an error. */ free (*password); /* State of linebuf is undefined. */ *password = strdup (""); if (*password == NULL) { nbdkit_error ("strdup: %m"); return -1; } } else { errno = err; nbdkit_error ("could not read password from stdin: %m"); return -1; } } if (*password && r > 0 && (*password)[r-1] == '\n') (*password)[r-1] = '\0'; return 0; } static int read_password_from_fd (const char *what, int fd, char **password) { FILE *fp; size_t n; ssize_t r; int err; fp = fdopen (fd, "r"); if (fp == NULL) { nbdkit_error ("fdopen %s: %m", what); close (fd); return -1; } /* To distinguish between error and EOF we have to check errno. * getline can return -1 and errno = 0 which means we got end of * file, which is simply a zero length password. */ errno = 0; r = getline (password, &n, fp); err = errno; fclose (fp); if (r == -1) { if (err == 0) { /* EOF, not an error. */ free (*password); /* State of linebuf is undefined. */ *password = strdup (""); if (*password == NULL) { nbdkit_error ("strdup: %m"); return -1; } } else { errno = err; nbdkit_error ("could not read password from %s: %m", what); return -1; } } if (*password && r > 0 && (*password)[r-1] == '\n') (*password)[r-1] = '\0'; return 0; } NBDKIT_DLL_PUBLIC int nbdkit_nanosleep (unsigned sec, unsigned nsec) { struct timespec ts; if (sec >= INT_MAX - nsec / 1000000000) { nbdkit_error ("sleep request is too long"); errno = EINVAL; return -1; } ts.tv_sec = sec + nsec / 1000000000; ts.tv_nsec = nsec % 1000000000; #if defined HAVE_PPOLL && defined POLLRDHUP /* End the sleep early if any of these happen: * - nbdkit has received a signal to shut down the server * - the current connection is multi-threaded and another thread detects * NBD_CMD_DISC or a problem with the connection * - the input socket detects POLLRDHUP/POLLHUP/POLLERR * - the input socket is invalid (POLLNVAL, probably closed by * another thread) */ struct connection *conn = threadlocal_get_conn (); struct pollfd fds[] = { [0].fd = quit_fd, [0].events = POLLIN, [1].fd = conn ? conn->status_pipe[0] : -1, [1].events = POLLIN, [2].fd = conn ? conn->sockin : -1, [2].events = POLLRDHUP, }; sigset_t all; /* Block all signals to this thread during the poll, so we don't * have to worry about EINTR */ if (sigfillset (&all)) abort (); switch (ppoll (fds, ARRAY_SIZE (fds), &ts, &all)) { case -1: assert (errno != EINTR); nbdkit_error ("poll: %m"); return -1; case 0: return 0; } /* We don't have to read the pipe-to-self; if poll returned an * event, we know the connection should be shutting down. */ bool has_quit = quit; assert (has_quit || (conn && conn->nworkers > 0 && connection_get_status () < STATUS_SHUTDOWN) || (conn && (fds[2].revents & (POLLRDHUP | POLLHUP | POLLERR | POLLNVAL)))); if (has_quit) nbdkit_error ("aborting sleep because of server shut down"); else nbdkit_error ("aborting sleep because of connection close or error"); errno = ESHUTDOWN; return -1; #else /* The fallback path simply calls ordinary nanosleep, and will * cause long delays on server shutdown. * * If however you want to port this to your platform, then * porting ideas, in order of preference: * - POSIX requires pselect; it's a bit clunkier to set up than poll, * but the same ability to atomically mask all signals and operate * on struct timespec makes it similar to the preferred ppoll interface * - calculate an end time target, then use poll in a loop on EINTR with * a recalculation of the timeout to still reach the end time (masking * signals in that case is not safe, as it is a non-atomic race) */ int r; r = nanosleep (&ts, NULL); if (r == -1 && errno != EINTR && errno != EAGAIN) { nbdkit_error ("nanosleep: %m"); return -1; } return 0; #endif } /* This function will be deprecated for API V3 users. The preferred * approach will be to get the exportname from .open(). */ NBDKIT_DLL_PUBLIC const char * nbdkit_export_name (void) { struct context *c = threadlocal_get_context (); if (!c || !c->conn) { nbdkit_error ("no connection in this thread"); return NULL; } return c->conn->exportname; } /* This function will be deprecated for API V3 users. The preferred * approach will be to get the tls mode from .open(). */ NBDKIT_DLL_PUBLIC int nbdkit_is_tls (void) { struct context *c = threadlocal_get_context (); if (!c) { nbdkit_error ("no connection in this thread"); return -1; } if (!c->conn) { /* If a filter opened this backend outside of a client connection, * then we can only claim tls when the command line required it. */ return tls == 2; } return c->conn->using_tls; } NBDKIT_DLL_PUBLIC int nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen) { struct connection *conn = threadlocal_get_conn (); int s; if (!conn) { nbdkit_error ("no connection in this thread"); return -1; } s = conn->sockin; if (s == -1) { nbdkit_error ("socket not open"); return -1; } if (getpeername (s, addr, addrlen) == -1) { nbdkit_error ("peername: %m"); return -1; } return 0; } #if defined (SO_PEERCRED) && \ (defined (HAVE_STRUCT_UCRED_UID) || defined (HAVE_STRUCT_SOCKPEERCRED_UID)) #define GET_PEERCRED_DEFINED 1 static int get_peercred (int s, int64_t *pid, int64_t *uid, int64_t *gid) { #if HAVE_STRUCT_UCRED_UID struct ucred cred; #elif HAVE_STRUCT_SOCKPEERCRED_UID /* The struct has a different name on OpenBSD, but the same members. */ struct sockpeercred cred; #endif socklen_t n = sizeof cred; if (getsockopt (s, SOL_SOCKET, SO_PEERCRED, &cred, &n) == -1) { nbdkit_error ("getsockopt: SO_PEERCRED: %m"); return -1; } if (pid && cred.pid >= 1) { #if SIZEOF_PID_T >= 8 if (cred.pid > INT64_MAX) nbdkit_error ("pid out of range: cannot be mapped to int64_t"); else #endif *pid = cred.pid; } if (uid && cred.uid >= 0) { #if SIZEOF_UID_T >= 8 if (cred.uid > INT64_MAX) nbdkit_error ("uid out of range: cannot be mapped to int64_t"); else #endif *uid = cred.uid; } if (gid && cred.gid >= 0) { #if SIZEOF_GID_T >= 8 if (cred.gid > INT64_MAX) nbdkit_error ("gid out of range: cannot be mapped to int64_t"); else #endif *gid = cred.gid; } return 0; } #endif /* SO_PEERCRED */ #ifdef LOCAL_PEERCRED #define GET_PEERCRED_DEFINED 1 /* FreeBSD supports LOCAL_PEERCRED and struct xucred. */ static int get_peercred (int s, int64_t *pid, int64_t *uid, int64_t *gid) { struct xucred xucred; socklen_t n = sizeof xucred; if (getsockopt (s, 0, LOCAL_PEERCRED, &xucred, &n) == -1) { nbdkit_error ("getsockopt: LOCAL_PEERCRED: %m"); return -1; } if (xucred.cr_version != XUCRED_VERSION) { nbdkit_error ("getsockopt: LOCAL_PEERCRED: " "struct xucred version (%u) " "did not match expected version (%u)", xucred.cr_version, XUCRED_VERSION); return -1; } if (n != sizeof xucred) { nbdkit_error ("getsockopt: LOCAL_PEERCRED: did not return full struct"); return -1; } if (pid) nbdkit_error ("nbdkit_peer_pid is not supported on this platform"); if (uid && xucred.cr_uid >= 0) { #if SIZEOF_UID_T >= 8 if (xucred.cr_uid <= INT64_MAX) #endif *uid = xucred.cr_uid; #if SIZEOF_UID_T >= 8 else nbdkit_error ("uid out of range: cannot be mapped to int64_t"); #endif } if (gid && xucred.cr_ngroups > 0) { #if SIZEOF_GID_T >= 8 if (xucred.cr_gid <= INT64_MAX) #endif *gid = xucred.cr_gid; #if SIZEOF_GID_T >= 8 else nbdkit_error ("gid out of range: cannot be mapped to int64_t"); #endif } return 0; } #endif /* LOCAL_PEERCRED */ #ifndef GET_PEERCRED_DEFINED static int get_peercred (int s, int64_t *pid, int64_t *uid, int64_t *gid) { nbdkit_error ("nbdkit_peer_pid, nbdkit_peer_uid and nbdkit_peer_gid " "are not supported on this platform"); return -1; } #endif static int get_peercred_common (int64_t *pid, int64_t *uid, int64_t *gid) { struct connection *conn = threadlocal_get_conn (); int s; if (pid) *pid = -1; if (uid) *uid = -1; if (gid) *gid = -1; if (!conn) { nbdkit_error ("no connection in this thread"); return -1; } s = conn->sockin; if (s == -1) { nbdkit_error ("socket not open"); return -1; } return get_peercred (s, pid, uid, gid); } NBDKIT_DLL_PUBLIC int64_t nbdkit_peer_pid (void) { int64_t pid; if (get_peercred_common (&pid, NULL, NULL) == -1) return -1; return pid; } NBDKIT_DLL_PUBLIC int64_t nbdkit_peer_uid (void) { int64_t uid; if (get_peercred_common (NULL, &uid, NULL) == -1) return -1; return uid; } NBDKIT_DLL_PUBLIC int64_t nbdkit_peer_gid (void) { int64_t gid; if (get_peercred_common (NULL, NULL, &gid) == -1) return -1; return gid; } #ifdef SO_PEERSEC NBDKIT_DLL_PUBLIC char * nbdkit_peer_security_context (void) { struct connection *conn = threadlocal_get_conn (); int s; char *label = NULL; socklen_t optlen = 0; int r; if (!conn) { nbdkit_error ("no connection in this thread"); return NULL; } s = conn->sockin; if (s == -1) { nbdkit_error ("socket not open"); return NULL; } /* Get the length of the label before allocating. Note the ip(7) * manual implies that the level should be IPPROTO_IP for AF_INET * sockets. However Linux always uses SOL_SOCKET. */ errno = 0; r = getsockopt (conn->sockin, SOL_SOCKET, SO_PEERSEC, label, &optlen); if (r == 0) { /* Zero-length label probably. */ label = calloc (1, 1); if (label == NULL) { nbdkit_error ("calloc: %m"); return NULL; } return label; /* caller frees */ } else if (r == -1 && errno == ENOPROTOOPT) { /* This is not really an error so don't call nbdkit_error. */ nbdkit_debug ("getsockopt: SO_PEERSEC: %m"); return NULL; } else if (r == -1 && errno != ERANGE) { nbdkit_error ("getsockopt: SO_PEERSEC: %m"); return NULL; } /* It's not defined if Linux will NUL-terminate the returned string, * or even if it will completely fill the buffer, so we play it safe * here. */ label = calloc (optlen+1, 1); if (label == NULL) { nbdkit_error ("calloc: %m"); return NULL; } /* Read the label. */ if (getsockopt (conn->sockin, SOL_SOCKET, SO_PEERSEC, label, &optlen) == -1) { nbdkit_error ("getsockopt: SO_PEERSEC: %m"); free (label); return NULL; } return label; /* caller frees */ } #else /* !SO_PEERSEC */ NBDKIT_DLL_PUBLIC char * nbdkit_peer_security_context (void) { nbdkit_error ("SO_PEERSEC is not available on this platform"); return NULL; } #endif /* !SO_PEERSEC */ /* Functions for manipulating intern'd strings. */ static string_vector global_interns; void free_interns (void) { struct connection *conn = threadlocal_get_conn (); string_vector *list = conn ? &conn->interns : &global_interns; string_vector_empty (list); } static const char * add_intern (char *str) { struct context *c = threadlocal_get_context (); struct connection *conn = c ? c->conn : NULL; string_vector *list = conn ? &conn->interns : &global_interns; if (string_vector_append (list, str) == -1) { nbdkit_error ("malloc: %m"); free (str); return NULL; } return str; } NBDKIT_DLL_PUBLIC const char * nbdkit_strndup_intern (const char *str, size_t n) { char *copy; if (str == NULL) { nbdkit_error ("nbdkit_strndup_intern: no string given"); errno = EINVAL; return NULL; } copy = strndup (str, n); if (copy == NULL) { nbdkit_error ("strndup: %m"); return NULL; } return add_intern (copy); } NBDKIT_DLL_PUBLIC const char * nbdkit_strdup_intern (const char *str) { char *copy; if (str == NULL) { nbdkit_error ("nbdkit_strdup_intern: no string given"); errno = EINVAL; return NULL; } copy = strdup (str); if (copy == NULL) { nbdkit_error ("strdup: %m"); return NULL; } return add_intern (copy); } NBDKIT_DLL_PUBLIC const char * nbdkit_vprintf_intern (const char *fmt, va_list ap) { char *str = NULL; if (vasprintf (&str, fmt, ap) == -1) { nbdkit_error ("asprintf: %m"); return NULL; } return add_intern (str); } NBDKIT_DLL_PUBLIC const char * nbdkit_printf_intern (const char *fmt, ...) { va_list ap; const char *ret; va_start (ap, fmt); ret = nbdkit_vprintf_intern (fmt, ap); va_end (ap); return ret; } NBDKIT_DLL_PUBLIC void nbdkit_disconnect (int force) { struct connection *conn = threadlocal_get_conn (); if (!conn) { debug ("no connection in this thread, ignoring disconnect request"); return; } if (connection_set_status (force ? STATUS_DEAD : STATUS_SHUTDOWN)) { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); conn->close (SHUT_WR); } } nbdkit-1.42.2/server/quit.c0000644000175000017500000000732714676465664011231 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" #include "utils.h" /* Detection of request to exit via signal. Most places in the code * can just poll quit at opportune moments, while sockets.c needs a * pipe-to-self through quit_fd in order to break a poll loop without * a race. */ volatile int quit; #ifndef WIN32 int quit_fd; static int write_quit_fd; #else HANDLE quit_fd; #endif #ifndef WIN32 void set_up_quit_pipe (void) { int fds[2]; #ifdef HAVE_PIPE2 if (pipe2 (fds, O_CLOEXEC) < 0) { perror ("pipe2"); exit (EXIT_FAILURE); } #else /* This is called early enough that no other thread will be * fork()ing while we create this; but we must set CLOEXEC so that * the fds don't leak into children. */ if (pipe (fds) < 0) { perror ("pipe"); exit (EXIT_FAILURE); } if (set_cloexec (fds[0]) == -1 || set_cloexec (fds[1]) == -1) { perror ("fcntl"); exit (EXIT_FAILURE); } #endif quit_fd = fds[0]; write_quit_fd = fds[1]; } void close_quit_pipe (void) { close (quit_fd); close (write_quit_fd); } /* The pragma here is for the write() call in set_quit below. RHEL * 6-era gcc requires pragmas outside the function scope. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" /* This function is called from signal handlers and MUST NOT do * anything asynch-signal unsafe (malloc, printf, debug etc.) as that * can be turned into an RCE. Example: * https://www.qualys.com/2024/07/01/cve-2024-6387/regresshion.txt * See also: signal-safety(7) */ static void set_quit (void) { char c = 0; quit = 1; write (write_quit_fd, &c, 1); } #pragma GCC diagnostic pop #else /* WIN32 */ /* Pipes don't work well with WaitForMultipleObjectsEx in Windows. In * any case, an Event is a better match with what we are trying to do * here. */ void set_up_quit_pipe (void) { quit_fd = CreateEvent (NULL, FALSE, FALSE, NULL); } void close_quit_pipe (void) { CloseHandle (quit_fd); } void set_quit (void) { quit = 1; SetEvent (quit_fd); } #endif /* WIN32 */ void handle_quit (int sig) { set_quit (); } NBDKIT_DLL_PUBLIC void nbdkit_shutdown (void) { set_quit (); } nbdkit-1.42.2/server/signals.c0000644000175000017500000000426214534316443011661 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "internal.h" #ifndef WIN32 /* Set up signal handlers. */ void set_up_signals (void) { struct sigaction sa; memset (&sa, 0, sizeof sa); sa.sa_flags = SA_RESTART; sa.sa_handler = handle_quit; sigaction (SIGINT, &sa, NULL); sigaction (SIGQUIT, &sa, NULL); sigaction (SIGTERM, &sa, NULL); sigaction (SIGHUP, &sa, NULL); memset (&sa, 0, sizeof sa); sa.sa_flags = SA_RESTART; sa.sa_handler = SIG_IGN; sigaction (SIGPIPE, &sa, NULL); } #else /* WIN32 */ void set_up_signals (void) { signal (SIGINT, handle_quit); signal (SIGTERM, handle_quit); } #endif /* WIN32 */ nbdkit-1.42.2/server/socket-activation.c0000644000175000017500000000704214534316443013647 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include "internal.h" #ifndef WIN32 /* Handle socket activation. This is controlled through special * environment variables inherited by nbdkit. Returns 0 if no socket * activation. Otherwise returns the number of FDs. See also * virGetListenFDs in libvirt.org:src/util/virutil.c */ unsigned int get_socket_activation (void) { const char *s; unsigned int pid; unsigned int nr_fds; unsigned int i; int fd; int f; s = getenv ("LISTEN_PID"); if (s == NULL) return 0; if (nbdkit_parse_unsigned ("LISTEN_PID", s, &pid) == -1) return 0; if (pid != getpid ()) { fprintf (stderr, "%s: %s was not for us (ignored)\n", program_name, "LISTEN_PID"); return 0; } s = getenv ("LISTEN_FDS"); if (s == NULL) return 0; if (nbdkit_parse_unsigned ("LISTEN_FDS", s, &nr_fds) == -1) return 0; /* Limit the number of fds that may be passed in to something * reasonable. */ if (nr_fds == 0 || nr_fds > 16) { fprintf (stderr, "%s: socket activation: LISTEN_FDS=%s out of range\n", program_name, s); exit (EXIT_FAILURE); } /* So these are not passed to any child processes we might start. */ unsetenv ("LISTEN_FDS"); unsetenv ("LISTEN_PID"); /* So the file descriptors don't leak into child processes. */ for (i = 0; i < nr_fds; ++i) { fd = FIRST_SOCKET_ACTIVATION_FD + i; f = fcntl (fd, F_GETFD); if (f == -1 || fcntl (fd, F_SETFD, f | FD_CLOEXEC) == -1) { /* If we cannot set FD_CLOEXEC then it probably means the file * descriptor is invalid, so socket activation has gone wrong * and we should exit. */ fprintf (stderr, "%s: socket activation: " "invalid file descriptor fd = %d: %s\n", program_name, fd, strerror (errno)); exit (EXIT_FAILURE); } } return nr_fds; } #else /* WIN32 */ unsigned int get_socket_activation (void) { return 0; } #endif /* WIN32 */ nbdkit-1.42.2/server/sockets.c0000644000175000017500000003614514676465664011722 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_LINUX_VM_SOCKETS_H #include #elif HAVE_SYS_VSOCK_H #include #endif #ifdef HAVE_LIBSELINUX #include #endif #include #include "internal.h" #include "poll.h" #include "utils.h" #include "vector.h" static void set_selinux_label (void) { if (selinux_label) { #ifdef HAVE_LIBSELINUX if (setsockcreatecon_raw (selinux_label) == -1) { perror ("selinux-label: setsockcreatecon_raw"); exit (EXIT_FAILURE); } #else fprintf (stderr, "%s: --selinux-label option used, but " "this binary was compiled without SELinux support\n", program_name); exit (EXIT_FAILURE); #endif } } static void clear_selinux_label (void) { #ifdef HAVE_LIBSELINUX if (selinux_label) { if (setsockcreatecon_raw (NULL) == -1) { perror ("selinux-label: setsockcreatecon_raw(NULL)"); exit (EXIT_FAILURE); } } #endif } void bind_unix_socket (sockets *socks) { size_t len; int sock; struct sockaddr_un addr; assert (unixsocket); #ifndef WIN32 /* On Win32 the abspath might start with a drive letter. */ assert (unixsocket[0] == '/'); #endif len = strlen (unixsocket); if (len >= UNIX_PATH_MAX) { fprintf (stderr, "%s: -U: path too long: length %zu > max %d bytes\n", program_name, len, UNIX_PATH_MAX-1); exit (EXIT_FAILURE); } set_selinux_label (); #ifdef SOCK_CLOEXEC sock = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); #else /* Fortunately, this code is only run at startup, so there is no * risk of the fd leaking to a plugin's fork() */ sock = set_cloexec (socket (AF_UNIX, SOCK_STREAM, 0)); #endif if (sock == -1) { perror ("bind_unix_socket: socket"); exit (EXIT_FAILURE); } addr.sun_family = AF_UNIX; memcpy (addr.sun_path, unixsocket, len+1 /* trailing \0 */); if (bind (sock, (struct sockaddr *) &addr, sizeof addr) == -1) { perror (unixsocket); exit (EXIT_FAILURE); } if (listen (sock, SOMAXCONN) == -1) { perror ("listen"); exit (EXIT_FAILURE); } clear_selinux_label (); if (sockets_append (socks, sock) == -1) { perror ("realloc"); exit (EXIT_FAILURE); } debug ("bound to unix socket %s", unixsocket); } void bind_tcpip_socket (sockets *socks) { const char *ipport; struct addrinfo *ai = NULL; struct addrinfo hints; struct addrinfo *a; int err, opt; int saved_errno = 0; ipport = port ? port : "10809"; memset (&hints, 0, sizeof hints); hints.ai_flags = AI_PASSIVE; hints.ai_family = tcpip_sock_af; hints.ai_socktype = SOCK_STREAM; err = getaddrinfo (ipaddr, ipport, &hints, &ai); if (err != 0) { fprintf (stderr, "%s: getaddrinfo: %s: %s: %s\n", program_name, ipaddr ? ipaddr : "", ipport, gai_strerror (err)); exit (EXIT_FAILURE); } for (a = ai; a != NULL; a = a->ai_next) { int sock; set_selinux_label (); #ifdef SOCK_CLOEXEC sock = socket (a->ai_family, a->ai_socktype | SOCK_CLOEXEC, a->ai_protocol); #else /* Fortunately, this code is only run at startup, so there is no * risk of the fd leaking to a plugin's fork() */ sock = set_cloexec (socket (a->ai_family, a->ai_socktype, a->ai_protocol)); #endif if (sock == -1) { if (errno == EAFNOSUPPORT) { /* If ipv6.disable=1 was specified to the Linux kernel then * getaddrinfo may still return AF_INET6 sockets but socket(2) * will return this error. I think it's safe to basically * ignore this error. */ saved_errno = errno; debug ("bind_tcpip_socket: socket: %m (ignored)"); continue; } else { perror ("bind_tcpip_socket: socket"); exit (EXIT_FAILURE); } } opt = 1; if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt) == -1) perror ("setsockopt: SO_REUSEADDR"); #ifdef IPV6_V6ONLY if (a->ai_family == PF_INET6) { if (setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof opt) == -1) perror ("setsockopt: IPv6 only"); } #endif if (bind (sock, a->ai_addr, a->ai_addrlen) == -1) { if (errno == EADDRINUSE) { saved_errno = errno; debug ("bind_tcpip_socket: bind: %m (ignored)"); closesocket (sock); continue; } perror ("bind"); exit (EXIT_FAILURE); } if (listen (sock, SOMAXCONN) == -1) { perror ("listen"); exit (EXIT_FAILURE); } clear_selinux_label (); if (sockets_append (socks, sock) == -1) { perror ("realloc"); exit (EXIT_FAILURE); } } freeaddrinfo (ai); if (socks->len == 0) { fprintf (stderr, "%s: unable to bind to any TCP/IP sockets\n", program_name); if (saved_errno) fprintf (stderr, "%s: socket error: %s\n", program_name, strerror (saved_errno)); exit (EXIT_FAILURE); } debug ("bound to IP address %s:%s (%zu socket(s))", ipaddr ? ipaddr : "", ipport, socks->len); } void bind_vsock (sockets *socks) { #if defined (AF_VSOCK) && defined (VMADDR_CID_ANY) uint32_t vsock_port; int sock; struct sockaddr_vm addr; if (port == NULL) vsock_port = 10809; else { /* --port parameter must be numeric for vsock, unless * /etc/services is extended but that seems unlikely. XXX */ if (nbdkit_parse_uint32_t ("port", port, &vsock_port) == -1) exit (EXIT_FAILURE); } #ifdef SOCK_CLOEXEC sock = socket (AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0); #else /* Fortunately, this code is only run at startup, so there is no * risk of the fd leaking to a plugin's fork() */ sock = set_cloexec (socket (AF_VSOCK, SOCK_STREAM, 0)); #endif if (sock == -1) { perror ("bind_vsock: socket"); exit (EXIT_FAILURE); } memset (&addr, 0, sizeof addr); addr.svm_family = AF_VSOCK; addr.svm_cid = VMADDR_CID_ANY; addr.svm_port = vsock_port; if (bind (sock, (struct sockaddr *) &addr, sizeof addr) == -1) { perror (unixsocket); exit (EXIT_FAILURE); } if (listen (sock, SOMAXCONN) == -1) { perror ("listen"); exit (EXIT_FAILURE); } if (sockets_append (socks, sock) == -1) { perror ("realloc"); exit (EXIT_FAILURE); } /* It's not easy to get the actual CID here. * IOCTL_VM_SOCKETS_GET_LOCAL_CID is documented, but requires * opening /dev/vsock which is not accessible to non-root users. * bind above doesn't update the sockaddr. Using getsockname * doesn't work. */ debug ("bound to vsock any:%" PRIu32, addr.svm_port); #else /* Can't happen because main() checks if AF_VSOCK is defined and * prevents vsock from being set, so this function can never be * called. */ abort (); #endif } /* This counts the number of connection threads running (note: not the * number of worker threads, each connection thread will start many * worker independent threads in the current implementation). The * purpose of this is so we can wait for all the connection threads to * exit before we return from accept_incoming_connections, so that * unload-time actions happen with no connections open. */ static pthread_mutex_t count_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t count_cond = PTHREAD_COND_INITIALIZER; static unsigned count = 0; struct thread_data { int sock; size_t instance_num; }; static void * start_thread (void *datav) { struct thread_data *data = datav; debug ("accepted connection"); pthread_mutex_lock (&count_mutex); count++; pthread_mutex_unlock (&count_mutex); /* Set thread-local data. */ threadlocal_new_server_thread (); threadlocal_set_instance_num (data->instance_num); handle_single_connection (data->sock, data->sock); free (data); pthread_mutex_lock (&count_mutex); count--; pthread_cond_signal (&count_cond); pthread_mutex_unlock (&count_mutex); return NULL; } static void accept_connection (int listen_sock) { int err; pthread_attr_t attrs; pthread_t thread; struct thread_data *thread_data; static size_t instance_num = 1; const int flag = 1; thread_data = malloc (sizeof *thread_data); if (unlikely (!thread_data)) { perror ("malloc"); return; } thread_data->instance_num = instance_num++; again: #ifdef HAVE_ACCEPT4 thread_data->sock = accept4 (listen_sock, NULL, NULL, SOCK_CLOEXEC); #else /* If we were fully parallel, then this function could be accepting * connections in one thread while another thread could be in a * plugin trying to fork. But plugins.c forced thread_model to * serialize_all_requests when it detects a lack of atomic CLOEXEC, * at which point, we can use a mutex to ensure we aren't accepting * until the plugin is not running, making non-atomicity okay. */ assert (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS); lock_request (); thread_data->sock = set_cloexec (accept (listen_sock, NULL, NULL)); unlock_request (); #endif if (thread_data->sock == -1) { if (errno == EINTR || errno == EAGAIN) goto again; nbdkit_error ("accept: %m"); free (thread_data); return; } /* Disable Nagle's algorithm on this socket. However we don't want * to fail if this doesn't work. */ setsockopt (thread_data->sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof flag); #ifdef SO_KEEPALIVE /* Enable keepalive if requested, but don't fail. */ if (keepalive) { int opt = 1; setsockopt (thread_data->sock, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof opt); } #endif /* Start a thread to handle this connection. Note we always do this * even for non-threaded plugins. There are mutexes in plugins.c * which ensure that non-threaded plugins are handled correctly. */ pthread_attr_init (&attrs); pthread_attr_setdetachstate (&attrs, PTHREAD_CREATE_DETACHED); err = pthread_create (&thread, &attrs, start_thread, thread_data); pthread_attr_destroy (&attrs); if (unlikely (err != 0)) { errno = err; nbdkit_error ("pthread_create: %m"); closesocket (thread_data->sock); free (thread_data); return; } /* If the thread starts successfully, then it is responsible for * closing the socket and freeing thread_data. */ } #ifndef WIN32 /* Check the list of sockets plus quit_fd until a POLLIN event occurs * on any of them. * * If POLLIN occurs on quit_fd do nothing except returning early * (don't call accept_connection in this case). * * If POLLIN occurs on one of the sockets, call * accept_connection (socks.ptr[i]) on each of them. */ static void check_sockets_and_quit_fd (const sockets *socks) { const size_t nr_socks = socks->len; size_t i; int r; CLEANUP_FREE struct pollfd *fds = malloc (sizeof (struct pollfd) * (nr_socks+1)); if (fds == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } for (i = 0; i < nr_socks; ++i) { fds[i].fd = socks->ptr[i]; fds[i].events = POLLIN; fds[i].revents = 0; } fds[nr_socks].fd = quit_fd; fds[nr_socks].events = POLLIN; fds[nr_socks].revents = 0; r = poll (fds, nr_socks + 1, -1); if (r == -1) { if (errno == EINTR || errno == EAGAIN) return; perror ("poll"); exit (EXIT_FAILURE); } /* We don't even have to read quit_fd - just knowing that it has * data means the signal handler ran, so we are ready to quit the * loop. */ if (fds[nr_socks].revents & POLLIN) return; for (i = 0; i < nr_socks; ++i) { if (fds[i].revents & POLLIN) accept_connection (socks->ptr[i]); } } #else /* WIN32 */ static void check_sockets_and_quit_fd (const sockets *socks) { const size_t nr_socks = socks->len; size_t i; HANDLE h; CLEANUP_FREE HANDLE *handles = NULL; DWORD r; handles = malloc ((nr_socks+1) * sizeof (HANDLE)); if (handles == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } for (i = 0; i < nr_socks; ++i) { h = WSACreateEvent (); WSAEventSelect (_get_osfhandle (socks->ptr[i]), h, FD_ACCEPT|FD_READ|FD_CLOSE); handles[i] = h; } handles[nr_socks] = quit_fd; r = WaitForMultipleObjectsEx ((DWORD) (nr_socks+1), handles, FALSE, INFINITE, TRUE); debug ("WaitForMultipleObjectsEx returned %d", (int) r); if (r == WAIT_FAILED) { fprintf (stderr, "%s: WaitForMultipleObjectsEx: error %lu\n", program_name, GetLastError ()); exit (EXIT_FAILURE); } for (i = 0; i < nr_socks; ++i) { WSAEventSelect (_get_osfhandle (socks->ptr[i]), NULL, 0); WSACloseEvent (handles[i]); } if (r == WAIT_OBJECT_0 + nr_socks) /* quit_fd signalled. */ return; if (r >= WAIT_OBJECT_0 && r < WAIT_OBJECT_0 + nr_socks) { i = r - WAIT_OBJECT_0; accept_connection (socks->ptr[i]); return; } debug ("WaitForMultipleObjectsEx: unexpected return value: %lu\n", r); } #endif /* WIN32 */ void accept_incoming_connections (const sockets *socks) { size_t i; int err; while (!quit) check_sockets_and_quit_fd (socks); /* Wait for all threads to exit. */ pthread_mutex_lock (&count_mutex); for (;;) { if (count == 0) break; err = pthread_cond_wait (&count_cond, &count_mutex); if (err != 0) { errno = err; perror ("pthread_cond_wait"); } } pthread_mutex_unlock (&count_mutex); for (i = 0; i < socks->len; ++i) closesocket (socks->ptr[i]); free (socks->ptr); } nbdkit-1.42.2/server/synopsis.c0000644000175000017500000000237614771245505012117 /* DO NOT EDIT! Generated from ../docs/synopsis.txt */ const char *synopsis = "nbdkit [-4|--ipv4-only] [-6|--ipv6-only]\n" " [-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N]\n" " [--exit-with-parent] [-e|--exportname EXPORTNAME]\n" " [--filter=FILTER ...] [-f|--foreground]\n" " [-g|--group GROUP] [-i|--ipaddr IPADDR] [--keepalive]\n" " [--log=stderr|syslog|null] [--mask-handshake=MASK]\n" " [-n|--newstyle] [--no-mc|--no-meta-contexts]\n" " [--no-sr|--no-structured-replies] [-o|--oldstyle]\n" " [-P|--pidfile PIDFILE] [-p|--port PORT] [--print-uri]\n" " [-r|--readonly] [--run 'COMMAND ARGS ...']\n" " [--selinux-label=LABEL] [-s|--single] [--swap]\n" " [-t|--threads THREADS] [--timeout=TIMEOUT]\n" " [--tls=off|on|require]\n" " [--tls-certificates=/path/to/certificates]\n" " [--tls-psk=/path/to/pskfile] [--tls-verify-peer]\n" " [-U|--unix SOCKET|-] [-u|--user USER]\n" " [-v|--verbose] [--vsock]\n" " PLUGIN [[KEY=]VALUE [KEY=VALUE [...]]]\n" "\n" "nbdkit --dump-config\n" "\n" "nbdkit PLUGIN --dump-plugin\n" "\n" "nbdkit --help\n" "\n" "nbdkit [-V|--version]\n" ; nbdkit-1.42.2/server/threadlocal.c0000644000175000017500000002116714676465664012527 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include "internal.h" /* Note that most thread-local storage data is informational, used for * smart error and debug messages on the server side. However, error * tracking can be used to influence which error is sent to the client * in a reply. * * The main thread does not have any associated Thread Local Storage, * *unless* it is serving a request (the '-s' option). */ struct threadlocal { char *name; /* Can be NULL. */ size_t instance_num; /* Can be 0. */ int err; char *last_error; /* Can be NULL. */ void *buffer; /* Can be NULL. */ size_t buffer_size; struct connection *conn; /* Can be NULL. */ struct context *ctx; /* Can be NULL. */ }; static pthread_key_t threadlocal_key; static void free_threadlocal (void *threadlocalv) { struct threadlocal *threadlocal = threadlocalv; free (threadlocal->name); free (threadlocal->last_error); free (threadlocal->buffer); free (threadlocal); } void threadlocal_init (void) { int err; err = pthread_key_create (&threadlocal_key, free_threadlocal); if (err != 0) { fprintf (stderr, "%s: pthread_key_create: %s\n", program_name, strerror (err)); exit (EXIT_FAILURE); } } void threadlocal_new_server_thread (void) { struct threadlocal *threadlocal; int err; threadlocal = calloc (1, sizeof *threadlocal); if (threadlocal == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } err = pthread_setspecific (threadlocal_key, threadlocal); if (err) { errno = err; perror ("pthread_setspecific"); exit (EXIT_FAILURE); } } void threadlocal_set_name (const char *name) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); /* Copy name, as the original may be residing in a module, but we * want our thread name to persist even after unload. */ if (threadlocal) { free (threadlocal->name); threadlocal->name = strdup (name); /* Best effort; logging a NULL name is better than exiting. */ if (threadlocal->name == NULL) perror ("malloc"); } } void threadlocal_set_instance_num (size_t instance_num) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (threadlocal) threadlocal->instance_num = instance_num; } const char * threadlocal_get_name (void) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (!threadlocal) return NULL; return threadlocal->name; } size_t threadlocal_get_instance_num (void) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (!threadlocal) return 0; return threadlocal->instance_num; } void threadlocal_set_errno (int err) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (threadlocal) threadlocal->err = err; else errno = err; } /* This preserves errno, for convenience. */ int threadlocal_get_errno (void) { int err = errno; struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); errno = err; return threadlocal ? threadlocal->err : 0; } /* Set the last_error field. The ownership of the 'msg' string is * passed to the threadlocal and will be freed here. */ void threadlocal_set_last_error (char *msg) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (threadlocal) { free (threadlocal->last_error); threadlocal->last_error = msg; } else { /* ... otherwise throw it away, it's informational. */ free (msg); } } void threadlocal_clear_last_error (void) { threadlocal_set_last_error (NULL); } /* Get the last_error field. If successful, this returns a non-NULL * string. This is valid until something calls nbdkit_error() in the * same thread, so it should be used quickly. Returning NULL is not * necessarily an error. The last_error is informational and may not * be available. */ const char * threadlocal_get_last_error (void) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); return threadlocal ? threadlocal->last_error : NULL; } /* Return the single pread/pwrite buffer for this thread. The buffer * size is increased to ‘size’ bytes if required. * * The buffer starts out as zeroes but after use may contain data from * previous requests. This is fine because: (a) Correctly written * plugins should overwrite the whole buffer on each request so no * leak should occur. (b) The aim of this buffer is to avoid leaking * random heap data from the core server; previous request data from * the plugin is not considered sensitive. */ extern void * threadlocal_buffer (size_t size) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (!threadlocal) abort (); if (threadlocal->buffer_size < size) { void *ptr; ptr = realloc (threadlocal->buffer, size); if (ptr == NULL) { nbdkit_error ("threadlocal_buffer: realloc: %m"); return NULL; } memset (ptr, 0, size); threadlocal->buffer = ptr; threadlocal->buffer_size = size; } return threadlocal->buffer; } /* Set (or clear) the connection that is using the current thread */ void threadlocal_set_conn (struct connection *conn) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (threadlocal) threadlocal->conn = conn; } /* Get the connection associated with this thread, if available */ struct connection * threadlocal_get_conn (void) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); struct connection *conn; conn = threadlocal ? threadlocal->conn : NULL; if (conn) assert (conn->magic == CONN_MAGIC); return conn; } /* Get the current context associated with this thread, if available */ struct context * threadlocal_get_context (void) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); struct context *ctx; ctx = threadlocal ? threadlocal->ctx : NULL; if (ctx) assert (ctx->magic == CONTEXT_MAGIC); return ctx; } /* Set (or clear) the context using the current thread. This function * should generally not be used directly, instead see the macro * PUSH_CONTEXT_FOR_SCOPE. */ struct context * threadlocal_push_context (struct context *ctx) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); struct context *ret = NULL; if (ctx) assert (ctx->magic == CONTEXT_MAGIC); if (threadlocal) { ret = threadlocal->ctx; threadlocal->ctx = ctx; } /* Note about validation of ret->magic: * * 'ret' here may be a freed pointer, so ret->magic can be invalid. * * 'ret' is only returned here so that PUSH_CONTEXT_FOR_SCOPE can * save it on the caller stack and restore it when the function * returns. Since the function using PUSH_CONTEXT_FOR_SCOPE can * never touch this we don't have to validate it, and validation * might fail anyway. */ return ret; } void threadlocal_pop_context (struct context **ctx) { struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); if (threadlocal) threadlocal->ctx = *ctx; } nbdkit-1.42.2/server/timeout.c0000644000175000017500000001005514771235500011701 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "internal.h" #ifdef HAVE_TIMEOUT_OPTION #include static void connection_timeout (union sigval si) { struct connection *conn = si.sival_ptr; assert (conn != NULL); nbdkit_debug ("connection timed out"); /* Note this is called asynchronously from a different thread, * making it difficult to do this safely. The theory here is that * since all connection operations are protected by a lock, we'll * take that lock and check that conn->magic is valid (to ensure it * hasn't been freed already). However we still must do the minimum * possible, since raw socket or gnutls operations may be taking * place simultaneously. The safest seems to be just to call * shutdown(2) on the socket. Calling close(2) is less safe as it * might cause fd reuse. */ lock_connection (); if (conn->magic == CONN_MAGIC && conn->timer_set && conn->status == STATUS_ACTIVE && conn->sockout >= 0) { shutdown (conn->sockout, SHUT_RDWR); conn->status = STATUS_DEAD; } unlock_connection (); } int start_timeout (struct connection *conn) { if (timeout_secs == 0 && timeout_nsecs == 0) return 0; struct sigevent sev = { .sigev_notify = SIGEV_THREAD, .sigev_value.sival_ptr = conn, .sigev_notify_function = connection_timeout, }; struct itimerspec its = { .it_value.tv_sec = timeout_secs, .it_value.tv_nsec = timeout_nsecs, .it_interval.tv_sec = 0, /* 0 = don't repeat */ .it_interval.tv_nsec = 0, }; if (timer_create (CLOCK_MONOTONIC, &sev, &conn->timer) == -1) { nbdkit_error ("timeout: timer_create: %m"); return -1; } if (timer_settime (conn->timer, 0, &its, NULL) == -1) { nbdkit_error ("timeout: timer_settime: %m"); timer_delete (conn->timer); return -1; } /* timer_t is actually a void * in glibc, but there seems to be no * guarantee that '0' means "no timer" (eg. if it was an integral * type in a different implementation). Therefore record that we * set it and will need to delete it later. */ conn->timer_set = true; return 0; } void cancel_timeout (struct connection *conn) { if (timeout_secs == 0 && timeout_nsecs == 0) return; if (conn->timer_set) { timer_delete (conn->timer); conn->timer_set = false; } } #else /* !HAVE_TIMEOUT_OPTION */ int start_timeout (struct connection *conn) { return 0; } void cancel_timeout (struct connection *conn) { return; } #endif /* !HAVE_TIMEOUT_OPTION */ nbdkit-1.42.2/server/uri.c0000644000175000017500000001133714623341243011014 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include "open_memstream.h" #include "utils.h" #include "internal.h" char *uri; /* NBD URI */ char * make_uri (void) { FILE *fp; size_t len = 0; char *r = NULL; const bool tls_required = tls == 2; const char *scheme; bool query_appended; switch (service_mode) { case SERVICE_MODE_SOCKET_ACTIVATION: case SERVICE_MODE_LISTEN_STDIN: /* can't form a URI, uri will be NULL */ goto out; default: ; } /* Work out the scheme. */ switch (service_mode) { case SERVICE_MODE_TCPIP: scheme = tls_required ? "nbds" : "nbd"; break; case SERVICE_MODE_UNIXSOCKET: scheme = tls_required ? "nbds+unix" : "nbd+unix"; break; case SERVICE_MODE_VSOCK: scheme = tls_required ? "nbds+vsock" : "nbd+vsock"; break; case SERVICE_MODE_SOCKET_ACTIVATION: case SERVICE_MODE_LISTEN_STDIN: /* these labels are not-reachable, see above */ /*FALLTHROUGH*/ default: abort (); } /* Open the memory stream to store the URI. */ fp = open_memstream (&r, &len); if (fp == NULL) { perror ("uri: open_memstream"); exit (EXIT_FAILURE); } fprintf (fp, "%s://", scheme); switch (service_mode) { case SERVICE_MODE_UNIXSOCKET: if (export_name && strcmp (export_name, "") != 0) { putc ('/', fp); uri_quote (export_name, fp); } fprintf (fp, "?socket="); uri_quote (unixsocket, fp); query_appended = true; break; case SERVICE_MODE_VSOCK: /* 1 = VMADDR_CID_LOCAL */ putc ('1', fp); if (port) { putc (':', fp); fputs (port, fp); } if (export_name && strcmp (export_name, "") != 0) { putc ('/', fp); uri_quote (export_name, fp); } query_appended = false; break; case SERVICE_MODE_TCPIP: fputs ("localhost", fp); if (port) { putc (':', fp); fputs (port, fp); } if (export_name && strcmp (export_name, "") != 0) { putc ('/', fp); uri_quote (export_name, fp); } query_appended = false; break; case SERVICE_MODE_SOCKET_ACTIVATION: case SERVICE_MODE_LISTEN_STDIN: /* these labels are not-reachable, see above */ /*FALLTHROUGH*/ default: abort (); } /* For TLS, append tls-certificates or tls-psk-file. Note that * tls-certificates requires libnbd >= 1.10 (Sep 2021) and it fails * strangely with older versions (RHEL 8 is too old). Hopefully * this will resolve itself over time as people upgrade libnbd. * Qemu ignores these parameters, see: * https://lists.libguestfs.org/archives/list/guestfs@lists.libguestfs.org/message/PDXCGDWJD2FHFNQNSFKH752IMVOAW2KI/ */ if (tls_required && (tls_certificates_dir || tls_psk)) { putc (query_appended ? '&' : '?', fp); if (tls_certificates_dir) { fputs ("tls-certificates=", fp); uri_quote (tls_certificates_dir, fp); } else if (tls_psk) { fputs ("tls-psk-file=", fp); uri_quote (tls_psk, fp); } } if (close_memstream (fp) == EOF) { perror ("uri: close_memstream"); exit (EXIT_FAILURE); } out: if (r) debug ("NBD URI: %s", r); else debug ("no NBD URI because service mode is %s", service_mode_string (service_mode)); return r; } nbdkit-1.42.2/server/usergroup.c0000644000175000017500000000745614534316443012264 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_GRP_H #include #endif #include "internal.h" #if defined (HAVE_PWD_H) && defined (HAVE_GRP_H) static uid_t parseuser (const char *); static gid_t parsegroup (const char *); /* Handle the -u and -g options. If user and group are non-NULL * then this parses them to work out the UID/GID and changes * user and group. */ void change_user (void) { if (group) { gid_t gid = parsegroup (group); if (setgid (gid) == -1) { perror ("setgid"); exit (EXIT_FAILURE); } /* Kill supplemental groups from parent process. */ if (setgroups (1, &gid) == -1) { perror ("setgroups"); exit (EXIT_FAILURE); } debug ("changed group to %s", group); } if (user) { uid_t uid = parseuser (user); if (setuid (uid) == -1) { perror ("setuid"); exit (EXIT_FAILURE); } debug ("changed user to %s", user); } } static uid_t parseuser (const char *id) { struct passwd *pwd; int saved_errno; errno = 0; pwd = getpwnam (id); if (NULL == pwd) { int val; saved_errno = errno; if (nbdkit_parse_int ("parseuser", id, &val) == 0) return val; fprintf (stderr, "%s: -u option: %s is not a valid user name or uid", program_name, id); if (saved_errno != 0) fprintf (stderr, " (getpwnam error: %s)", strerror (saved_errno)); fprintf (stderr, "\n"); exit (EXIT_FAILURE); } return pwd->pw_uid; } static gid_t parsegroup (const char *id) { struct group *grp; int saved_errno; errno = 0; grp = getgrnam (id); if (NULL == grp) { int val; saved_errno = errno; if (nbdkit_parse_int ("parsegroup", id, &val) == 0) return val; fprintf (stderr, "%s: -g option: %s is not a valid group name or gid", program_name, id); if (saved_errno != 0) fprintf (stderr, " (getgrnam error: %s)", strerror (saved_errno)); fprintf (stderr, "\n"); exit (EXIT_FAILURE); } return grp->gr_gid; } #else /* a platform like Windows which lacks pwd/grp functions */ void change_user (void) { if (!user && !group) return; NOT_IMPLEMENTED_ON_WINDOWS ("--user/--group"); } #endif nbdkit-1.42.2/server/vfprintf.c0000644000175000017500000000434514534316443012061 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "internal.h" #if !HAVE_VFPRINTF_PERCENT_M /* Work around lack of %m in BSD */ #undef vfprintf /* Call the real vfprintf after first changing %m into strerror(errno). */ int replace_vfprintf (FILE *f, const char *fmt, va_list args) { char *repl = NULL; char *p = strstr (fmt, "%m"); /* assume strstr doesn't touch errno */ int ret; /* We only handle the first %m; if a user passes more than one, they * deserve broken output. */ if (p && asprintf (&repl, "%.*s%s%s", (int) (p - fmt), fmt, strerror (errno), p + 2) > 0) fmt = repl; ret = vfprintf (f, fmt, args); free (repl); return ret; } #endif nbdkit-1.42.2/server/fuzzer.c0000644000175000017500000001215214534316443011543 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include "array-size.h" #include "internal.h" #ifndef ENABLE_LIBFUZZER #error "This file should only be compiled when libFuzzer is enabled" #endif /* When we're compiled with --enable-libfuzzer, the normal main() * function is renamed to fuzzer_main. We call it with particular * parameters to make it use the memory plugin. */ extern int fuzzer_main (int argc, char *argv[]); static void server (int sock); static void client (const uint8_t *data, size_t size, int sock); /* This is the entry point called by libFuzzer. */ int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) { pid_t pid; int sv[2], r, status; /* Create a connected socket. */ if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { perror ("socketpair"); exit (EXIT_FAILURE); } /* Fork: The parent will be the nbdkit process (server). The child * will be the phony NBD client. */ pid = fork (); if (pid == -1) { perror ("fork"); exit (EXIT_FAILURE); } if (pid > 0) { /* Parent: nbdkit server. */ close (sv[1]); server (sv[0]); close (sv[0]); again: r = wait (&status); if (r == -1) { if (errno == EINTR) goto again; perror ("wait"); exit (EXIT_FAILURE); } if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) fprintf (stderr, "bad exit status %d\n", status); return 0; } /* Child: phony NBD client. */ close (sv[0]); client (data, size, sv[1]); close (sv[1]); _exit (EXIT_SUCCESS); } static void server (int sock) { char *argv[] = { "nbdkit", "-s", /* take input from stdin/stdout */ "--log=null", /* discard error messages */ "plugins/memory/.libs/nbdkit-memory-plugin." SOEXT, "1M", NULL }; const int argc = ARRAY_SIZE (argv) - 1; int saved_stdin, saved_stdout; /* Make the socket appear as stdin and stdout of the process, saving * the existing stdin/stdout. */ saved_stdin = dup (0); saved_stdout = dup (1); dup2 (sock, 0); dup2 (sock, 1); /* Call nbdkit's normal main() function. */ fuzzer_main (argc, argv); /* Restore stdin/stdout. */ dup2 (saved_stdin, 0); dup2 (saved_stdout, 1); close (saved_stdin); close (saved_stdout); } static void client (const uint8_t *data, size_t size, int sock) { struct pollfd pfds[1]; char rbuf[512]; ssize_t r; if (size == 0) shutdown (sock, SHUT_WR); for (;;) { pfds[0].fd = sock; pfds[0].events = POLLIN; if (size > 0) pfds[0].events |= POLLOUT; pfds[0].revents = 0; if (poll (pfds, 1, -1) == -1) { if (errno == EINTR) continue; perror ("poll"); /* This is not an error. */ return; } /* We can read from the server socket. Just throw away anything sent. */ if ((pfds[0].revents & POLLIN) != 0) { r = read (sock, rbuf, sizeof rbuf); if (r == -1 && errno != EINTR) { //perror ("read"); return; } else if (r == 0) /* end of input from the server */ return; } /* We can write to the server socket. */ if ((pfds[0].revents & POLLOUT) != 0) { if (size > 0) { r = write (sock, data, size); if (r == -1 && errno != EAGAIN && errno != EWOULDBLOCK) { perror ("write"); return; } else if (r > 0) { data += r; size -= r; if (size == 0) shutdown (sock, SHUT_WR); } } } } /* for (;;) */ } nbdkit-1.42.2/server/test-public.c0000644000175000017500000004374114623341243012454 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include "internal.h" #include "array-size.h" static bool error_flagged; /* Stubs for linking against minimal source files, and for proving * that an error message is issued when expected. */ void nbdkit_error (const char *fs, ...) { error_flagged = true; } void nbdkit_debug (const char *fs, ...) { } void debug_in_server (const char *fs, ...) { } bool listen_stdin; bool configured; bool verbose; int tls; volatile int quit; #ifndef WIN32 int quit_fd = -1; #else extern HANDLE quit_fd; #endif struct connection * threadlocal_get_conn (void) { abort (); } struct context * threadlocal_get_context (void) { abort (); } conn_status connection_get_status (void) { abort (); } bool connection_set_status (conn_status v) { abort (); } const char * backend_default_export (struct backend *b, int readonly) { abort (); } /* Unit tests. */ #include "human-size-test-cases.h" /* defines 'pairs' below */ static bool test_nbdkit_parse_size (void) { size_t i; bool pass = true; for (i = 0; i < ARRAY_SIZE (pairs); i++) { int64_t r; error_flagged = false; r = nbdkit_parse_size (pairs[i].str); if (r != pairs[i].res) { fprintf (stderr, "Wrong parse for %s, got %" PRId64 ", expected %" PRId64 "\n", pairs[i].str, r, pairs[i].res); pass = false; } if ((r == -1) != error_flagged) { fprintf (stderr, "Wrong error message handling for %s\n", pairs[i].str); pass = false; } } return pass; } static bool test_nbdkit_parse_probability (void) { size_t i; bool pass = true; struct pair { const char *str; int result; double expected; } tests[] = { /* Bogus strings */ { "", -1 }, { "garbage", -1 }, { "0garbage", -1 }, { "1X", -1 }, { "1%%", -1 }, { "1:", -1 }, { "1:1:1", -1 }, { "1:0", -1 }, /* format is valid but divide by zero is not allowed */ { "1/", -1 }, { "1/2/3", -1 }, /* Reject inf, NaN, negative. */ { "inf", -1 }, { "nan", -1 }, { "inf/nan", -1 }, { "nan/inf", -1 }, { "inf/inf", -1 }, { "nan/nan", -1 }, { "-1", -1 }, { "-0", -1 }, /* we reject this at the moment */ { "1e200/1e-200", -1 }, /* explodes larger than representable */ { "-1/1", -1 }, /* Numbers. */ { "0", 0, 0 }, { "1", 0, 1 }, { "2", 0, 2 }, /* values outside [0..1] range are allowed */ { "0.1", 0, 0.1 }, { "0.5", 0, 0.5 }, { "0.9", 0, 0.9 }, { "1.0000", 0, 1 }, { "1e-1", 0, 0.1 }, { "1e-8", 0, 1e-8 }, /* Percentages. */ { "0%", 0, 0 }, { "50%", 0, 0.5 }, { "100%", 0, 1 }, { "90.25%", 0, 0.9025 }, /* N in M */ { "1:1000", 0, 0.001 }, { "1/1000", 0, 0.001 }, { "2:99", 0, 2.0/99 }, { "2/99", 0, 2.0/99 }, { "0:1000000", 0, 0 }, }; for (i = 0; i < ARRAY_SIZE (tests); i++) { int r; double d; error_flagged = false; r = nbdkit_parse_probability ("test", tests[i].str, &d); if (r != tests[i].result) { fprintf (stderr, "Wrong return value for %s, got %d, expected %d\n", tests[i].str, r, tests[i].result); pass = false; } if (r == 0 && d != tests[i].expected) { fprintf (stderr, "Wrong result for %s, got %g, expected %g\n", tests[i].str, d, tests[i].expected); pass = false; } if ((r == -1) != error_flagged) { fprintf (stderr, "Wrong error message handling for %s\n", tests[i].str); pass = false; } } return pass; } static bool test_nbdkit_parse_delay (void) { size_t i; bool pass = true; struct pair { const char *str; int result; unsigned expected_sec, expected_nsec; } tests[] = { /* Bogus strings */ { "", -1 }, { "garbage", -1 }, { "0garbage", -1 }, { "s0", -1 }, { "0ss", -1 }, { "0ssss", -1 }, { "000ssss", -1 }, { "1X", -1 }, { "1%%", -1 }, { "1:", -1 }, { "1:1:1", -1 }, { "1?", -1 }, /* Reject inf, NaN, negative. */ { "inf", -1 }, { "nan", -1 }, { "-1", -1 }, /* Seconds. */ { "0", 0, 0, 0 }, { "0s", 0, 0, 0 }, { "1", 0, 1, 0 }, { "1s", 0, 1, 0 }, { "1.234", 0, 1, 234000000 }, { "1.234s", 0, 1, 234000000 }, /* Milliseconds. */ { "0ms", 0, 0, 0 }, { "1ms", 0, 0, 1000000 }, { "1.234ms", 0, 0, 1234000 }, /* Microseconds. */ { "0us", 0, 0, 0 }, { "0μs", 0, 0, 0 }, { "1us", 0, 0, 1000 }, { "1μs", 0, 0, 1000 }, { "1.234us", 0, 0, 1234 }, { "1.234μs", 0, 0, 1234 }, /* Nanoseconds. */ { "0ns", 0, 0, 0 }, { "1ns", 0, 0, 1 }, { "999999999ns", 0, 0, 999999999 }, { "1000000000ns", 0, 1, 0 }, { "1000000001ns", 0, 1, 1 }, { "2000000001ns", 0, 2, 1 }, }; for (i = 0; i < ARRAY_SIZE (tests); i++) { int r; unsigned sec, nsec; error_flagged = false; r = nbdkit_parse_delay ("test", tests[i].str, &sec, &nsec); if (r != tests[i].result) { fprintf (stderr, "Wrong return value for %s, got %d, expected %d\n", tests[i].str, r, tests[i].result); pass = false; } if (r == 0 && (sec != tests[i].expected_sec || nsec != tests[i].expected_nsec)) { fprintf (stderr, "Wrong result for %s, got (%u, %u), expected (%u, %u)\n", tests[i].str, sec, nsec, tests[i].expected_sec, tests[i].expected_nsec); pass = false; } if ((r == -1) != error_flagged) { fprintf (stderr, "Wrong error message handling for %s\n", tests[i].str); pass = false; } } return pass; } static bool test_nbdkit_parse_ints (void) { bool pass = true; #define PARSE(...) PARSE_ (__VA_ARGS__) #define PARSE_(TYPE, FORMAT, TEST, RET, EXPECTED) \ do { \ error_flagged = false; \ TYPE i = 123; \ int r = nbdkit_parse_##TYPE ("test", TEST, &i); \ if (r != RET || i != (r ? 123 : EXPECTED)) { \ fprintf (stderr, \ "%s: %d: wrong parse for %s: r=%d i=" FORMAT "\n", \ __FILE__, __LINE__, TEST, r, i); \ pass = false; \ } \ if ((r == -1) != error_flagged) { \ fprintf (stderr, \ "%s: %d: wrong error message handling for %s\n", \ __FILE__, __LINE__, TEST); \ pass = false; \ } \ } while (0) #define OK 0 #define BAD -1, 0 /* Test the basic parsing of decimals, hexadecimal, octal and * negative numbers. */ PARSE (int, "%d", "0", OK, 0); PARSE (int, "%d", " 0", OK, 0); PARSE (int, "%d", " 0", OK, 0); PARSE (int, "%d", " 0", OK, 0); PARSE (int, "%d", "1", OK, 1); PARSE (int, "%d", " 1", OK, 1); PARSE (int, "%d", " 1", OK, 1); PARSE (int, "%d", " 1", OK, 1); PARSE (int, "%d", "99", OK, 99); PARSE (int, "%d", "0x1", OK, 1); PARSE (int, "%d", "0xf", OK, 15); PARSE (int, "%d", "0x10", OK, 16); PARSE (int, "%d", "0xff", OK, 255); PARSE (int, "%d", "0Xff", OK, 255); PARSE (int, "%d", "01", OK, 1); PARSE (int, "%d", "07", OK, 7); PARSE (int, "%d", "010", OK, 8); PARSE (int, "%d", "+0", OK, 0); PARSE (int, "%d", " +0", OK, 0); PARSE (int, "%d", "+99", OK, 99); PARSE (int, "%d", "+0xf", OK, 15); PARSE (int, "%d", "+010", OK, 8); PARSE (int, "%d", "-0", OK, 0); PARSE (int, "%d", " -0", OK, 0); PARSE (int, "%d", " -0", OK, 0); PARSE (int, "%d", "-99", OK, -99); PARSE (int, "%d", "-0xf", OK, -15); PARSE (int, "%d", "-0XF", OK, -15); PARSE (int, "%d", "-010", OK, -8); PARSE (int, "%d", "2147483647", OK, 2147483647); /* INT_MAX */ PARSE (int, "%d", "-2147483648", OK, -2147483648); /* INT_MIN */ PARSE (int, "%d", "0x7fffffff", OK, 0x7fffffff); PARSE (int, "%d", "-0x80000000", OK, -0x80000000); /* Test basic error handling. */ PARSE (int, "%d", "", BAD); PARSE (int, "%d", "-", BAD); PARSE (int, "%d", "- 0", BAD); PARSE (int, "%d", "+", BAD); PARSE (int, "%d", "++", BAD); PARSE (int, "%d", "++0", BAD); PARSE (int, "%d", "--0", BAD); PARSE (int, "%d", "0x", BAD); PARSE (int, "%d", "0xg", BAD); PARSE (int, "%d", "08", BAD); PARSE (int, "%d", "0x1p1", BAD); PARSE (int, "%d", "42x", BAD); PARSE (int, "%d", "42e42", BAD); PARSE (int, "%d", "42-", BAD); PARSE (int, "%d", "garbage", BAD); PARSE (int, "%d", "inf", BAD); PARSE (int, "%d", "nan", BAD); PARSE (int, "%d", "0.0", BAD); PARSE (int, "%d", "1,000", BAD); PARSE (int, "%d", "2147483648", BAD); /* INT_MAX + 1 */ PARSE (int, "%d", "-2147483649", BAD); /* INT_MIN - 1 */ PARSE (int, "%d", "999999999999999999999999", BAD); PARSE (int, "%d", "-999999999999999999999999", BAD); /* Test nbdkit_parse_unsigned. */ PARSE (unsigned, "%u", "0", OK, 0); PARSE (unsigned, "%u", " 0", OK, 0); PARSE (unsigned, "%u", "1", OK, 1); PARSE (unsigned, "%u", "99", OK, 99); PARSE (unsigned, "%u", "0x1", OK, 1); PARSE (unsigned, "%u", "0xf", OK, 15); PARSE (unsigned, "%u", "0x10", OK, 16); PARSE (unsigned, "%u", "0xff", OK, 255); PARSE (unsigned, "%u", "01", OK, 1); PARSE (unsigned, "%u", "07", OK, 7); PARSE (unsigned, "%u", "010", OK, 8); PARSE (unsigned, "%u", "+0", OK, 0); PARSE (unsigned, "%u", "+99", OK, 99); PARSE (unsigned, "%u", "+0xf", OK, 15); PARSE (unsigned, "%u", "+010", OK, 8); PARSE (unsigned, "%u", "-0", BAD); /* this is by choice */ PARSE (unsigned, "%u", " -0", BAD); PARSE (unsigned, "%u", "-99", BAD); PARSE (unsigned, "%u", "-0xf", BAD); PARSE (unsigned, "%u", "-010", BAD); PARSE (unsigned, "%u", "2147483647", OK, 2147483647); /* INT_MAX */ PARSE (unsigned, "%u", "-2147483648", BAD); /* INT_MIN */ PARSE (unsigned, "%u", "0x7fffffff", OK, 0x7fffffff); PARSE (unsigned, "%u", "-0x80000000", BAD); /* Test nbdkit_parse_int8_t. */ PARSE (int8_t, "%" PRIi8, "0", OK, 0); PARSE (int8_t, "%" PRIi8, "0x7f", OK, 0x7f); PARSE (int8_t, "%" PRIi8, "-0x80", OK, -0x80); PARSE (int8_t, "%" PRIi8, "0x80", BAD); PARSE (int8_t, "%" PRIi8, "-0x81", BAD); /* Test nbdkit_parse_uint8_t. */ PARSE (uint8_t, "%" PRIu8, "0", OK, 0); PARSE (uint8_t, "%" PRIu8, "0xff", OK, 0xff); PARSE (uint8_t, "%" PRIu8, "0x100", BAD); PARSE (uint8_t, "%" PRIu8, "-1", BAD); /* Test nbdkit_parse_int16_t. */ PARSE (int16_t, "%" PRIi16, "0", OK, 0); PARSE (int16_t, "%" PRIi16, "0x7fff", OK, 0x7fff); PARSE (int16_t, "%" PRIi16, "-0x8000", OK, -0x8000); PARSE (int16_t, "%" PRIi16, "0x8000", BAD); PARSE (int16_t, "%" PRIi16, "-0x8001", BAD); /* Test nbdkit_parse_uint16_t. */ PARSE (uint16_t, "%" PRIu16, "0", OK, 0); PARSE (uint16_t, "%" PRIu16, "0xffff", OK, 0xffff); PARSE (uint16_t, "%" PRIu16, "0x10000", BAD); PARSE (uint16_t, "%" PRIu16, "-1", BAD); /* Test nbdkit_parse_int32_t. */ PARSE (int32_t, "%" PRIi32, "0", OK, 0); PARSE (int32_t, "%" PRIi32, "0x7fffffff", OK, 0x7fffffff); PARSE (int32_t, "%" PRIi32, "-0x80000000", OK, -0x80000000); PARSE (int32_t, "%" PRIi32, "0x80000000", BAD); PARSE (int32_t, "%" PRIi32, "-0x80000001", BAD); /* Test nbdkit_parse_uint32_t. */ PARSE (uint32_t, "%" PRIu32, "0", OK, 0); PARSE (uint32_t, "%" PRIu32, "0xffffffff", OK, 0xffffffff); PARSE (uint32_t, "%" PRIu32, "0x100000000", BAD); PARSE (uint32_t, "%" PRIu32, "-1", BAD); /* Test nbdkit_parse_int64_t. */ PARSE (int64_t, "%" PRIi64, "0", OK, 0); PARSE (int64_t, "%" PRIi64, "0x7fffffffffffffff", OK, 0x7fffffffffffffff); PARSE (int64_t, "%" PRIi64, "-0x8000000000000000", OK, -0x8000000000000000); PARSE (int64_t, "%" PRIi64, "0x8000000000000000", BAD); PARSE (int64_t, "%" PRIi64, "-0x8000000000000001", BAD); /* Test nbdkit_parse_uint64_t. */ PARSE (uint64_t, "%" PRIu64, "0", OK, 0); PARSE (uint64_t, "%" PRIu64, "0xffffffffffffffff", OK, 0xffffffffffffffff); PARSE (uint64_t, "%" PRIu64, "0x10000000000000000", BAD); PARSE (uint64_t, "%" PRIu64, "-1", BAD); #undef PARSE #undef PARSE_ #undef OK #undef BAD return pass; } static bool test_nbdkit_read_password (void) { bool pass = true; char template[] = "+/tmp/nbdkit_testpw_XXXXXX"; #ifndef WIN32 char template2[] = "/tmp/nbdkit_testpw2_XXXXXX"; char fdbuf[16]; #endif char *pw = template; int fd; /* Test expected failure - no such file */ error_flagged = false; if (nbdkit_read_password ("+/nosuch", &pw) != -1) { fprintf (stderr, "Failed to diagnose failed password file\n"); pass = false; } else if (pw != NULL) { fprintf (stderr, "Failed to set password to NULL on failure\n"); pass = false; } else if (!error_flagged) { fprintf (stderr, "Wrong error message handling\n"); pass = false; } error_flagged = false; /* Test direct password */ if (nbdkit_read_password ("abc", &pw) != 0) { fprintf (stderr, "Failed to reuse direct password\n"); pass = false; } else if (strcmp (pw, "abc") != 0) { fprintf (stderr, "Wrong direct password, expected 'abc' got '%s'\n", pw); pass = false; } free (pw); pw = NULL; /* Test reading password from file */ fd = mkstemp (&template[1]); if (fd < 0) { perror ("mkstemp"); pass = false; } else if (write (fd, "abc\n", 4) != 4 || /* NB: On Windows we must close the temporary file here. * This is because nbdkit_read_password will try to open a * second file descriptor on this file, which will fail * with ERROR_SHARING_VIOLATION because Windows is stupid. */ close (fd) == -1) { fprintf (stderr, "Failed to write to file %s\n", &template[1]); pass = false; } else if (nbdkit_read_password (template, &pw) != 0) { fprintf (stderr, "Failed to read password from file %s\n", &template[1]); pass = false; } else if (strcmp (pw, "abc") != 0) { fprintf (stderr, "Wrong file password, expected 'abc' got '%s'\n", pw); pass = false; } free (pw); unlink (&template[1]); #ifndef WIN32 /* Test reading password from file descriptor. */ fd = mkstemp (template2); if (fd < 0) { perror ("mkstemp"); pass = false; } else if (write (fd, "abc\n", 4) != 4) { fprintf (stderr, "Failed to write to file %s\n", template2); pass = false; } else { snprintf (fdbuf, sizeof fdbuf, "-%d", fd); lseek (fd, 0, 0); if (nbdkit_read_password (fdbuf, &pw) == -1) { fprintf (stderr, "Failed to read password from fd %s\n", fdbuf); pass = false; } else if (strcmp (pw, "abc") != 0) { fprintf (stderr, "Wrong file password, expected 'abc' got '%s'\n", pw); pass = false; } free (pw); } if (fd >= 0) { /* Don't close fd, it is closed by nbdkit_read_password. */ unlink (template2); } if (error_flagged) { fprintf (stderr, "Wrong error message handling\n"); pass = false; } #endif /* !WIN32 */ /* XXX Testing reading from stdin would require setting up a pty. But * we can test that it is forbidden with -s. */ listen_stdin = true; if (nbdkit_read_password ("-", &pw) != -1) { fprintf (stderr, "Failed to diagnose failed password from stdin with -s\n"); pass = false; } else if (pw != NULL) { fprintf (stderr, "Failed to set password to NULL on failure\n"); pass = false; } else if (!error_flagged) { fprintf (stderr, "Wrong error message handling\n"); pass = false; } error_flagged = false; return pass; } int main (int argc, char *argv[]) { bool pass = true; pass &= test_nbdkit_parse_size (); pass &= test_nbdkit_parse_probability (); pass &= test_nbdkit_parse_delay (); pass &= test_nbdkit_parse_ints (); pass &= test_nbdkit_read_password (); /* nbdkit_absolute_path and nbdkit_nanosleep not unit-tested here, but * get plenty of coverage in the main testsuite. */ return pass ? EXIT_SUCCESS : EXIT_FAILURE; } nbdkit-1.42.2/server/nbdkit.syms0000644000175000017500000000637014676465664012270 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # This linker script controls the visibility of symbols in the final # nbdkit binary. We want to export some symbols to plugins, but at # the same time we don't want plugins to be able to call arbitrary # functions from nbdkit, so this script lists only the symbols we want # to export. { # The functions we want plugins and filters to call. global: nbdkit_absolute_path; nbdkit_add_export; nbdkit_add_extent; nbdkit_context_get_backend; nbdkit_context_set_next; nbdkit_debug; nbdkit_disconnect; nbdkit_error; nbdkit_export_name; nbdkit_exports_count; nbdkit_exports_free; nbdkit_exports_new; nbdkit_extents_aligned; nbdkit_extents_count; nbdkit_extents_free; nbdkit_extents_full; nbdkit_extents_new; nbdkit_get_export; nbdkit_get_extent; nbdkit_is_tls; nbdkit_nanosleep; nbdkit_next_context_close; nbdkit_next_context_open; nbdkit_parse_bool; nbdkit_parse_delay; nbdkit_parse_int16_t; nbdkit_parse_int32_t; nbdkit_parse_int64_t; nbdkit_parse_int8_t; nbdkit_parse_int; nbdkit_parse_probability; nbdkit_parse_size; nbdkit_parse_uint16_t; nbdkit_parse_uint32_t; nbdkit_parse_uint64_t; nbdkit_parse_uint8_t; nbdkit_parse_unsigned; nbdkit_peer_gid; nbdkit_peer_name; nbdkit_peer_pid; nbdkit_peer_security_context; nbdkit_peer_tls_dn; nbdkit_peer_tls_issuer_dn; nbdkit_peer_uid; nbdkit_printf_intern; nbdkit_read_password; nbdkit_realpath; nbdkit_set_error; nbdkit_shutdown; nbdkit_stdio_safe; nbdkit_strdup_intern; nbdkit_strndup_intern; nbdkit_use_default_export; nbdkit_vdebug; nbdkit_verror; nbdkit_vprintf_intern; nbdkit_debug_*; # For AFL++ to work: __afl_*; # Everything else is hidden. local: *; }; nbdkit-1.42.2/.vscode/0000755000175000017500000000000014771247240010165 5nbdkit-1.42.2/.vscode/settings.json0000644000175000017500000000057414534316443012645 { "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "newLine", "C_Cpp.vcFormat.space.beforeFunctionOpenParenthesis": "insert", "C_Cpp.vcFormat.space.pointerReferenceAlignment": "right", "C_Cpp.formatting": "vcFormat", "C_Cpp.vcFormat.indent.withinParentheses": "alignToParenthesis", "python.linting.flake8Enabled": true, "rewrap.wrappingColumn": 79 } nbdkit-1.42.2/.vscode/tasks.json0000644000175000017500000000045414534316443012127 { "version": "2.0.0", "tasks": [ { "type": "process", "label": "Build project", "command": "/usr/bin/make", "args": [], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true } } ] }nbdkit-1.42.2/Makefile.am0000644000175000017500000001034214730027756010603 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ BENCHMARKING \ .dir-locals.el \ .gitignore \ html/pod.css \ LICENSE \ m4/.gitignore \ OTHER_PLUGINS \ README.md \ scripts/git.orderfile \ SECURITY \ .vscode/settings.json \ .vscode/tasks.json \ $(NULL) CLEANFILES += html/*.html scripts/*~ if !ENABLE_LIBFUZZER # NB: This is not the real nbdkit binary. It's a wrapper that allows # you to run nbdkit from the build directory before it is installed. noinst_PROGRAMS = nbdkit nbdkit_SOURCES = wrapper.c server/options.h nbdkit_CPPFLAGS = \ -I$(top_srcdir)/server \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ -I$(top_srcdir)/common/replacements \ -Dbuilddir=\"$(abs_top_builddir)\" \ -Dsrcdir=\"$(abs_top_srcdir)\" \ -DVALGRIND=\"$(VALGRIND)\" \ $(NULL) nbdkit_CFLAGS = $(WARNINGS_CFLAGS) nbdkit_LDADD = \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ $(NULL) EXTRA_nbdkit_DEPENDENCIES = config.status endif !ENABLE_LIBFUZZER SUBDIRS = \ bash-completion \ docs \ fuzzing \ valgrind \ include \ common/include \ common/protocol \ common/replacements \ common/utils \ server \ contrib $(NULL) if HAVE_PLUGINS SUBDIRS += \ common/allocators \ common/bitmap \ common/gpt \ common/regions \ plugins \ filters \ $(NULL) endif SUBDIRS += . tests check-valgrind: $(MAKE) -C tests check-valgrind check-root: $(MAKE) -C tests check-root check-vddk: $(MAKE) -C tests check-vddk bench: all @for d in common/utils; do \ $(MAKE) -C $$d bench || exit 1; \ done #---------------------------------------------------------------------- # Maintainers only! # Check no files are missing from EXTRA_DIST rules, and that all # generated files have been included in the tarball. (Note you must # have done 'make dist') maintainer-check-extra-dist: @tar ztf $(PACKAGE_NAME)-$(VERSION).tar.gz | sort | \ sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tarfiles @git ls-files | \ grep -v \ -e '^\.cirrus.yml' \ -e '^\.gitlab-ci.yml' \ -e '^ci/' | \ sort > gitfiles @comm -13 tarfiles gitfiles > comm-out @echo Checking for differences between EXTRA_DIST and git ... @cat comm-out @[ ! -s comm-out ] @rm tarfiles gitfiles comm-out @echo PASS: EXTRA_DIST tests # Commit everything in the current directory and set the commit # message to the current version number. maintainer-commit: git commit -a -m "Version $(VERSION)." # Tag HEAD with the current version. maintainer-tag: git tag -a v$(VERSION) -m "Version $(VERSION)." -f # Run tests and display the time taken to run each test, which is # useful for diagnosing slow-running tests. # # Try also setting LIBGUESTFS_BACKEND_SETTINGS=force_tcg which # emulates what happens in Koji. maintainer-check-times: make check -j1 | ts -i nbdkit-1.42.2/configure0000755000175000017500000346604414771245445010501 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for nbdkit 1.42.2. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='nbdkit' PACKAGE_TARNAME='nbdkit' PACKAGE_VERSION='1.42.2' PACKAGE_STRING='nbdkit 1.42.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_config_libobj_dir=common/replacements with_manpages=check enable_year2038=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS NBDKIT_VERSION_MICRO NBDKIT_VERSION_MINOR NBDKIT_VERSION_MAJOR HAVE_VDDK_FALSE HAVE_VDDK_TRUE HAVE_TORRENT_FALSE HAVE_TORRENT_TRUE LIBTORRENT_LIBS LIBTORRENT_CFLAGS HAVE_EXT2_FALSE HAVE_EXT2_TRUE COM_ERR_LIBS COM_ERR_CFLAGS EXT2FS_LIBS EXT2FS_CFLAGS HAVE_MKE2FS_WITH_D_FALSE HAVE_MKE2FS_WITH_D_TRUE USE_LIBGUESTFS_FOR_TESTS_FALSE USE_LIBGUESTFS_FOR_TESTS_TRUE HAVE_LIBGUESTFS_FALSE HAVE_LIBGUESTFS_TRUE LIBGUESTFS_LIBS LIBGUESTFS_CFLAGS HAVE_LIBZSTD_FALSE HAVE_LIBZSTD_TRUE LIBZSTD_LIBS LIBZSTD_CFLAGS HAVE_LZIP_FALSE HAVE_LZIP_TRUE LZIP HAVE_LZMA_LZIP_DECODER_FALSE HAVE_LZMA_LZIP_DECODER_TRUE HAVE_LIBLZMA_FALSE HAVE_LIBLZMA_TRUE LIBLZMA_LIBS LIBLZMA_CFLAGS HAVE_LIBNBD_FALSE HAVE_LIBNBD_TRUE LIBNBD_LIBS LIBNBD_CFLAGS ZLIB_NG_LIBS ZLIB_NG_CFLAGS HAVE_ZLIB_FALSE HAVE_ZLIB_TRUE ZLIB_LIBS ZLIB_CFLAGS HAVE_BZLIB_FALSE HAVE_BZLIB_TRUE BZIP2 BZLIB_LIBS BZLIB_CFLAGS HAVE_LIBVIRT_FALSE HAVE_LIBVIRT_TRUE LIBVIRT_LIBS LIBVIRT_CFLAGS HAVE_ISO_FALSE HAVE_ISO_TRUE ISOPROG MKISOFS GENISOIMAGE XORRISO HAVE_SSH_FALSE HAVE_SSH_TRUE SSH_LIBS SSH_CFLAGS HAVE_CURL_FALSE HAVE_CURL_TRUE CURL_LIBS CURL_CFLAGS HAVE_LIBBLKIO_FALSE HAVE_LIBBLKIO_TRUE LIBBLKIO_LIBS LIBBLKIO_CFLAGS HAVE_GOLANG_FALSE HAVE_GOLANG_TRUE GOROOT GOARCH GOOS GOLANG HAVE_LUA_FALSE HAVE_LUA_TRUE LUA_LIBS LUA_CFLAGS HAVE_TCL_FALSE HAVE_TCL_TRUE TCL_LIBS TCL_CFLAGS HAVE_RUST_FALSE HAVE_RUST_TRUE RUSTC CARGO OCAML_PLUGIN_LIBRARIES OCAML_STD_INCLUDES OCAML_MAJOR HAVE_OCAMLDOC_FALSE HAVE_OCAMLDOC_TRUE HAVE_OCAML_FALSE HAVE_OCAML_TRUE OCAMLBUILD OCAMLDOC OCAMLMKLIB OCAMLMKTOP OCAMLDEP OCAML OCAMLOPTDOTOPT OCAMLCDOTOPT OCAMLBEST OCAMLOPT OCAMLLIB OCAMLVERSION OCAMLC OCAMLOPTFLAGS PYTHON_LDFLAGS HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE PYTHON_VERSION PYTHON_LIBS PYTHON_CFLAGS PYTHON PERL_LDOPTS PERL_CFLAGS PERL_ARCHLIB HAVE_PERL_FALSE HAVE_PERL_TRUE CC_PLUGIN_CFLAGS CC_PLUGIN_CC HAVE_PLUGINS_FALSE HAVE_PLUGINS_TRUE PODWRAPPER HAVE_POD_FALSE HAVE_POD_TRUE PERL HAVE_BASH_COMPLETION_FALSE HAVE_BASH_COMPLETION_TRUE bashcompdir BASH_COMPLETION_LIBS BASH_COMPLETION_CFLAGS USE_LINKER_SCRIPT_FALSE USE_LINKER_SCRIPT_TRUE ENABLE_LIBFUZZER_FALSE ENABLE_LIBFUZZER_TRUE VALGRIND_LIBS VALGRIND_CFLAGS VALGRIND TRUNCATE STAT CUT HAVE_GNUTLS_PBKDF2_FALSE HAVE_GNUTLS_PBKDF2_TRUE CERTTOOL HAVE_GNUTLS_FALSE HAVE_GNUTLS_TRUE GNUTLS_LIBS GNUTLS_CFLAGS LIBSELINUX_LIBS LIBSELINUX_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG HAVE_GLIBC_234_FALSE HAVE_GLIBC_234_TRUE ac_ct_DLLTOOL HAVE_MC_FALSE HAVE_MC_TRUE ac_ct_MC MC IS_WINDOWS_FALSE IS_WINDOWS_TRUE SOEXT IMPORT_LIBRARY_ON_WINDOWS NO_UNDEFINED_ON_WINDOWS DL_LDFLAGS HAVE_ICONV_FALSE HAVE_ICONV_TRUE DL_LIBS LIBOBJS RT_LIBS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CXX PTHREAD_CC ax_pthread_config CAN_TEST_ANSI_C_FALSE CAN_TEST_ANSI_C_TRUE COMPILER_WARNINGS_FALSE COMPILER_WARNINGS_TRUE WARNINGS_MODULE_CXXFLAGS WARNINGS_CFLAGS HAVE_CXX_FALSE HAVE_CXX_TRUE CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP filters non_lang_plugins lang_plugins plugins LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_extra enable_largefile enable_gcc_warnings with_iconv with_selinux with_gnutls with_tls_priority enable_valgrind enable_libfuzzer enable_linker_script with_bash_completions with_manpages enable_plugins enable_perl enable_python enable_ocaml enable_rust enable_tcl enable_lua enable_golang with_libblkio with_curl with_ssh with_iso with_libvirt with_bzip2 with_zlib with_zlib_ng with_libnbd enable_nbd_plugin with_liblzma with_libzstd with_libguestfs enable_libguestfs_tests enable_linuxdisk with_ext2 enable_torrent enable_vddk enable_year2038 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP CXX CXXFLAGS CCC CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBSELINUX_CFLAGS LIBSELINUX_LIBS GNUTLS_CFLAGS GNUTLS_LIBS VALGRIND_CFLAGS VALGRIND_LIBS BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS bashcompdir CC_PLUGIN_CC CC_PLUGIN_CFLAGS PYTHON_CFLAGS PYTHON_LIBS TCL_CFLAGS TCL_LIBS LUA_CFLAGS LUA_LIBS LIBBLKIO_CFLAGS LIBBLKIO_LIBS CURL_CFLAGS CURL_LIBS SSH_CFLAGS SSH_LIBS LIBVIRT_CFLAGS LIBVIRT_LIBS BZLIB_CFLAGS BZLIB_LIBS ZLIB_CFLAGS ZLIB_LIBS ZLIB_NG_CFLAGS ZLIB_NG_LIBS LIBNBD_CFLAGS LIBNBD_LIBS LIBLZMA_CFLAGS LIBLZMA_LIBS LIBZSTD_CFLAGS LIBZSTD_LIBS LIBGUESTFS_CFLAGS LIBGUESTFS_LIBS EXT2FS_CFLAGS EXT2FS_LIBS COM_ERR_CFLAGS COM_ERR_LIBS LIBTORRENT_CFLAGS LIBTORRENT_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures nbdkit 1.42.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/nbdkit] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of nbdkit 1.42.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-gcc-warnings turn on compiler warnings (for developers) --disable-valgrind disable Valgrind probe --enable-libfuzzer build libFuzzer test binary (developers only) --disable-linker-script disable linker script for server (developers only) --disable-plugins disable all bundled plugins and filters --disable-perl disable Perl embed plugin --disable-python disable Python embed plugin --disable-ocaml disable OCaml embed plugin --disable-rust disable Rust plugin --disable-tcl disable Tcl plugin --disable-lua disable Lua plugin --disable-golang disable Go language plugin --disable-nbd-plugin disable nbd plugin (deprecated, use --without-libnbd) --disable-libguestfs-tests disable tests which need libguestfs --disable-linuxdisk disable linuxdisk plugin [default=check] --disable-torrent disable bittorrent plugin --disable-vddk disable VMware VDDK plugin --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-extra=... extra version information (for use by packagers) --without-iconv don't try to link against iconv [default=check] --without-selinux disable SELinux support, used for socket labelling [default=check] --without-gnutls disable TLS support via GnuTLS [default=check] --with-tls-priority=... default TLS session priority string [default=NORMAL] --without-bash-completions disable installing bash completions [default=check] --without-manpages do not build man pages [default=check] --without-libblkio disable blkio plugin [default=check] --without-curl disable curl plugin [default=check] --without-ssh disable ssh plugin [default=check] --without-iso disable iso plugin [default=check] --without-libvirt disable libvirt plugin [default=check] --without-bzip2 disable bzip2 filter [default=check] --without-zlib disable gzip filter [default=check] --without-zlib-ng disable zlib-ng support [default=check] --without-libnbd disable nbd plugin [default=check] --without-liblzma disable xz and lzip filters [default=check] --without-libzstd disable allocator=zstd [default=check] --without-libguestfs disable guestfs plugin and tests [default=check] --without-ext2 disable ext2 filter [default=check] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBSELINUX_CFLAGS C compiler flags for LIBSELINUX, overriding pkg-config LIBSELINUX_LIBS linker flags for LIBSELINUX, overriding pkg-config GNUTLS_CFLAGS C compiler flags for GNUTLS, overriding pkg-config GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config VALGRIND_CFLAGS C compiler flags for VALGRIND, overriding pkg-config VALGRIND_LIBS linker flags for VALGRIND, overriding pkg-config BASH_COMPLETION_CFLAGS C compiler flags for BASH_COMPLETION, overriding pkg-config BASH_COMPLETION_LIBS linker flags for BASH_COMPLETION, overriding pkg-config bashcompdir value of completionsdir for bash-completion, overriding pkg-config CC_PLUGIN_CC value to hard-code into the cc plugin's default for CC, instead of $CC CC_PLUGIN_CFLAGS value to hard-code into the cc plugin's default for CFLAGS, instead of $CFLAGS PYTHON_CFLAGS C compiler flags for PYTHON, overriding pkg-config PYTHON_LIBS linker flags for PYTHON, overriding pkg-config TCL_CFLAGS C compiler flags for TCL, overriding pkg-config TCL_LIBS linker flags for TCL, overriding pkg-config LUA_CFLAGS C compiler flags for LUA, overriding pkg-config LUA_LIBS linker flags for LUA, overriding pkg-config LIBBLKIO_CFLAGS C compiler flags for LIBBLKIO, overriding pkg-config LIBBLKIO_LIBS linker flags for LIBBLKIO, overriding pkg-config CURL_CFLAGS C compiler flags for CURL, overriding pkg-config CURL_LIBS linker flags for CURL, overriding pkg-config SSH_CFLAGS C compiler flags for SSH, overriding pkg-config SSH_LIBS linker flags for SSH, overriding pkg-config LIBVIRT_CFLAGS C compiler flags for LIBVIRT, overriding pkg-config LIBVIRT_LIBS linker flags for LIBVIRT, overriding pkg-config BZLIB_CFLAGS C compiler flags for BZLIB, overriding pkg-config BZLIB_LIBS linker flags for BZLIB, overriding pkg-config ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config ZLIB_LIBS linker flags for ZLIB, overriding pkg-config ZLIB_NG_CFLAGS C compiler flags for ZLIB_NG, overriding pkg-config ZLIB_NG_LIBS linker flags for ZLIB_NG, overriding pkg-config LIBNBD_CFLAGS C compiler flags for LIBNBD, overriding pkg-config LIBNBD_LIBS linker flags for LIBNBD, overriding pkg-config LIBLZMA_CFLAGS C compiler flags for LIBLZMA, overriding pkg-config LIBLZMA_LIBS linker flags for LIBLZMA, overriding pkg-config LIBZSTD_CFLAGS C compiler flags for LIBZSTD, overriding pkg-config LIBZSTD_LIBS linker flags for LIBZSTD, overriding pkg-config LIBGUESTFS_CFLAGS C compiler flags for LIBGUESTFS, overriding pkg-config LIBGUESTFS_LIBS linker flags for LIBGUESTFS, overriding pkg-config EXT2FS_CFLAGS C compiler flags for EXT2FS, overriding pkg-config EXT2FS_LIBS linker flags for EXT2FS, overriding pkg-config COM_ERR_CFLAGS C compiler flags for COM_ERR, overriding pkg-config COM_ERR_LIBS linker flags for COM_ERR, overriding pkg-config LIBTORRENT_CFLAGS C compiler flags for LIBTORRENT, overriding pkg-config LIBTORRENT_LIBS linker flags for LIBTORRENT, overriding pkg-config Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF nbdkit configure 1.42.2 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break else case e in #( e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break else case e in #( e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) ac_lo= ac_hi= ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid else case e in #( e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval (void) { return $2; } static unsigned long int ulongval (void) { return $2; } #include #include int main (void) { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) eval "$4=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by nbdkit $as_me 1.42.2, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (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; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* 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 do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub ltmain.sh missing install-sh compile" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else case e in #( e) ac_cv_safe_to_define___extensions__=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else case e in #( e) MINIX= ;; esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h fi am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir ;; esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$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' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='nbdkit' VERSION='1.42.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="${ac_tool_prefix}file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AS+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AS=$ac_cv_prog_AS if test -n "$AS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 printf "%s\n" "$AS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AS+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 printf "%s\n" "$ac_ct_AS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump enable_dlopen=no # Check whether --enable-shared was given. if test ${enable_shared+y} 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 case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} 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 case e in #( e) enable_static=yes ;; esac fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} 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 case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi with_aix_soname=$lt_cv_with_aix_soname ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --with-extra was given. if test ${with_extra+y} then : withval=$with_extra; NBDKIT_VERSION_EXTRA="$withval" else case e in #( e) NBDKIT_VERSION_EXTRA= ;; esac fi printf "%s\n" "#define NBDKIT_VERSION_EXTRA \"$NBDKIT_VERSION_EXTRA\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: nbdkit version 1.42.2 ($NBDKIT_VERSION_EXTRA)" >&5 printf "%s\n" "$as_me: nbdkit version 1.42.2 ($NBDKIT_VERSION_EXTRA)" >&6;} lang_plugins="\ cc \ golang \ lua \ ocaml \ perl \ python \ rust \ sh \ tcl \ " non_lang_plugins="\ blkio \ cdi \ curl \ data \ eval \ example1 \ example2 \ example3 \ example4 \ file \ floppy \ full \ gcs \ guestfs \ info \ iso \ libvirt \ linuxdisk \ memory \ nbd \ null \ ondemand \ ones \ partitioning \ pattern \ random \ S3 \ sparse-random \ split \ ssh \ tmpdisk \ torrent \ vddk \ zero \ " plugins="$(echo $(printf %s\\n $lang_plugins $non_lang_plugins | sort -u))" filters="\ blocksize \ blocksize-policy \ bzip2 \ cache \ cacheextents \ checkwrite \ cow \ ddrescue \ delay \ error \ evil \ exitlast \ exitwhen \ exportname \ ext2 \ extentlist \ fua \ gzip \ ip \ limit \ log \ luks \ lzip \ multi-conn \ nocache \ noextents \ nofilter \ noparallel \ nozero \ offset \ partition \ pause \ protect \ qcow2dec \ rate \ readahead \ readonly \ retry \ retry-request \ rotational \ scan \ spinning \ stats \ swab \ tar \ time-limit \ tls-fallback \ truncate \ xz \ " { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi bash=`which bash` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the major version of $bash" >&5 printf %s "checking for the major version of $bash... " >&6; } bash_major=`bash -c 'echo ${BASH_VERSINFO:-0}'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_major" >&5 printf "%s\n" "$bash_major" >&6; } if test $bash_major -lt 4 then : as_fn_error $? " Your bash shell ($bash) is older than version 4. If you are using macOS, please install the latest version of bash from homebrew or macports. If you have installed the latest bash and this error is still showing up, check that \$PATH is set correctly. " "$LINENO" 5 fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile,$enable_year2038" != no,no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 printf %s "checking for $CC option to enable large file support... " >&6; } if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CC="$CC" ac_opt_found=no for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do if test x"$ac_opt" != x"none needed" then : CC="$ac_save_CC $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef FTYPE # define FTYPE off_t #endif /* Check that FTYPE can represent 2**63 - 1 correctly. We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_opt" = x"none needed" then : # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) CC="$CC -D_FILE_OFFSET_BITS=64" if ac_fn_c_try_compile "$LINENO" then : ac_opt='-D_FILE_OFFSET_BITS=64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam fi ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CC="$ac_save_CC" test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } ac_have_largefile=yes case $ac_cv_sys_largefile_opts in #( "none needed") : ;; #( "supported through gnulib") : ;; #( "support not detected") : ac_have_largefile=no ;; #( "-D_FILE_OFFSET_BITS=64") : printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h ;; #( "-D_LARGE_FILES=1") : printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h ;; #( "-n32") : CC="$CC -n32" ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac if test "$enable_year2038" != no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 printf %s "checking for $CC option for timestamps after 2038... " >&6; } if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do if test x"$ac_opt" != x"none needed" then : CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that time_t can represent 2**32 - 1 correctly. */ #define LARGE_TIME_T \\ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_year2038_opts="$ac_opt" ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CPPFLAGS="$ac_save_CPPFLAGS" test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } ac_have_year2038=yes case $ac_cv_sys_year2038_opts in #( "none needed") : ;; #( "support not detected") : ac_have_year2038=no ;; #( "-D_TIME_BITS=64") : printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h ;; #( "-D__MINGW_USE_VC2005_COMPAT") : printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h ;; #( "-U_USE_32_BIT_TIME_T"*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It will stop working after mid-January 2038. Remove _USE_32BIT_TIME_T from the compiler flags. See 'config.log' for more details" "$LINENO" 5; } ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac fi fi if test "$ac_prog_cc_stdc" != no; then printf "%s\n" "#define PROTOTYPES 1" >>confdefs.h printf "%s\n" "#define __PROTOTYPES 1" >>confdefs.h fi test "x$U" != "x" && as_fn_error $? "Compiler not ANSI compliant" "$LINENO" 5 printf "%s\n" "#define host_cpu \"$host_cpu\"" >>confdefs.h printf "%s\n" "#define host_os \"$host_os\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO" then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } int main (int argc, char **argv) { /* Intimidate the compiler so that it does not optimize the arrays away. */ char *p = argv[0]; ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; return use_ascii (argc) == use_ebcdic (*p); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no else case e in #( e) ac_cv_c_bigendian=yes ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 printf %s "checking size of pid_t... " >&6; } if test ${ac_cv_sizeof_pid_t+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_pid_t" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pid_t) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_pid_t=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 printf "%s\n" "$ac_cv_sizeof_pid_t" >&6; } printf "%s\n" "#define SIZEOF_PID_T $ac_cv_sizeof_pid_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of uid_t" >&5 printf %s "checking size of uid_t... " >&6; } if test ${ac_cv_sizeof_uid_t+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uid_t))" "ac_cv_sizeof_uid_t" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_uid_t" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uid_t) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uid_t=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uid_t" >&5 printf "%s\n" "$ac_cv_sizeof_uid_t" >&6; } printf "%s\n" "#define SIZEOF_UID_T $ac_cv_sizeof_uid_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of gid_t" >&5 printf %s "checking size of gid_t... " >&6; } if test ${ac_cv_sizeof_gid_t+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (gid_t))" "ac_cv_sizeof_gid_t" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_gid_t" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (gid_t) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_gid_t=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_gid_t" >&5 printf "%s\n" "$ac_cv_sizeof_gid_t" >&6; } printf "%s\n" "#define SIZEOF_GID_T $ac_cv_sizeof_gid_t" >>confdefs.h ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else case e in #( e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else case e in #( e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 ;; esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 ;; esac 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 depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP ;; esac fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$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 yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' 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 -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX 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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' 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* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' 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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -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 ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; 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 ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; 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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. 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; func_echo_all "$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* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols 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' ;; esac 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; func_echo_all \"$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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) 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::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes 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__`"; 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=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. 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. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) 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" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) 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" && func_echo_all "-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' ;; esac 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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac 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 -v "^Configured with:" | $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* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. 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 yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $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 $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $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 $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_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='$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,$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' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) 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 ;; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # 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= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$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 CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; 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= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_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_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # 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 ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; 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* | sunCC*) # 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 ;; 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 ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; 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 # # 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\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_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 .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_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 .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # 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 yes,yes = "$GCC,$enable_shared"; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler really really works" >&5 printf %s "checking if the C++ compiler really really works... " >&6; } if $CXX --version >&5 2>&1 then : have_cxx=yes else case e in #( e) have_cxx=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_cxx" >&5 printf "%s\n" "$have_cxx" >&6; } if test "$have_cxx" = "yes"; then HAVE_CXX_TRUE= HAVE_CXX_FALSE='#' else HAVE_CXX_TRUE='#' HAVE_CXX_FALSE= fi # Check whether --enable-gcc-warnings was given. if test ${enable_gcc_warnings+y} then : enableval=$enable_gcc_warnings; case $enableval in yes|no) ;; *) as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; esac compiler_warnings=$enableval else case e in #( e) compiler_warnings=no ;; esac fi if test "x$compiler_warnings" = "xyes"; then WARNINGS_CFLAGS="-Wall -Wshadow -Wvla -Werror" WARNINGS_MODULE_CXXFLAGS="$WARNINGS_CFLAGS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should disable unused-command-line-argument warning" >&5 printf %s "checking if we should disable unused-command-line-argument warning... " >&6; } case $host_os in #( freebsd*) : WARNINGS_MODULE_CXXFLAGS="$WARNINGS_MODULE_CXXFLAGS -Xcompiler -Wno-unused-command-line-argument" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; #( *) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi if test "$compiler_warnings" = "yes"; then COMPILER_WARNINGS_TRUE= COMPILER_WARNINGS_FALSE='#' else COMPILER_WARNINGS_TRUE='#' COMPILER_WARNINGS_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler supports -std=c90 for ANSI C test" >&5 printf %s "checking if the compiler supports -std=c90 for ANSI C test... " >&6; } old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=c90" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : supports_std_c90=yes else case e in #( e) supports_std_c90=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$old_CFLAGS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $supports_std_c90" >&5 printf "%s\n" "$supports_std_c90" >&6; } if test "x$supports_std_c90" = "xyes"; then CAN_TEST_ANSI_C_TRUE= CAN_TEST_ANSI_C_FALSE='#' else CAN_TEST_ANSI_C_TRUE='#' CAN_TEST_ANSI_C_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac as_ac_Symbol=`printf "%s\n" "ac_cv_have_decl___builtin_add_overflow(int, int, int *)" | sed "$as_sed_sh"` ac_fn_check_decl "$LINENO" "__builtin_add_overflow(int, int, int *)" "$as_ac_Symbol" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if eval test \"x\$"$as_ac_Symbol"\" = x"yes" then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL___BUILTIN_ADD_OVERFLOW $ac_have_decl" >>confdefs.h as_ac_Symbol=`printf "%s\n" "ac_cv_have_decl___builtin_mul_overflow(int, int, int *)" | sed "$as_sed_sh"` ac_fn_check_decl "$LINENO" "__builtin_mul_overflow(int, int, int *)" "$as_ac_Symbol" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if eval test \"x\$"$as_ac_Symbol"\" = x"yes" then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL___BUILTIN_MUL_OVERFLOW $ac_have_decl" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether OS-dependent include paths are required" >&5 printf %s "checking whether OS-dependent include paths are required... " >&6; } case $host_os in #( haiku*) : CFLAGS="$CFLAGS -I`findpaths -p /system B_FIND_PATH_HEADERS_DIRECTORY`/bsd"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; #( *) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for temporary directory for large files" >&5 printf %s "checking for temporary directory for large files... " >&6; } case $host_os in #( haiku*) : LARGE_TMPDIR=/tmp ;; #( *) : LARGE_TMPDIR=/var/tmp ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LARGE_TMPDIR" >&5 printf "%s\n" "$LARGE_TMPDIR" >&6; } printf "%s\n" "#define LARGE_TMPDIR \"$LARGE_TMPDIR\"" >>confdefs.h ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" if test "x$PTHREAD_CC" != "x" then : CC="$PTHREAD_CC" fi if test "x$PTHREAD_CXX" != "x" then : CXX="$PTHREAD_CXX" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_join (void); int main (void) { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items with a "," contain both # C compiler flags (before ",") and linker flags (after ","). Other items # starting with a "-" are C compiler flags, and remaining items are # library names, except for "none" which indicates that we try without # any flags at all, and "pthread-config" which is a program returning # the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi rm -rf conftest* ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac # Are we compiling with Clang? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 printf %s "checking whether $CC is Clang... " >&6; } if test ${ax_cv_PTHREAD_CLANG+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : ax_cv_PTHREAD_CLANG=yes fi rm -rf conftest* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) # Note that for GCC and Clang -pthread generally implies -lpthread, # except when -nostdlib is passed. # This is problematic using libtool to build C++ shared libraries with pthread: # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 # [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 # [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 # To solve this, first try -pthread together with -lpthread for GCC if test "x$GCC" = "xyes" then : ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" fi # Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first if test "x$ax_pthread_clang" = "xyes" then : ax_pthread_flags="-pthread,-lpthread -pthread" fi # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac if test "x$ax_pthread_check_macro" = "x--" then : ax_pthread_check_cond=0 else case e in #( e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;; esac fi if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 printf %s "checking whether pthreads work without any flags... " >&6; } ;; *,*) PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } ;; -*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ax_pthread_config+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi ;; esac fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 printf "%s\n" "$ax_pthread_config" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ax_pthread_config" = "xno" then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void *some_global = NULL; static void routine(void *a) { /* To avoid any unused-parameter or unused-but-set-parameter warning. */ some_global = a; } static void *start_routine(void *a) { return a; } int main (void) { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xyes" then : break fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do if test "x$ax_pthread_try" = "xunknown" then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" if test "x$ax_pthread_try" = "x" then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 printf %s "checking for joinable pthread attribute... " >&6; } if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes" then : printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h ax_pthread_joinable_attr_defined=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 printf %s "checking whether more special flags are required for pthreads... " >&6; } if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes" then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int i = PTHREAD_PRIO_INHERIT; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_PRIO_INHERIT=yes else case e in #( e) ax_cv_PTHREAD_PRIO_INHERIT=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes" then : printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes fi CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) case "x/$CC" in #( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in #( x/*) : if as_fn_executable_p ${CC}_r then : PTHREAD_CC="${CC}_r" fi if test "x${CXX}" != "x" then : if as_fn_executable_p ${CXX}_r then : PTHREAD_CXX="${CXX}_r" fi fi ;; #( *) : for ac_prog in ${CC}_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 printf "%s\n" "$PTHREAD_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" if test "x${CXX}" != "x" then : for ac_prog in ${CXX}_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 printf "%s\n" "$PTHREAD_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PTHREAD_CXX" && break done test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" fi ;; esac ;; #( *) : ;; esac ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_nbdkit_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -Werror" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if __attribute__((cleanup(...))) works with this compiler" >&5 printf %s "checking if __attribute__((cleanup(...))) works with this compiler... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include void freep (void *ptr) { exit (EXIT_SUCCESS); } void test (void) { __attribute__((cleanup(freep))) char *ptr = malloc (100); (void)ptr; } int main (int argc, char *argv[]) { test (); exit (EXIT_FAILURE); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "'__attribute__((cleanup(...)))' does not work. You may not be using a sufficiently recent version of GCC or CLANG, or you may be using a C compiler which does not support this attribute, or the configure test may be wrong. This code requires the attribute to work for proper locking between threads." "$LINENO" 5 ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${acx_nbdkit_save_CFLAGS}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if __auto_type is available in this compiler" >&5 printf %s "checking if __auto_type is available in this compiler... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ static int test (int a) { __auto_type at = a; return at; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_AUTO_TYPE 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is declared in header files" >&5 printf %s "checking if environ is declared in header files... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include static int test (void) { char **env = environ; return env ? 1 : 0; // this just forces env to be used } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_long" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" if test "x$ac_cv_header_alloca_h" = xyes then : printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "afunix.h" "ac_cv_header_afunix_h" "$ac_includes_default" if test "x$ac_cv_header_afunix_h" = xyes then : printf "%s\n" "#define HAVE_AFUNIX_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes then : printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" if test "x$ac_cv_header_byteswap_h" = xyes then : printf "%s\n" "#define HAVE_BYTESWAP_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" if test "x$ac_cv_header_endian_h" = xyes then : printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default" if test "x$ac_cv_header_fnmatch_h" = xyes then : printf "%s\n" "#define HAVE_FNMATCH_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" if test "x$ac_cv_header_grp_h" = xyes then : printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "linux/fs.h" "ac_cv_header_linux_fs_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fs_h" = xyes then : printf "%s\n" "#define HAVE_LINUX_FS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes then : printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_tcp_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" if test "x$ac_cv_header_pwd_h" = xyes then : printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" if test "x$ac_cv_header_stdatomic_h" = xyes then : printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" if test "x$ac_cv_header_syslog_h" = xyes then : printf "%s\n" "#define HAVE_SYSLOG_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/disk.h" "ac_cv_header_sys_disk_h" "$ac_includes_default" if test "x$ac_cv_header_sys_disk_h" = xyes then : printf "%s\n" "#define HAVE_SYS_DISK_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/disklabel.h" "ac_cv_header_sys_disklabel_h" "$ac_includes_default" if test "x$ac_cv_header_sys_disklabel_h" = xyes then : printf "%s\n" "#define HAVE_SYS_DISKLABEL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" if test "x$ac_cv_header_sys_endian_h" = xyes then : printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mman_h" = xyes then : printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_prctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/procctl.h" "ac_cv_header_sys_procctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_procctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PROCCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" if test "x$ac_cv_header_sys_statvfs_h" = xyes then : printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ucred_h" = xyes then : printf "%s\n" "#define HAVE_SYS_UCRED_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" if test "x$ac_cv_header_sys_un_h" = xyes then : printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/vsock.h" "ac_cv_header_sys_vsock_h" "$ac_includes_default" if test "x$ac_cv_header_sys_vsock_h" = xyes then : printf "%s\n" "#define HAVE_SYS_VSOCK_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes then : printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" if test "x$ac_cv_header_winsock2_h" = xyes then : printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "linux/vm_sockets.h" "ac_cv_header_linux_vm_sockets_h" "#include " if test "x$ac_cv_header_linux_vm_sockets_h" = xyes then : printf "%s\n" "#define HAVE_LINUX_VM_SOCKETS_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "accept4" "ac_cv_func_accept4" if test "x$ac_cv_func_accept4" = xyes then : printf "%s\n" "#define HAVE_ACCEPT4 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes then : printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "flockfile" "ac_cv_func_flockfile" if test "x$ac_cv_func_flockfile" = xyes then : printf "%s\n" "#define HAVE_FLOCKFILE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "funlockfile" "ac_cv_func_funlockfile" if test "x$ac_cv_func_funlockfile" = xyes then : printf "%s\n" "#define HAVE_FUNLOCKFILE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" if test "x$ac_cv_func_inet_ntop" = xyes then : printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" if test "x$ac_cv_func_inet_pton" = xyes then : printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkostemp" "ac_cv_func_mkostemp" if test "x$ac_cv_func_mkostemp" = xyes then : printf "%s\n" "#define HAVE_MKOSTEMP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mlock" "ac_cv_func_mlock" if test "x$ac_cv_func_mlock" = xyes then : printf "%s\n" "#define HAVE_MLOCK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" if test "x$ac_cv_func_mlockall" = xyes then : printf "%s\n" "#define HAVE_MLOCKALL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "munlock" "ac_cv_func_munlock" if test "x$ac_cv_func_munlock" = xyes then : printf "%s\n" "#define HAVE_MUNLOCK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "open_memstream" "ac_cv_func_open_memstream" if test "x$ac_cv_func_open_memstream" = xyes then : printf "%s\n" "#define HAVE_OPEN_MEMSTREAM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pipe" "ac_cv_func_pipe" if test "x$ac_cv_func_pipe" = xyes then : printf "%s\n" "#define HAVE_PIPE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" if test "x$ac_cv_func_pipe2" = xyes then : printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "ppoll" "ac_cv_func_ppoll" if test "x$ac_cv_func_ppoll" = xyes then : printf "%s\n" "#define HAVE_PPOLL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" if test "x$ac_cv_func_posix_fadvise" = xyes then : printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes then : printf "%s\n" "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "valloc" "ac_cv_func_valloc" if test "x$ac_cv_func_valloc" = xyes then : printf "%s\n" "#define HAVE_VALLOC 1" >>confdefs.h fi old_LIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing timer_create" >&5 printf %s "checking for library containing timer_create... " >&6; } if test ${ac_cv_search_timer_create+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char timer_create (void); int main (void) { return timer_create (); ; return 0; } _ACEOF for ac_lib in '' rt do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_timer_create=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_timer_create+y} then : break fi done if test ${ac_cv_search_timer_create+y} then : else case e in #( e) ac_cv_search_timer_create=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_create" >&5 printf "%s\n" "$ac_cv_search_timer_create" >&6; } ac_res=$ac_cv_search_timer_create if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" if test "x$ac_cv_search_timer_create" != "xnone required" then : RT_LIBS="$ac_cv_search_timer_create" else case e in #( e) RT_LIBS= ;; esac fi fi ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create" if test "x$ac_cv_func_timer_create" = xyes then : printf "%s\n" "#define HAVE_TIMER_CREATE 1" >>confdefs.h fi LIBS="$old_LIBS" ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" "#include " if test "x$ac_cv_member_struct_dirent_d_type" = xyes then : printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct ucred" "uid" "ac_cv_member_struct_ucred_uid" " #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UCRED_H #include #endif " if test "x$ac_cv_member_struct_ucred_uid" = xyes then : printf "%s\n" "#define HAVE_STRUCT_UCRED_UID 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockpeercred" "uid" "ac_cv_member_struct_sockpeercred_uid" " #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_member_struct_sockpeercred_uid" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKPEERCRED_UID 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes then : printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" fdatasync.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fdatasync.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "fsync" "ac_cv_func_fsync" if test "x$ac_cv_func_fsync" = xyes then : printf "%s\n" "#define HAVE_FSYNC 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" fsync.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fsync.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "get_current_dir_name" "ac_cv_func_get_current_dir_name" if test "x$ac_cv_func_get_current_dir_name" = xyes then : printf "%s\n" "#define HAVE_GET_CURRENT_DIR_NAME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" get_current_dir_name.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS get_current_dir_name.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getdelim" "ac_cv_func_getdelim" if test "x$ac_cv_func_getdelim" = xyes then : printf "%s\n" "#define HAVE_GETDELIM 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getdelim.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getdelim.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" if test "x$ac_cv_func_getline" = xyes then : printf "%s\n" "#define HAVE_GETLINE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getline.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getline.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "openlog" "ac_cv_func_openlog" if test "x$ac_cv_func_openlog" = xyes then : printf "%s\n" "#define HAVE_OPENLOG 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" openlog.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS openlog.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "open_memstream" "ac_cv_func_open_memstream" if test "x$ac_cv_func_open_memstream" = xyes then : printf "%s\n" "#define HAVE_OPEN_MEMSTREAM 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" open_memstream.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS open_memstream.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes then : printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" poll.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS poll.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes then : printf "%s\n" "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" posix_memalign.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS posix_memalign.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread" if test "x$ac_cv_func_pread" = xyes then : printf "%s\n" "#define HAVE_PREAD 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" pread.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS pread.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite" if test "x$ac_cv_func_pwrite" = xyes then : printf "%s\n" "#define HAVE_PWRITE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" pwrite.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS pwrite.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes then : printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" realpath.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realpath.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes then : printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strndup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strndup.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes then : printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" sysconf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS sysconf.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" if test "x$ac_cv_func_syslog" = xyes then : printf "%s\n" "#define HAVE_SYSLOG 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" syslog.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS syslog.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "vsyslog" "ac_cv_func_vsyslog" if test "x$ac_cv_func_vsyslog" = xyes then : printf "%s\n" "#define HAVE_VSYSLOG 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" vsyslog.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS vsyslog.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the printf family supports %m" >&5 printf %s "checking whether the printf family supports %m... " >&6; } if test ${nbdkit_cv_func_printf_percent_m+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : case "$host_os" in *-gnu* | gnu*) nbdkit_cv_func_printf_percent_m=yes;; *) nbdkit_cv_func_printf_percent_m="guessing no";; esac else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { char buf[200] = ""; errno = EINVAL; snprintf(buf, sizeof buf, "%m"); return !!strcmp (buf, strerror (EINVAL)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : nbdkit_cv_func_printf_percent_m=yes else case e in #( e) nbdkit_cv_func_printf_percent_m=no ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nbdkit_cv_func_printf_percent_m" >&5 printf "%s\n" "$nbdkit_cv_func_printf_percent_m" >&6; } if test "x$nbdkit_cv_func_printf_percent_m" = xyes then : printf "%s\n" "#define HAVE_VFPRINTF_PERCENT_M 1" >>confdefs.h fi old_LIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 printf %s "checking for library containing dlsym... " >&6; } if test ${ac_cv_search_dlsym+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlsym (void); int main (void) { return dlsym (); ; return 0; } _ACEOF for ac_lib in '' dl dld do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dlsym=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dlsym+y} then : break fi done if test ${ac_cv_search_dlsym+y} then : else case e in #( e) ac_cv_search_dlsym=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 printf "%s\n" "$ac_cv_search_dlsym" >&6; } ac_res=$ac_cv_search_dlsym if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" if test "x$ac_cv_search_dlsym" != "xnone required" then : DL_LIBS="$ac_cv_search_dlsym" else case e in #( e) DL_LIBS= ;; esac fi else case e in #( e) as_fn_error $? "unable to find the dlsym() function" "$LINENO" 5 ;; esac fi LIBS="$old_LIBS" old_LIBS="$LIBS" LIBS="$DL_LIBS $LIBS" ac_fn_c_check_func "$LINENO" "dladdr" "ac_cv_func_dladdr" if test "x$ac_cv_func_dladdr" = xyes then : printf "%s\n" "#define HAVE_DLADDR 1" >>confdefs.h fi LIBS="$old_LIBS" # Check whether --with-iconv was given. if test ${with_iconv+y} then : withval=$with_iconv; else case e in #( e) with_iconv=check ;; esac fi if test "x$with_iconv" != "xno" then : ac_fn_c_check_header_compile "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" if test "x$ac_cv_header_iconv_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if can be used to link a program" >&5 printf %s "checking if can be used to link a program... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (int argc, char *argv[]) { iconv_t ic = iconv_open ("", ""); iconv_close (ic); exit (0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } iconv_working=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi fi if test "x$iconv_working" = "xyes"; then HAVE_ICONV_TRUE= HAVE_ICONV_FALSE='#' else HAVE_ICONV_TRUE='#' HAVE_ICONV_FALSE= fi use_linker_script=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should disable the linker script (FreeBSD, macOS)" >&5 printf %s "checking if we should disable the linker script (FreeBSD, macOS)... " >&6; } case $host_os in #( freebsd*|darwin*) : use_linker_script=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; #( *) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac acx_nbdkit_save_LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS} -rdynamic" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if linker supports -rdynamic" >&5 printf %s "checking if linker supports -rdynamic... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (int argc, char *argv[]) { exit (EXIT_SUCCESS); } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } DL_LDFLAGS=-rdynamic else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="${acx_nbdkit_save_LDFLAGS}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the target is Windows" >&5 printf %s "checking if the target is Windows... " >&6; } case $host_os in #( mingw*|msys*) : is_windows=yes LIBS="$LIBS -lkernel32 -luser32 -lws2_32" NO_UNDEFINED_ON_WINDOWS="-no-undefined" IMPORT_LIBRARY_ON_WINDOWS='-Wl,-L$(top_builddir)/server -Wl,-lnbdkit' SOEXT="dll" DIR_SEPARATOR_STR='\\' ;; #( *) : is_windows=no SOEXT="so" DIR_SEPARATOR_STR=/ ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $is_windows" >&5 printf "%s\n" "$is_windows" >&6; } printf "%s\n" "#define SOEXT \"$SOEXT\"" >>confdefs.h printf "%s\n" "#define EXEEXT \"$EXEEXT\"" >>confdefs.h printf "%s\n" "#define DIR_SEPARATOR_STR \"$DIR_SEPARATOR_STR\"" >>confdefs.h if test "x$is_windows" = "xyes"; then IS_WINDOWS_TRUE= IS_WINDOWS_FALSE='#' else IS_WINDOWS_TRUE='#' IS_WINDOWS_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in windmc mc.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MC"; then ac_cv_prog_MC="$MC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MC=$ac_cv_prog_MC if test -n "$MC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MC" >&5 printf "%s\n" "$MC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$MC" && break done fi if test -z "$MC"; then ac_ct_MC=$MC for ac_prog in windmc mc.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MC"; then ac_cv_prog_ac_ct_MC="$ac_ct_MC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MC=$ac_cv_prog_ac_ct_MC if test -n "$ac_ct_MC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MC" >&5 printf "%s\n" "$ac_ct_MC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_MC" && break done if test "x$ac_ct_MC" = x; then MC="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MC=$ac_ct_MC fi fi if test "x$MC" != "xno"; then HAVE_MC_TRUE= HAVE_MC_FALSE='#' else HAVE_MC_TRUE='#' HAVE_MC_FALSE= fi if test "x$is_windows" = "xyes" then : if test -n "$ac_tool_prefix"; then for ac_prog in dlltool 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DLLTOOL" && break done fi if test -z "$DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL for ac_prog in dlltool do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DLLTOOL" && break done if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi fi if test "x$DLLTOOL" = "xno" then : as_fn_error $? "dlltool utility must be available when compiling for Windows" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 printf %s "checking for library containing getaddrinfo... " >&6; } if test ${ac_cv_search_getaddrinfo+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (void); int main (void) { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' network socket do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_getaddrinfo+y} then : break fi done if test ${ac_cv_search_getaddrinfo+y} then : else case e in #( e) ac_cv_search_getaddrinfo=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 printf "%s\n" "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if this is glibc >= 2.34" >&5 printf %s "checking if this is glibc >= 2.34... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 34) #error "not glibc 2.34" #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if (LD_PRELOAD=libc_malloc_debug.so.0 /bin/true) 2>&1 | grep .; then is_glibc_234='missing suitable libc_malloc_debug.so.0' else is_glibc_234=yes fi else case e in #( e) is_glibc_234=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $is_glibc_234" >&5 printf "%s\n" "$is_glibc_234" >&6; } if test "x$is_glibc_234" = "xyes"; then HAVE_GLIBC_234_TRUE= HAVE_GLIBC_234_FALSE='#' else HAVE_GLIBC_234_TRUE='#' HAVE_GLIBC_234_FALSE= fi # Check whether --with-selinux was given. if test ${with_selinux+y} then : withval=$with_selinux; fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi if test -z "$PKG_CONFIG"; then as_fn_error $? "pkg-config not found" "$LINENO" 5 fi if test "x$with_selinux" != xno then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libselinux" >&5 printf %s "checking for libselinux... " >&6; } if test -n "$LIBSELINUX_CFLAGS"; then pkg_cv_LIBSELINUX_CFLAGS="$LIBSELINUX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBSELINUX_CFLAGS=`$PKG_CONFIG --cflags "libselinux" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBSELINUX_LIBS"; then pkg_cv_LIBSELINUX_LIBS="$LIBSELINUX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBSELINUX_LIBS=`$PKG_CONFIG --libs "libselinux" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBSELINUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libselinux" 2>&1` else LIBSELINUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libselinux" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBSELINUX_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libselinux not found, sockets will not be labeled." >&5 printf "%s\n" "$as_me: WARNING: libselinux not found, sockets will not be labeled." >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libselinux not found, sockets will not be labeled." >&5 printf "%s\n" "$as_me: WARNING: libselinux not found, sockets will not be labeled." >&2;} else LIBSELINUX_CFLAGS=$pkg_cv_LIBSELINUX_CFLAGS LIBSELINUX_LIBS=$pkg_cv_LIBSELINUX_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_LIBSELINUX 1" >>confdefs.h fi fi if test "x$with_selinux" = xyes && test "x$LIBSELINUX_LIBS" = x then : as_fn_error $? "selinux requested but not found" "$LINENO" 5 fi # Check whether --with-gnutls was given. if test ${with_gnutls+y} then : withval=$with_gnutls; fi if test "x$with_gnutls" != xno then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 3.5.18" >&5 printf %s "checking for gnutls >= 3.5.18... " >&6; } if test -n "$GNUTLS_CFLAGS"; then pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.5.18\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 3.5.18") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 3.5.18" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GNUTLS_LIBS"; then pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.5.18\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 3.5.18") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 3.5.18" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 3.5.18" 2>&1` else GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 3.5.18" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GNUTLS_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: gnutls not found or < 3.5.18, TLS support will be disabled." >&5 printf "%s\n" "$as_me: WARNING: gnutls not found or < 3.5.18, TLS support will be disabled." >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: gnutls not found or < 3.5.18, TLS support will be disabled." >&5 printf "%s\n" "$as_me: WARNING: gnutls not found or < 3.5.18, TLS support will be disabled." >&2;} else GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_GNUTLS 1" >>confdefs.h fi fi if test "x$with_gnutls" = xyes && test x"$GNUTLS_LIBS" = x then : as_fn_error $? "gnutls requested but not found" "$LINENO" 5 fi if test "x$GNUTLS_LIBS" != "x"; then HAVE_GNUTLS_TRUE= HAVE_GNUTLS_FALSE='#' else HAVE_GNUTLS_TRUE='#' HAVE_GNUTLS_FALSE= fi if test "x$GNUTLS_LIBS" != "x" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for default TLS session priority string" >&5 printf %s "checking for default TLS session priority string... " >&6; } # Check whether --with-tls-priority was given. if test ${with_tls_priority+y} then : withval=$with_tls_priority; tls_priority=$withval else case e in #( e) tls_priority=NORMAL ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tls_priority" >&5 printf "%s\n" "$tls_priority" >&6; } printf "%s\n" "#define TLS_PRIORITY \"$tls_priority\"" >>confdefs.h # Check for working . This is only needed for # gnutls 3.7.9 and no other version (unfortunately used by Debian # 12 and others). In that release kTLS functionality was added to # incorrectly, before being moved to # in 3.8.0. breaks on # Windows, so we must make inclusion conditional. When we move # the minimum version of gnutls >= 3.8.0 we can get rid of this. old_CFLAGS="$CFLAGS" CFLAGS="$GNUTLS_CFLAGS $CFLAGS" ac_fn_c_check_header_compile "$LINENO" "gnutls/socket.h" "ac_cv_header_gnutls_socket_h" "$ac_includes_default" if test "x$ac_cv_header_gnutls_socket_h" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_SOCKET_H 1" >>confdefs.h fi CFLAGS="$old_CFLAGS" # Check for APIs which may not be present. old_LIBS="$LIBS" LIBS="$GNUTLS_LIBS $LIBS" ac_fn_c_check_func "$LINENO" "gnutls_base64_decode2" "ac_cv_func_gnutls_base64_decode2" if test "x$ac_cv_func_gnutls_base64_decode2" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_BASE64_DECODE2 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_certificate_set_known_dh_params" "ac_cv_func_gnutls_certificate_set_known_dh_params" if test "x$ac_cv_func_gnutls_certificate_set_known_dh_params" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_CERTIFICATE_SET_KNOWN_DH_PARAMS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_group_get" "ac_cv_func_gnutls_group_get" if test "x$ac_cv_func_gnutls_group_get" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_GROUP_GET 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_group_get_name" "ac_cv_func_gnutls_group_get_name" if test "x$ac_cv_func_gnutls_group_get_name" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_GROUP_GET_NAME 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_pbkdf2" "ac_cv_func_gnutls_pbkdf2" if test "x$ac_cv_func_gnutls_pbkdf2" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_PBKDF2 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_srp_server_get_username" "ac_cv_func_gnutls_srp_server_get_username" if test "x$ac_cv_func_gnutls_srp_server_get_username" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_SRP_SERVER_GET_USERNAME 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gnutls_transport_is_ktls_enabled" "ac_cv_func_gnutls_transport_is_ktls_enabled" if test "x$ac_cv_func_gnutls_transport_is_ktls_enabled" = xyes then : printf "%s\n" "#define HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED 1" >>confdefs.h fi LIBS="$old_LIBS" for ac_prog in gnutls-certtool certtool do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CERTTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CERTTOOL"; then ac_cv_prog_CERTTOOL="$CERTTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CERTTOOL="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CERTTOOL=$ac_cv_prog_CERTTOOL if test -n "$CERTTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CERTTOOL" >&5 printf "%s\n" "$CERTTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CERTTOOL" && break done test -n "$CERTTOOL" || CERTTOOL="certtool" fi if test "x$GNUTLS_LIBS" != "x" && test "x$ac_cv_func_gnutls_pbkdf2" = xyes; then HAVE_GNUTLS_PBKDF2_TRUE= HAVE_GNUTLS_PBKDF2_FALSE='#' else HAVE_GNUTLS_PBKDF2_TRUE='#' HAVE_GNUTLS_PBKDF2_FALSE= fi for ac_prog in gnucut cut do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CUT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CUT"; then ac_cv_prog_CUT="$CUT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CUT="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CUT=$ac_cv_prog_CUT if test -n "$CUT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 printf "%s\n" "$CUT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CUT" && break done test -n "$CUT" || CUT="cut" for ac_prog in gstat stat do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STAT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STAT"; then ac_cv_prog_STAT="$STAT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STAT="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STAT=$ac_cv_prog_STAT if test -n "$STAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5 printf "%s\n" "$STAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$STAT" && break done test -n "$STAT" || STAT="stat" for ac_prog in gtruncate truncate do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_TRUNCATE+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$TRUNCATE"; then ac_cv_prog_TRUNCATE="$TRUNCATE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_TRUNCATE="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi TRUNCATE=$ac_cv_prog_TRUNCATE if test -n "$TRUNCATE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TRUNCATE" >&5 printf "%s\n" "$TRUNCATE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$TRUNCATE" && break done test -n "$TRUNCATE" || TRUNCATE="truncate" # Extract the first word of "valgrind", so it can be a program name with args. set dummy valgrind; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_VALGRIND+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$VALGRIND"; then ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_VALGRIND="valgrind" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_VALGRIND" && ac_cv_prog_VALGRIND="no" fi ;; esac fi VALGRIND=$ac_cv_prog_VALGRIND if test -n "$VALGRIND"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 printf "%s\n" "$VALGRIND" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Check whether --enable-valgrind was given. if test ${enable_valgrind+y} then : enableval=$enable_valgrind; else case e in #( e) enable_valgrind=check ;; esac fi if test "x$enable_valgrind" != "xno" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valgrind" >&5 printf %s "checking for valgrind... " >&6; } if test -n "$VALGRIND_CFLAGS"; then pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind\""; } >&5 ($PKG_CONFIG --exists --print-errors "valgrind") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_VALGRIND_CFLAGS=`$PKG_CONFIG --cflags "valgrind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$VALGRIND_LIBS"; then pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind\""; } >&5 ($PKG_CONFIG --exists --print-errors "valgrind") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_VALGRIND_LIBS=`$PKG_CONFIG --libs "valgrind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "valgrind" 2>&1` else VALGRIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "valgrind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$VALGRIND_PKG_ERRORS" >&5 if test "x$enable_valgrind" = "xyes" then : as_fn_error $? "--enable-valgrind given, but Valgrind headers are not available" "$LINENO" 5 fi elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if test "x$enable_valgrind" = "xyes" then : as_fn_error $? "--enable-valgrind given, but Valgrind headers are not available" "$LINENO" 5 fi else VALGRIND_CFLAGS=$pkg_cv_VALGRIND_CFLAGS VALGRIND_LIBS=$pkg_cv_VALGRIND_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_VALGRIND 1" >>confdefs.h fi fi # Check whether --enable-libfuzzer was given. if test ${enable_libfuzzer+y} then : enableval=$enable_libfuzzer; else case e in #( e) enable_libfuzzer=no ;; esac fi if test "x$enable_libfuzzer" = "xyes" then : printf "%s\n" "#define ENABLE_LIBFUZZER 1" >>confdefs.h # We have to disable the linker script for libFuzzer because Clang # adds loads of fuzzer and ASAN-related symbols that are required # by the plugins but which our linker script tries to hide. use_linker_script=no fi if test "x$enable_libfuzzer" = "xyes"; then ENABLE_LIBFUZZER_TRUE= ENABLE_LIBFUZZER_FALSE='#' else ENABLE_LIBFUZZER_TRUE='#' ENABLE_LIBFUZZER_FALSE= fi # Check whether --enable-linker-script was given. if test ${enable_linker_script+y} then : enableval=$enable_linker_script; use_linker_script=$enableval fi if test "x$use_linker_script" = "xyes"; then USE_LINKER_SCRIPT_TRUE= USE_LINKER_SCRIPT_FALSE='#' else USE_LINKER_SCRIPT_TRUE='#' USE_LINKER_SCRIPT_FALSE= fi # Check whether --with-bash-completions was given. if test ${with_bash_completions+y} then : withval=$with_bash_completions; fi if test "x$with_bash_completions" != xno then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bash-completion >= 2.0" >&5 printf %s "checking for bash-completion >= 2.0... " >&6; } if test -n "$BASH_COMPLETION_CFLAGS"; then pkg_cv_BASH_COMPLETION_CFLAGS="$BASH_COMPLETION_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_CFLAGS=`$PKG_CONFIG --cflags "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$BASH_COMPLETION_LIBS"; then pkg_cv_BASH_COMPLETION_LIBS="$BASH_COMPLETION_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BASH_COMPLETION_LIBS=`$PKG_CONFIG --libs "bash-completion >= 2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` else BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BASH_COMPLETION_PKG_ERRORS" >&5 bash_completion=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: bash-completion not installed" >&5 printf "%s\n" "$as_me: WARNING: bash-completion not installed" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } bash_completion=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: bash-completion not installed" >&5 printf "%s\n" "$as_me: WARNING: bash-completion not installed" >&2;} else BASH_COMPLETION_CFLAGS=$pkg_cv_BASH_COMPLETION_CFLAGS BASH_COMPLETION_LIBS=$pkg_cv_BASH_COMPLETION_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } bash_completion=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bash-completions directory" >&5 printf %s "checking for bash-completions directory... " >&6; } if test -n "$bashcompdir"; then pkg_cv_bashcompdir="$bashcompdir" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion\""; } >&5 ($PKG_CONFIG --exists --print-errors "bash-completion") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_bashcompdir=`$PKG_CONFIG --variable="completionsdir" "bash-completion" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi bashcompdir=$pkg_cv_bashcompdir if test "x$bashcompdir" = x"" then : fi if test -z "$bashcompdir" then : bashcompdir="${sysconfdir}/bash_completion.d" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bashcompdir" >&5 printf "%s\n" "$bashcompdir" >&6; } fi fi if test "x$bash_completion" = xno && test "x$with_bash_completions" = xyes then : as_fn_error $? "bash-completions requested but required packages not found" "$LINENO" 5 fi if test "x$bash_completion" = "xyes"; then HAVE_BASH_COMPLETION_TRUE= HAVE_BASH_COMPLETION_FALSE='#' else HAVE_BASH_COMPLETION_TRUE='#' HAVE_BASH_COMPLETION_FALSE= fi # Check whether --with-manpages was given. if test ${with_manpages+y} then : withval=$with_manpages; else case e in #( e) : ;; esac fi enable_pod=no for ac_prog in perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PERL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 printf "%s\n" "$PERL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PERL" && break done if test "x$with_manpages" != xno then : if test "x$PERL" != "x" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have perl Pod::Man and Pod::Simple" >&5 printf %s "checking if we have perl Pod::Man and Pod::Simple... " >&6; } if $PERL -MPod::Man -MPod::Simple -e 1 >&5 2>&1 then : enable_pod=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_pod" >&5 printf "%s\n" "$enable_pod" >&6; } fi fi if test "x$enable_pod" = xno && test "x$with_manpages" = xyes then : as_fn_error $? "man-pages requested but required packages not found" "$LINENO" 5 fi if test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"; then HAVE_POD_TRUE= HAVE_POD_FALSE='#' else HAVE_POD_TRUE='#' HAVE_POD_FALSE= fi PODWRAPPER="$PERL $(pwd)/podwrapper.pl" # Check whether --enable-plugins was given. if test ${enable_plugins+y} then : enableval=$enable_plugins; fi if test "x$enable_plugins" != "xno"; then HAVE_PLUGINS_TRUE= HAVE_PLUGINS_FALSE='#' else HAVE_PLUGINS_TRUE='#' HAVE_PLUGINS_FALSE= fi : "${CC_PLUGIN_CC:=$CC}" : "${CC_PLUGIN_CFLAGS:=$CFLAGS}" # Check whether --enable-perl was given. if test ${enable_perl+y} then : enableval=$enable_perl; else case e in #( e) enable_perl=yes ;; esac fi if test "x$PERL" != "xno" && test "x$enable_perl" != "xno" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Perl embed archlib" >&5 printf %s "checking for Perl embed archlib... " >&6; } PERL_ARCHLIB="$($PERL -MConfig -e 'print $Config{archlib}')" if test -n "$PERL_ARCHLIB" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL_ARCHLIB" >&5 printf "%s\n" "$PERL_ARCHLIB" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Perl embed module disabled" >&5 printf "%s\n" "$as_me: Perl embed module disabled" >&6;} enable_perl=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Perl embed CFLAGS" >&5 printf %s "checking for Perl embed CFLAGS... " >&6; } PERL_CFLAGS="$($PERL -MExtUtils::Embed -e 'ccflags')" if test -n "$PERL_CFLAGS" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL_CFLAGS" >&5 printf "%s\n" "$PERL_CFLAGS" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Perl embed module disabled" >&5 printf "%s\n" "$as_me: Perl embed module disabled" >&6;} enable_perl=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Perl embed LDOPTS" >&5 printf %s "checking for Perl embed LDOPTS... " >&6; } PERL_LDOPTS="$($PERL -MExtUtils::Embed -e 'ldopts')" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL_LDOPTS" >&5 printf "%s\n" "$PERL_LDOPTS" >&6; } old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$PERL_CFLAGS -I$PERL_ARCHLIB/CORE $CFLAGS" LIBS="$PERL_LDOPTS $LIBS" ac_fn_c_check_func "$LINENO" "perl_alloc" "ac_cv_func_perl_alloc" if test "x$ac_cv_func_perl_alloc" = xyes then : printf "%s\n" "#define HAVE_PERL_ALLOC 1" >>confdefs.h fi CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Perl modules will compile" >&5 printf %s "checking whether Perl modules will compile... " >&6; } if test "x$ac_cv_func_perl_alloc" = xyes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } enable_perl=no fi fi if test "x$enable_perl" != "xno" && test "x$PERL" != "xno"; then HAVE_PERL_TRUE= HAVE_PERL_FALSE='#' else HAVE_PERL_TRUE='#' HAVE_PERL_FALSE= fi for ac_prog in python3 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PYTHON+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 printf "%s\n" "$PYTHON" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$PYTHON" && break done test -n "$PYTHON" || PYTHON="no" # Check whether --enable-python was given. if test ${enable_python+y} then : enableval=$enable_python; else case e in #( e) enable_python=yes ;; esac fi if test "x$PYTHON" != "xno" && test "x$enable_python" != "xno" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $PYTHON" >&5 printf %s "checking version of $PYTHON... " >&6; } PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info[0])"` PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info[1])"` PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR" if test -n "$PYTHON_VERSION" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_VERSION" >&5 printf "%s\n" "$PYTHON_VERSION" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Python embed module disabled" >&5 printf "%s\n" "$as_me: Python embed module disabled" >&6;} enable_python=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Python major version is 3" >&5 printf %s "checking Python major version is 3... " >&6; } if test "x$PYTHON_VERSION_MAJOR" = "x3" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Python $PYTHON_VERSION_MAJOR <> 3 is no longer supported. Python 2 end of life was 2020-01-01 and nbdkit >= 1.16 no longer supports it. If you want to use Python 2, you will need to use nbdkit 1.14." "$LINENO" 5 ;; esac fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python-$PYTHON_VERSION-embed" >&5 printf %s "checking for python-$PYTHON_VERSION-embed... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION-embed\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION-embed") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python-$PYTHON_VERSION-embed" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION-embed\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION-embed") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python-$PYTHON_VERSION-embed" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python-$PYTHON_VERSION-embed" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python-$PYTHON_VERSION-embed" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python-$PYTHON_VERSION" >&5 printf %s "checking for python-$PYTHON_VERSION... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python-$PYTHON_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python-$PYTHON_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python-$PYTHON_VERSION" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python-$PYTHON_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5 printf %s "checking for python... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5 printf %s "checking for python... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python-$PYTHON_VERSION" >&5 printf %s "checking for python-$PYTHON_VERSION... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python-$PYTHON_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-\$PYTHON_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-$PYTHON_VERSION") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python-$PYTHON_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python-$PYTHON_VERSION" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python-$PYTHON_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5 printf %s "checking for python... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5 printf %s "checking for python... " >&6; } if test -n "$PYTHON_CFLAGS"; then pkg_cv_PYTHON_CFLAGS="$PYTHON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYTHON_LIBS"; then pkg_cv_PYTHON_LIBS="$PYTHON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHON_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYTHON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "python" 2>&1` else PYTHON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "python" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYTHON_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python $PYTHON_VERSION not found" >&5 printf "%s\n" "$as_me: WARNING: python $PYTHON_VERSION not found" >&2;} enable_python=no else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi else PYTHON_CFLAGS=$pkg_cv_PYTHON_CFLAGS PYTHON_LIBS=$pkg_cv_PYTHON_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PYTHON 1" >>confdefs.h fi fi if test "x$enable_python" != "xno" && test "x$PYTHON" != "xno"; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi # checking for ocamlc if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLC"; then ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLC=$ac_cv_prog_OCAMLC if test -n "$OCAMLC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 printf "%s\n" "$OCAMLC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLC"; then ac_ct_OCAMLC=$OCAMLC # Extract the first word of "ocamlc", so it can be a program name with args. set dummy ocamlc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLC"; then ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLC="ocamlc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC if test -n "$ac_ct_OCAMLC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 printf "%s\n" "$ac_ct_OCAMLC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLC" = x; then OCAMLC="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLC=$ac_ct_OCAMLC fi else OCAMLC="$ac_cv_prog_OCAMLC" fi if test "$OCAMLC" != "no"; then OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 printf "%s\n" "OCaml version is $OCAMLVERSION" >&6; } # If OCAMLLIB is set, use it if test "$OCAMLLIB" = ""; then OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5 printf "%s\n" "OCAMLLIB previously set; preserving it." >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 printf "%s\n" "OCaml library path is $OCAMLLIB" >&6; } # checking for ocamlopt if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLOPT"; then ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLOPT=$ac_cv_prog_OCAMLOPT if test -n "$OCAMLOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 printf "%s\n" "$OCAMLOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLOPT"; then ac_ct_OCAMLOPT=$OCAMLOPT # Extract the first word of "ocamlopt", so it can be a program name with args. set dummy ocamlopt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLOPT"; then ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT if test -n "$ac_ct_OCAMLOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 printf "%s\n" "$ac_ct_OCAMLOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLOPT" = x; then OCAMLOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLOPT=$ac_ct_OCAMLOPT fi else OCAMLOPT="$ac_cv_prog_OCAMLOPT" fi OCAMLBEST=byte if test "$OCAMLOPT" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 printf "%s\n" "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} else TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5 printf "%s\n" "versions differs from ocamlc; ocamlopt discarded." >&6; } OCAMLOPT=no else OCAMLBEST=opt fi fi # checking for ocamlc.opt if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLCDOTOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLCDOTOPT"; then ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT if test -n "$OCAMLCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 printf "%s\n" "$OCAMLCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT # Extract the first word of "ocamlc.opt", so it can be a program name with args. set dummy ocamlc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLCDOTOPT"; then ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT if test -n "$ac_ct_OCAMLCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLCDOTOPT" = x; then OCAMLCDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT fi else OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" fi if test "$OCAMLCDOTOPT" != "no"; then TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5 printf "%s\n" "versions differs from ocamlc; ocamlc.opt discarded." >&6; } else OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != "no" ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLOPTDOTOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLOPTDOTOPT"; then ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT if test -n "$OCAMLOPTDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 printf "%s\n" "$OCAMLOPTDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT # Extract the first word of "ocamlopt.opt", so it can be a program name with args. set dummy ocamlopt.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLOPTDOTOPT"; then ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT if test -n "$ac_ct_OCAMLOPTDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLOPTDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then OCAMLOPTDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT fi else OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" fi if test "$OCAMLOPTDOTOPT" != "no"; then TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5 printf "%s\n" "version differs from ocamlc; ocamlopt.opt discarded." >&6; } else OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi fi # checking for ocaml toplevel if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args. set dummy ${ac_tool_prefix}ocaml; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAML+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAML"; then ac_cv_prog_OCAML="$OCAML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAML="${ac_tool_prefix}ocaml" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAML=$ac_cv_prog_OCAML if test -n "$OCAML"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5 printf "%s\n" "$OCAML" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAML"; then ac_ct_OCAML=$OCAML # Extract the first word of "ocaml", so it can be a program name with args. set dummy ocaml; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAML+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAML"; then ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAML="ocaml" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML if test -n "$ac_ct_OCAML"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5 printf "%s\n" "$ac_ct_OCAML" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAML" = x; then OCAML="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAML=$ac_ct_OCAML fi else OCAML="$ac_cv_prog_OCAML" fi # checking for ocamldep if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDEP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLDEP"; then ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLDEP=$ac_cv_prog_OCAMLDEP if test -n "$OCAMLDEP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 printf "%s\n" "$OCAMLDEP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDEP"; then ac_ct_OCAMLDEP=$OCAMLDEP # Extract the first word of "ocamldep", so it can be a program name with args. set dummy ocamldep; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDEP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLDEP"; then ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP if test -n "$ac_ct_OCAMLDEP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 printf "%s\n" "$ac_ct_OCAMLDEP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDEP" = x; then OCAMLDEP="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDEP=$ac_ct_OCAMLDEP fi else OCAMLDEP="$ac_cv_prog_OCAMLDEP" fi # checking for ocamlmktop if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLMKTOP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLMKTOP"; then ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP if test -n "$OCAMLMKTOP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 printf "%s\n" "$OCAMLMKTOP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLMKTOP"; then ac_ct_OCAMLMKTOP=$OCAMLMKTOP # Extract the first word of "ocamlmktop", so it can be a program name with args. set dummy ocamlmktop; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLMKTOP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLMKTOP"; then ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP if test -n "$ac_ct_OCAMLMKTOP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 printf "%s\n" "$ac_ct_OCAMLMKTOP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLMKTOP" = x; then OCAMLMKTOP="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLMKTOP=$ac_ct_OCAMLMKTOP fi else OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" fi # checking for ocamlmklib if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLMKLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLMKLIB"; then ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB if test -n "$OCAMLMKLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 printf "%s\n" "$OCAMLMKLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLMKLIB"; then ac_ct_OCAMLMKLIB=$OCAMLMKLIB # Extract the first word of "ocamlmklib", so it can be a program name with args. set dummy ocamlmklib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLMKLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLMKLIB"; then ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB if test -n "$ac_ct_OCAMLMKLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 printf "%s\n" "$ac_ct_OCAMLMKLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLMKLIB" = x; then OCAMLMKLIB="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLMKLIB=$ac_ct_OCAMLMKLIB fi else OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" fi # checking for ocamldoc if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDOC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLDOC"; then ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLDOC=$ac_cv_prog_OCAMLDOC if test -n "$OCAMLDOC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 printf "%s\n" "$OCAMLDOC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDOC"; then ac_ct_OCAMLDOC=$OCAMLDOC # Extract the first word of "ocamldoc", so it can be a program name with args. set dummy ocamldoc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDOC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLDOC"; then ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC if test -n "$ac_ct_OCAMLDOC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 printf "%s\n" "$ac_ct_OCAMLDOC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDOC" = x; then OCAMLDOC="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDOC=$ac_ct_OCAMLDOC fi else OCAMLDOC="$ac_cv_prog_OCAMLDOC" fi # checking for ocamlbuild if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLBUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OCAMLBUILD"; then ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OCAMLBUILD=$ac_cv_prog_OCAMLBUILD if test -n "$OCAMLBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 printf "%s\n" "$OCAMLBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLBUILD"; then ac_ct_OCAMLBUILD=$OCAMLBUILD # Extract the first word of "ocamlbuild", so it can be a program name with args. set dummy ocamlbuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLBUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OCAMLBUILD"; then ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD if test -n "$ac_ct_OCAMLBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 printf "%s\n" "$ac_ct_OCAMLBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLBUILD" = x; then OCAMLBUILD="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLBUILD=$ac_ct_OCAMLBUILD fi else OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" fi # Check whether --enable-ocaml was given. if test ${enable_ocaml+y} then : enableval=$enable_ocaml; else case e in #( e) enable_ocaml=yes ;; esac fi if test "x$OCAMLOPT" != "xno" && test "x$enable_ocaml" != "xno" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $OCAMLOPT can create a shared library" >&5 printf %s "checking if $OCAMLOPT can create a shared library... " >&6; } echo 'print_endline "test"' > conftest.ml if $OCAMLOPT $OCAMLOPTFLAGS -output-obj -runtime-variant _pic -o conftest.so conftest.ml >&5 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ocaml_link_shared=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f conftest.ml conftest.cmi conftest.cmx conftest.so conftest.o fi if test "x$OCAMLOPT" != "xno" && test "x$ocaml_link_shared" = "xyes"; then HAVE_OCAML_TRUE= HAVE_OCAML_FALSE='#' else HAVE_OCAML_TRUE='#' HAVE_OCAML_FALSE= fi if test "x$OCAMLDOC" != "xno"; then HAVE_OCAMLDOC_TRUE= HAVE_OCAMLDOC_FALSE='#' else HAVE_OCAMLDOC_TRUE='#' HAVE_OCAMLDOC_FALSE= fi if test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && \ test "x$enable_ocaml" = "xyes" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking major version of OCaml" >&5 printf %s "checking major version of OCaml... " >&6; } OCAML_MAJOR=` echo $OCAMLVERSION | $SED 's/\([[:digit:]]*\).*/\1/' ` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAML_MAJOR" >&5 printf "%s\n" "$OCAML_MAJOR" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for what libraries are needed for OCaml plugins" >&5 printf %s "checking for what libraries are needed for OCaml plugins... " >&6; } if test $OCAML_MAJOR -ge 5 then : OCAML_STD_INCLUDES="-I +unix -I +threads" # bigarray is part of the stdlib in OCaml >= 5 OCAML_PLUGIN_LIBRARIES="unix.cmxa threads.cmxa" else case e in #( e) OCAML_STD_INCLUDES="" OCAML_PLUGIN_LIBRARIES="unix.cmxa bigarray.cmxa" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAML_STD_INCLUDES $OCAML_PLUGIN_LIBRARIES" >&5 printf "%s\n" "$OCAML_STD_INCLUDES $OCAML_PLUGIN_LIBRARIES" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for caml_alloc_initialized_string" >&5 printf %s "checking for caml_alloc_initialized_string... " >&6; } cat >conftest.c <<'EOF' #include int main () { char *p = (void *) caml_alloc_initialized_string; return 0; } EOF if $OCAMLC conftest.c >&5 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CAML_ALLOC_INITIALIZED_STRING 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f conftest.c conftest.o { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for caml_shutdown" >&5 printf %s "checking for caml_shutdown... " >&6; } cat >conftest.c <<'EOF' #include int main () { char *p = (void *) caml_shutdown; return 0; } EOF if $OCAMLC conftest.c >&5 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CAML_SHUTDOWN 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f conftest.c conftest.o { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for caml/socketaddr.h" >&5 printf %s "checking for caml/socketaddr.h... " >&6; } cat >conftest.c <<'EOF' #include #include int main () { return 0; } EOF if $OCAMLC conftest.c >&5 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CAML_SOCKETADDR_H 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f conftest.c conftest.o { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for caml_unix_alloc_sockaddr" >&5 printf %s "checking for caml_unix_alloc_sockaddr... " >&6; } cat >conftest.c <<'EOF' #include #include int main () { char *p = (void *) caml_unix_alloc_sockaddr; return 0; } EOF if $OCAMLC conftest.c >&5 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CAML_UNIX_ALLOC_SOCKADDR 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f conftest.c conftest.o fi # Extract the first word of "cargo", so it can be a program name with args. set dummy cargo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CARGO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CARGO"; then ac_cv_prog_CARGO="$CARGO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CARGO="cargo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CARGO" && ac_cv_prog_CARGO="no" fi ;; esac fi CARGO=$ac_cv_prog_CARGO if test -n "$CARGO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CARGO" >&5 printf "%s\n" "$CARGO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "rustc", so it can be a program name with args. set dummy rustc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RUSTC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RUSTC"; then ac_cv_prog_RUSTC="$RUSTC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RUSTC="rustc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_RUSTC" && ac_cv_prog_RUSTC="no" fi ;; esac fi RUSTC=$ac_cv_prog_RUSTC if test -n "$RUSTC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RUSTC" >&5 printf "%s\n" "$RUSTC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Check whether --enable-rust was given. if test ${enable_rust+y} then : enableval=$enable_rust; else case e in #( e) if test "x$(realpath $srcdir)" = "x$(realpath .)"; then enable_rust=yes else enable_rust=no fi ;; esac fi if test "x$enable_rust" != "xno" && test "x$CARGO" != "xno" && test "x$RUSTC" != "xno" then : have_rust=yes else case e in #( e) have_rust=no ;; esac fi if test "x$have_rust" = "xyes"; then HAVE_RUST_TRUE= HAVE_RUST_FALSE='#' else HAVE_RUST_TRUE='#' HAVE_RUST_FALSE= fi if test "x$have_rust" = "xyes" then : printf "cargo version: "; $CARGO --version printf "rustc version: "; $RUSTC --version fi # Check whether --enable-tcl was given. if test ${enable_tcl+y} then : enableval=$enable_tcl; else case e in #( e) enable_tcl=yes ;; esac fi if test "x$enable_tcl" != "xno" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tcl" >&5 printf %s "checking for tcl... " >&6; } if test -n "$TCL_CFLAGS"; then pkg_cv_TCL_CFLAGS="$TCL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tcl\""; } >&5 ($PKG_CONFIG --exists --print-errors "tcl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TCL_CFLAGS=`$PKG_CONFIG --cflags "tcl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TCL_LIBS"; then pkg_cv_TCL_LIBS="$TCL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tcl\""; } >&5 ($PKG_CONFIG --exists --print-errors "tcl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TCL_LIBS=`$PKG_CONFIG --libs "tcl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TCL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "tcl" 2>&1` else TCL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "tcl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TCL_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Tcl not found" >&5 printf "%s\n" "$as_me: WARNING: Tcl not found" >&2;} enable_tcl=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Tcl not found" >&5 printf "%s\n" "$as_me: WARNING: Tcl not found" >&2;} enable_tcl=no else TCL_CFLAGS=$pkg_cv_TCL_CFLAGS TCL_LIBS=$pkg_cv_TCL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi if test "x$enable_tcl" = "xyes"; then HAVE_TCL_TRUE= HAVE_TCL_FALSE='#' else HAVE_TCL_TRUE='#' HAVE_TCL_FALSE= fi # Check whether --enable-lua was given. if test ${enable_lua+y} then : enableval=$enable_lua; else case e in #( e) enable_lua=yes ;; esac fi if test "x$enable_lua" != "xno" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lua" >&5 printf %s "checking for lua... " >&6; } if test -n "$LUA_CFLAGS"; then pkg_cv_LUA_CFLAGS="$LUA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 ($PKG_CONFIG --exists --print-errors "lua") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LUA_LIBS"; then pkg_cv_LUA_LIBS="$LUA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 ($PKG_CONFIG --exists --print-errors "lua") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` else LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LUA_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Lua not found" >&5 printf "%s\n" "$as_me: WARNING: Lua not found" >&2;} enable_lua=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Lua not found" >&5 printf "%s\n" "$as_me: WARNING: Lua not found" >&2;} enable_lua=no else LUA_CFLAGS=$pkg_cv_LUA_CFLAGS LUA_LIBS=$pkg_cv_LUA_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } old_LIBS="$LIBS" LIBS="$LUA_LIBS $LIBS" ac_fn_c_check_func "$LINENO" "lua_isinteger" "ac_cv_func_lua_isinteger" if test "x$ac_cv_func_lua_isinteger" = xyes then : printf "%s\n" "#define HAVE_LUA_ISINTEGER 1" >>confdefs.h fi LIBS="$old_LIBS" fi fi if test "x$enable_lua" = "xyes"; then HAVE_LUA_TRUE= HAVE_LUA_FALSE='#' else HAVE_LUA_TRUE='#' HAVE_LUA_FALSE= fi # Check whether --enable-golang was given. if test ${enable_golang+y} then : enableval=$enable_golang; else case e in #( e) enable_golang=yes ;; esac fi if test "x$enable_golang" != "xno" then : # Extract the first word of "go", so it can be a program name with args. set dummy go; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GOLANG+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$GOLANG"; then ac_cv_prog_GOLANG="$GOLANG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_GOLANG="go" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GOLANG" && ac_cv_prog_GOLANG="no" fi ;; esac fi GOLANG=$ac_cv_prog_GOLANG if test -n "$GOLANG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GOLANG" >&5 printf "%s\n" "$GOLANG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$GOLANG" != "xno" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $GOLANG is usable" >&5 printf %s "checking if $GOLANG is usable... " >&6; } if $GOLANG run $srcdir/plugins/golang/config-test.go 2>&5 && \ $GOLANG help modules 2>&5 1>&2 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # Substitute some golang environment. GOOS=`$GOLANG env GOOS` GOARCH=`$GOLANG env GOARCH` GOROOT=`$GOLANG env GOROOT` else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: golang ($GOLANG) is installed but not usable" >&5 printf "%s\n" "$as_me: WARNING: golang ($GOLANG) is installed but not usable" >&2;} GOLANG=no ;; esac fi fi else case e in #( e) GOLANG=no ;; esac fi if test "x$GOLANG" != "xno"; then HAVE_GOLANG_TRUE= HAVE_GOLANG_FALSE='#' else HAVE_GOLANG_TRUE='#' HAVE_GOLANG_FALSE= fi # Check whether --with-libblkio was given. if test ${with_libblkio+y} then : withval=$with_libblkio; else case e in #( e) with_libblkio=check ;; esac fi if test "$with_libblkio" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for blkio" >&5 printf %s "checking for blkio... " >&6; } if test -n "$LIBBLKIO_CFLAGS"; then pkg_cv_LIBBLKIO_CFLAGS="$LIBBLKIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkio\""; } >&5 ($PKG_CONFIG --exists --print-errors "blkio") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBLKIO_CFLAGS=`$PKG_CONFIG --cflags "blkio" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBBLKIO_LIBS"; then pkg_cv_LIBBLKIO_LIBS="$LIBBLKIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkio\""; } >&5 ($PKG_CONFIG --exists --print-errors "blkio") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBLKIO_LIBS=`$PKG_CONFIG --libs "blkio" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBBLKIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "blkio" 2>&1` else LIBBLKIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "blkio" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBBLKIO_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libblkio not found, blkio plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libblkio not found, blkio plugin will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libblkio not found, blkio plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libblkio not found, blkio plugin will be disabled" >&2;} else LIBBLKIO_CFLAGS=$pkg_cv_LIBBLKIO_CFLAGS LIBBLKIO_LIBS=$pkg_cv_LIBBLKIO_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "libblkio version is "; $PKG_CONFIG --modversion blkio printf "%s\n" "#define HAVE_LIBBLKIO 1" >>confdefs.h fi fi if test "x$LIBBLKIO_LIBS" != "x"; then HAVE_LIBBLKIO_TRUE= HAVE_LIBBLKIO_FALSE='#' else HAVE_LIBBLKIO_TRUE='#' HAVE_LIBBLKIO_FALSE= fi # Check whether --with-curl was given. if test ${with_curl+y} then : withval=$with_curl; else case e in #( e) with_curl=check ;; esac fi if test "$with_curl" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcurl" >&5 printf %s "checking for libcurl... " >&6; } if test -n "$CURL_CFLAGS"; then pkg_cv_CURL_CFLAGS="$CURL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CURL_LIBS"; then pkg_cv_CURL_LIBS="$CURL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1` else CURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CURL_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: curl not found, curl plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: curl not found, curl plugin will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: curl not found, curl plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: curl not found, curl plugin will be disabled" >&2;} else CURL_CFLAGS=$pkg_cv_CURL_CFLAGS CURL_LIBS=$pkg_cv_CURL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "libcurl version is "; $PKG_CONFIG --modversion libcurl old_CFLAGS="$CFLAGS" CFLAGS="$CURL_CFLAGS $CFLAGS" printf "%s\n" "#define HAVE_CURL 1" >>confdefs.h ac_fn_check_decl "$LINENO" "CURLOPT_UNIX_SOCKET_PATH" "ac_cv_have_decl_CURLOPT_UNIX_SOCKET_PATH" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURLOPT_UNIX_SOCKET_PATH" = xyes then : printf "%s\n" "#define HAVE_CURLOPT_UNIX_SOCKET_PATH 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURLOPT_PROTOCOLS_STR" "ac_cv_have_decl_CURLOPT_PROTOCOLS_STR" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURLOPT_PROTOCOLS_STR" = xyes then : printf "%s\n" "#define HAVE_CURLOPT_PROTOCOLS_STR 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURL_HTTP_VERSION_2_0" "ac_cv_have_decl_CURL_HTTP_VERSION_2_0" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURL_HTTP_VERSION_2_0" = xyes then : printf "%s\n" "#define HAVE_CURL_HTTP_VERSION_2_0 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURL_HTTP_VERSION_2TLS" "ac_cv_have_decl_CURL_HTTP_VERSION_2TLS" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURL_HTTP_VERSION_2TLS" = xyes then : printf "%s\n" "#define HAVE_CURL_HTTP_VERSION_2TLS 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE" "ac_cv_have_decl_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE" = xyes then : printf "%s\n" "#define HAVE_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURL_HTTP_VERSION_3" "ac_cv_have_decl_CURL_HTTP_VERSION_3" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURL_HTTP_VERSION_3" = xyes then : printf "%s\n" "#define HAVE_CURL_HTTP_VERSION_3 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "CURL_HTTP_VERSION_3ONLY" "ac_cv_have_decl_CURL_HTTP_VERSION_3ONLY" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_CURL_HTTP_VERSION_3ONLY" = xyes then : printf "%s\n" "#define HAVE_CURL_HTTP_VERSION_3ONLY 1" >>confdefs.h fi CFLAGS="$old_CFLAGS" old_LIBS="$LIBS" LIBS="$CURL_LIBS $LIBS" ac_fn_c_check_func "$LINENO" "curl_multi_get_handles" "ac_cv_func_curl_multi_get_handles" if test "x$ac_cv_func_curl_multi_get_handles" = xyes then : printf "%s\n" "#define HAVE_CURL_MULTI_GET_HANDLES 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "curl_version_info" "ac_cv_func_curl_version_info" if test "x$ac_cv_func_curl_version_info" = xyes then : printf "%s\n" "#define HAVE_CURL_VERSION_INFO 1" >>confdefs.h fi LIBS="$old_LIBS" fi fi if test "x$CURL_LIBS" != "x"; then HAVE_CURL_TRUE= HAVE_CURL_FALSE='#' else HAVE_CURL_TRUE='#' HAVE_CURL_FALSE= fi # Check whether --with-ssh was given. if test ${with_ssh+y} then : withval=$with_ssh; else case e in #( e) with_ssh=check ;; esac fi if test "$with_ssh" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssh >= 0.8.0" >&5 printf %s "checking for libssh >= 0.8.0... " >&6; } if test -n "$SSH_CFLAGS"; then pkg_cv_SSH_CFLAGS="$SSH_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssh >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libssh >= 0.8.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SSH_CFLAGS=`$PKG_CONFIG --cflags "libssh >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SSH_LIBS"; then pkg_cv_SSH_LIBS="$SSH_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssh >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libssh >= 0.8.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SSH_LIBS=`$PKG_CONFIG --libs "libssh >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SSH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libssh >= 0.8.0" 2>&1` else SSH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libssh >= 0.8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SSH_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libssh not found, ssh plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libssh not found, ssh plugin will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libssh not found, ssh plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libssh not found, ssh plugin will be disabled" >&2;} else SSH_CFLAGS=$pkg_cv_SSH_CFLAGS SSH_LIBS=$pkg_cv_SSH_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "libssh version is "; $PKG_CONFIG --modversion libssh # Ubuntu 18.04 shipped prerelease of libssh-0.8.0 without # SSH_OPTIONS_NODELAY old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $SSH_CFLAGS" ac_fn_check_decl "$LINENO" "SSH_OPTIONS_NODELAY" "ac_cv_have_decl_SSH_OPTIONS_NODELAY" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_SSH_OPTIONS_NODELAY" = xyes then : # We don't need this in the code, just in this configure HAVE_SSH_OPTIONS_NODELAY=1 fi CFLAGS="$old_CFLAGS" fi fi if test "x$HAVE_SSH_OPTIONS_NODELAY" != "x"; then HAVE_SSH_TRUE= HAVE_SSH_FALSE='#' else HAVE_SSH_TRUE='#' HAVE_SSH_FALSE= fi ISOPROG="no" is_xorriso=0 # Check whether --with-iso was given. if test ${with_iso+y} then : withval=$with_iso; else case e in #( e) with_iso=check ;; esac fi if test "$with_iso" != "no" then : # Extract the first word of "xorriso", so it can be a program name with args. set dummy xorriso; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_XORRISO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$XORRISO"; then ac_cv_prog_XORRISO="$XORRISO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_XORRISO="xorriso" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_XORRISO" && ac_cv_prog_XORRISO="no" fi ;; esac fi XORRISO=$ac_cv_prog_XORRISO if test -n "$XORRISO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XORRISO" >&5 printf "%s\n" "$XORRISO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "genisoimage", so it can be a program name with args. set dummy genisoimage; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GENISOIMAGE+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$GENISOIMAGE"; then ac_cv_prog_GENISOIMAGE="$GENISOIMAGE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_GENISOIMAGE="genisoimage" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GENISOIMAGE" && ac_cv_prog_GENISOIMAGE="no" fi ;; esac fi GENISOIMAGE=$ac_cv_prog_GENISOIMAGE if test -n "$GENISOIMAGE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GENISOIMAGE" >&5 printf "%s\n" "$GENISOIMAGE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "mkisofs", so it can be a program name with args. set dummy mkisofs; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MKISOFS+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MKISOFS"; then ac_cv_prog_MKISOFS="$MKISOFS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MKISOFS="mkisofs" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_MKISOFS" && ac_cv_prog_MKISOFS="no" fi ;; esac fi MKISOFS=$ac_cv_prog_MKISOFS if test -n "$MKISOFS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKISOFS" >&5 printf "%s\n" "$MKISOFS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$XORRISO" != "xno" then : ISOPROG="$XORRISO" is_xorriso=1 else case e in #( e) if test "x$GENISOIMAGE" != "xno" then : ISOPROG="$GENISOIMAGE" else case e in #( e) if test "x$MKISOFS" != "xno" then : ISOPROG="$MKISOFS" fi ;; esac fi ;; esac fi if test "x$ISOPROG" != "xno" then : printf "picked %s for nbdkit-iso-plugin\n" "$ISOPROG" printf "%s\n" "#define ISOPROG \"$ISOPROG\"" >>confdefs.h if test "x$is_xorriso" = "x1" then : printf "%s\n" "#define ISOPROG_IS_XORRISO 1" >>confdefs.h fi fi fi if test "x$ISOPROG" != "xno"; then HAVE_ISO_TRUE= HAVE_ISO_FALSE='#' else HAVE_ISO_TRUE='#' HAVE_ISO_FALSE= fi # Check whether --with-libvirt was given. if test ${with_libvirt+y} then : withval=$with_libvirt; else case e in #( e) with_libvirt=check ;; esac fi if test "$with_libvirt" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libvirt" >&5 printf %s "checking for libvirt... " >&6; } if test -n "$LIBVIRT_CFLAGS"; then pkg_cv_LIBVIRT_CFLAGS="$LIBVIRT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5 ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBVIRT_LIBS"; then pkg_cv_LIBVIRT_LIBS="$LIBVIRT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt\""; } >&5 ($PKG_CONFIG --exists --print-errors "libvirt") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libvirt" 2>&1` else LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libvirt" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBVIRT_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libvirt not found, libvirt plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libvirt not found, libvirt plugin will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libvirt not found, libvirt plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libvirt not found, libvirt plugin will be disabled" >&2;} else LIBVIRT_CFLAGS=$pkg_cv_LIBVIRT_CFLAGS LIBVIRT_LIBS=$pkg_cv_LIBVIRT_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_LIBVIRT 1" >>confdefs.h fi fi if test "x$LIBVIRT_LIBS" != "x"; then HAVE_LIBVIRT_TRUE= HAVE_LIBVIRT_FALSE='#' else HAVE_LIBVIRT_TRUE='#' HAVE_LIBVIRT_FALSE= fi # Check whether --with-bzip2 was given. if test ${with_bzip2+y} then : withval=$with_bzip2; else case e in #( e) with_bzip2=check ;; esac fi if test "$with_bzip2" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bzip2" >&5 printf %s "checking for bzip2... " >&6; } if test -n "$BZLIB_CFLAGS"; then pkg_cv_BZLIB_CFLAGS="$BZLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2\""; } >&5 ($PKG_CONFIG --exists --print-errors "bzip2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BZLIB_CFLAGS=`$PKG_CONFIG --cflags "bzip2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$BZLIB_LIBS"; then pkg_cv_BZLIB_LIBS="$BZLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2\""; } >&5 ($PKG_CONFIG --exists --print-errors "bzip2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BZLIB_LIBS=`$PKG_CONFIG --libs "bzip2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then BZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bzip2" 2>&1` else BZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bzip2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$BZLIB_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libbz2 not found, bzip2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libbz2 not found, bzip2 filter will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libbz2 not found, bzip2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libbz2 not found, bzip2 filter will be disabled" >&2;} else BZLIB_CFLAGS=$pkg_cv_BZLIB_CFLAGS BZLIB_LIBS=$pkg_cv_BZLIB_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_BZLIB 1" >>confdefs.h for ac_prog in bzip2 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_BZIP2+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$BZIP2"; then ac_cv_prog_BZIP2="$BZIP2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_BZIP2="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi BZIP2=$ac_cv_prog_BZIP2 if test -n "$BZIP2"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5 printf "%s\n" "$BZIP2" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$BZIP2" && break done test -n "$BZIP2" || BZIP2="no" fi fi if test "x$BZLIB_LIBS" != "x" && test "x$BZIP2" != "xno"; then HAVE_BZLIB_TRUE= HAVE_BZLIB_FALSE='#' else HAVE_BZLIB_TRUE='#' HAVE_BZLIB_FALSE= fi # Check whether --with-zlib was given. if test ${with_zlib+y} then : withval=$with_zlib; else case e in #( e) with_zlib=check ;; esac fi if test "$with_zlib" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zlib >= 1.2.3.5" >&5 printf %s "checking for zlib >= 1.2.3.5... " >&6; } if test -n "$ZLIB_CFLAGS"; then pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.3.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.3.5") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ZLIB_CFLAGS=`$PKG_CONFIG --cflags "zlib >= 1.2.3.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$ZLIB_LIBS"; then pkg_cv_ZLIB_LIBS="$ZLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.3.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.3.5") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ZLIB_LIBS=`$PKG_CONFIG --libs "zlib >= 1.2.3.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then ZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib >= 1.2.3.5" 2>&1` else ZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib >= 1.2.3.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ZLIB_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib >= 1.2.3.5 not found, gzip filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: zlib >= 1.2.3.5 not found, gzip filter will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib >= 1.2.3.5 not found, gzip filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: zlib >= 1.2.3.5 not found, gzip filter will be disabled" >&2;} else ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS ZLIB_LIBS=$pkg_cv_ZLIB_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h fi fi if test "x$ZLIB_LIBS" != "x"; then HAVE_ZLIB_TRUE= HAVE_ZLIB_FALSE='#' else HAVE_ZLIB_TRUE='#' HAVE_ZLIB_FALSE= fi # Check whether --with-zlib-ng was given. if test ${with_zlib_ng+y} then : withval=$with_zlib_ng; else case e in #( e) with_zlib_ng=check ;; esac fi if test "$with_zlib_ng" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zlib-ng" >&5 printf %s "checking for zlib-ng... " >&6; } if test -n "$ZLIB_NG_CFLAGS"; then pkg_cv_ZLIB_NG_CFLAGS="$ZLIB_NG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib-ng\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib-ng") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ZLIB_NG_CFLAGS=`$PKG_CONFIG --cflags "zlib-ng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$ZLIB_NG_LIBS"; then pkg_cv_ZLIB_NG_LIBS="$ZLIB_NG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib-ng\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib-ng") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ZLIB_NG_LIBS=`$PKG_CONFIG --libs "zlib-ng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then ZLIB_NG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib-ng" 2>&1` else ZLIB_NG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib-ng" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ZLIB_NG_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib-ng not found, zlib operations will run slower" >&5 printf "%s\n" "$as_me: WARNING: zlib-ng not found, zlib operations will run slower" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib-ng not found, zlib operations will run slower" >&5 printf "%s\n" "$as_me: WARNING: zlib-ng not found, zlib operations will run slower" >&2;} else ZLIB_NG_CFLAGS=$pkg_cv_ZLIB_NG_CFLAGS ZLIB_NG_LIBS=$pkg_cv_ZLIB_NG_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_ZLIB_NG 1" >>confdefs.h fi fi if test "x$ZLIB_LIBS" != "x"; then HAVE_ZLIB_TRUE= HAVE_ZLIB_FALSE='#' else HAVE_ZLIB_TRUE='#' HAVE_ZLIB_FALSE= fi # Check whether --with-libnbd was given. if test ${with_libnbd+y} then : withval=$with_libnbd; else case e in #( e) with_libnbd=check ;; esac fi if test "$with_libnbd" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libnbd >= 0.9.8" >&5 printf %s "checking for libnbd >= 0.9.8... " >&6; } if test -n "$LIBNBD_CFLAGS"; then pkg_cv_LIBNBD_CFLAGS="$LIBNBD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnbd >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnbd >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNBD_CFLAGS=`$PKG_CONFIG --cflags "libnbd >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBNBD_LIBS"; then pkg_cv_LIBNBD_LIBS="$LIBNBD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnbd >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnbd >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNBD_LIBS=`$PKG_CONFIG --libs "libnbd >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBNBD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnbd >= 0.9.8" 2>&1` else LIBNBD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnbd >= 0.9.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBNBD_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libnbd >= 0.9.8 not found, nbd plugin will be crippled" >&5 printf "%s\n" "$as_me: WARNING: libnbd >= 0.9.8 not found, nbd plugin will be crippled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libnbd >= 0.9.8 not found, nbd plugin will be crippled" >&5 printf "%s\n" "$as_me: WARNING: libnbd >= 0.9.8 not found, nbd plugin will be crippled" >&2;} else LIBNBD_CFLAGS=$pkg_cv_LIBNBD_CFLAGS LIBNBD_LIBS=$pkg_cv_LIBNBD_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "libnbd version is "; $PKG_CONFIG --modversion libnbd printf "%s\n" "#define HAVE_LIBNBD 1" >>confdefs.h fi fi # Check whether --enable-nbd-plugin was given. if test ${enable_nbd_plugin+y} then : enableval=$enable_nbd_plugin; else case e in #( e) enable_nbd_plugin=yes ;; esac fi if test "x$LIBNBD_LIBS" != "x" && test "x$enable_nbd_plugin" = "xyes"; then HAVE_LIBNBD_TRUE= HAVE_LIBNBD_FALSE='#' else HAVE_LIBNBD_TRUE='#' HAVE_LIBNBD_FALSE= fi # Check whether --with-liblzma was given. if test ${with_liblzma+y} then : withval=$with_liblzma; else case e in #( e) with_liblzma=check ;; esac fi if test "$with_liblzma" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for liblzma" >&5 printf %s "checking for liblzma... " >&6; } if test -n "$LIBLZMA_CFLAGS"; then pkg_cv_LIBLZMA_CFLAGS="$LIBLZMA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLZMA_CFLAGS=`$PKG_CONFIG --cflags "liblzma" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBLZMA_LIBS"; then pkg_cv_LIBLZMA_LIBS="$LIBLZMA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLZMA_LIBS=`$PKG_CONFIG --libs "liblzma" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblzma" 2>&1` else LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblzma" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBLZMA_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: liblzma not found, xz and lzip filters will be disabled" >&5 printf "%s\n" "$as_me: WARNING: liblzma not found, xz and lzip filters will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: liblzma not found, xz and lzip filters will be disabled" >&5 printf "%s\n" "$as_me: WARNING: liblzma not found, xz and lzip filters will be disabled" >&2;} else LIBLZMA_CFLAGS=$pkg_cv_LIBLZMA_CFLAGS LIBLZMA_LIBS=$pkg_cv_LIBLZMA_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_LIBLZMA 1" >>confdefs.h fi fi if test "x$LIBLZMA_LIBS" != "x"; then HAVE_LIBLZMA_TRUE= HAVE_LIBLZMA_FALSE='#' else HAVE_LIBLZMA_TRUE='#' HAVE_LIBLZMA_FALSE= fi if test "x$LIBLZMA_LIBS" != "x" then : old_LIBS="$LIBS" LIBS="$LIBLZMA_LIBS $LIBS" ac_fn_c_check_func "$LINENO" "lzma_lzip_decoder" "ac_cv_func_lzma_lzip_decoder" if test "x$ac_cv_func_lzma_lzip_decoder" = xyes then : printf "%s\n" "#define HAVE_LZMA_LZIP_DECODER 1" >>confdefs.h fi LIBS="$old_LIBS" if test "x$ac_cv_func_lzma_lzip_decoder" != "xyes" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: liblzma without lzip support, lzip filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: liblzma without lzip support, lzip filter will be disabled" >&2;} fi fi if test "x$LIBLZMA_LIBS" != "x" && \ test "x$ac_cv_func_lzma_lzip_decoder" = "xyes"; then HAVE_LZMA_LZIP_DECODER_TRUE= HAVE_LZMA_LZIP_DECODER_FALSE='#' else HAVE_LZMA_LZIP_DECODER_TRUE='#' HAVE_LZMA_LZIP_DECODER_FALSE= fi # Extract the first word of "lzip", so it can be a program name with args. set dummy lzip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LZIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LZIP"; then ac_cv_prog_LZIP="$LZIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LZIP="lzip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_LZIP" && ac_cv_prog_LZIP="no" fi ;; esac fi LZIP=$ac_cv_prog_LZIP if test -n "$LZIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LZIP" >&5 printf "%s\n" "$LZIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$LZIP" != "xno"; then HAVE_LZIP_TRUE= HAVE_LZIP_FALSE='#' else HAVE_LZIP_TRUE='#' HAVE_LZIP_FALSE= fi # Check whether --with-libzstd was given. if test ${with_libzstd+y} then : withval=$with_libzstd; else case e in #( e) with_libzstd=check ;; esac fi if test "$with_libzstd" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5 printf %s "checking for libzstd... " >&6; } if test -n "$LIBZSTD_CFLAGS"; then pkg_cv_LIBZSTD_CFLAGS="$LIBZSTD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBZSTD_LIBS"; then pkg_cv_LIBZSTD_LIBS="$LIBZSTD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5 ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1` else LIBZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBZSTD_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libzstd not found, allocator=zstd will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libzstd not found, allocator=zstd will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libzstd not found, allocator=zstd will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libzstd not found, allocator=zstd will be disabled" >&2;} else LIBZSTD_CFLAGS=$pkg_cv_LIBZSTD_CFLAGS LIBZSTD_LIBS=$pkg_cv_LIBZSTD_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_LIBZSTD 1" >>confdefs.h fi fi if test "x$LIBZSTD_LIBS" != "x"; then HAVE_LIBZSTD_TRUE= HAVE_LIBZSTD_FALSE='#' else HAVE_LIBZSTD_TRUE='#' HAVE_LIBZSTD_FALSE= fi # Check whether --with-libguestfs was given. if test ${with_libguestfs+y} then : withval=$with_libguestfs; else case e in #( e) with_libguestfs=check ;; esac fi if test "$with_libguestfs" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libguestfs" >&5 printf %s "checking for libguestfs... " >&6; } if test -n "$LIBGUESTFS_CFLAGS"; then pkg_cv_LIBGUESTFS_CFLAGS="$LIBGUESTFS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libguestfs\""; } >&5 ($PKG_CONFIG --exists --print-errors "libguestfs") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBGUESTFS_CFLAGS=`$PKG_CONFIG --cflags "libguestfs" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBGUESTFS_LIBS"; then pkg_cv_LIBGUESTFS_LIBS="$LIBGUESTFS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libguestfs\""; } >&5 ($PKG_CONFIG --exists --print-errors "libguestfs") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBGUESTFS_LIBS=`$PKG_CONFIG --libs "libguestfs" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBGUESTFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libguestfs" 2>&1` else LIBGUESTFS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libguestfs" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBGUESTFS_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libguestfs not found, guestfs plugin and tests will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libguestfs not found, guestfs plugin and tests will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libguestfs not found, guestfs plugin and tests will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libguestfs not found, guestfs plugin and tests will be disabled" >&2;} else LIBGUESTFS_CFLAGS=$pkg_cv_LIBGUESTFS_CFLAGS LIBGUESTFS_LIBS=$pkg_cv_LIBGUESTFS_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # Although the library was found, we want to make sure it supports nbd cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #ifndef GUESTFS_ADD_DRIVE_OPTS_PROTOCOL #error unsupported #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define HAVE_LIBGUESTFS 1" >>confdefs.h else case e in #( e) LIBGUESTFS_LIBS= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libguestfs too old, guestfs plugin and tests will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libguestfs too old, guestfs plugin and tests will be disabled" >&2;} ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "x$LIBGUESTFS_LIBS" != "x"; then HAVE_LIBGUESTFS_TRUE= HAVE_LIBGUESTFS_FALSE='#' else HAVE_LIBGUESTFS_TRUE='#' HAVE_LIBGUESTFS_FALSE= fi # Check whether --enable-libguestfs-tests was given. if test ${enable_libguestfs_tests+y} then : enableval=$enable_libguestfs_tests; else case e in #( e) enable_libguestfs_tests=check ;; esac fi if test "x$LIBGUESTFS_LIBS" != "x" && \ test "x$enable_libguestfs_tests" != "xno"; then USE_LIBGUESTFS_FOR_TESTS_TRUE= USE_LIBGUESTFS_FOR_TESTS_FALSE='#' else USE_LIBGUESTFS_FOR_TESTS_TRUE='#' USE_LIBGUESTFS_FOR_TESTS_FALSE= fi # Check whether --enable-linuxdisk was given. if test ${enable_linuxdisk+y} then : enableval=$enable_linuxdisk; else case e in #( e) enable_linuxdisk=check ;; esac fi mke2fs_with_d=no if test "$enable_linuxdisk" != "no" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mke2fs supporting the -d option" >&5 printf %s "checking for mke2fs supporting the -d option... " >&6; } if mke2fs -V >/dev/null 2>&1 then : if LANG=C mke2fs -d 2>&1 | grep -sq "option requires an argument" then : mke2fs_with_d=yes fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $mke2fs_with_d" >&5 printf "%s\n" "$mke2fs_with_d" >&6; } fi if test "x$mke2fs_with_d" = "xyes"; then HAVE_MKE2FS_WITH_D_TRUE= HAVE_MKE2FS_WITH_D_FALSE='#' else HAVE_MKE2FS_WITH_D_TRUE='#' HAVE_MKE2FS_WITH_D_FALSE= fi # Check whether --with-ext2 was given. if test ${with_ext2+y} then : withval=$with_ext2; else case e in #( e) with_ext2=check ;; esac fi if test "$with_ext2" != "no" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ext2fs" >&5 printf %s "checking for ext2fs... " >&6; } if test -n "$EXT2FS_CFLAGS"; then pkg_cv_EXT2FS_CFLAGS="$EXT2FS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ext2fs\""; } >&5 ($PKG_CONFIG --exists --print-errors "ext2fs") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXT2FS_CFLAGS=`$PKG_CONFIG --cflags "ext2fs" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$EXT2FS_LIBS"; then pkg_cv_EXT2FS_LIBS="$EXT2FS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ext2fs\""; } >&5 ($PKG_CONFIG --exists --print-errors "ext2fs") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXT2FS_LIBS=`$PKG_CONFIG --libs "ext2fs" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then EXT2FS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ext2fs" 2>&1` else EXT2FS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ext2fs" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EXT2FS_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ext2fs not found, ext2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: ext2fs not found, ext2 filter will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ext2fs not found, ext2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: ext2fs not found, ext2 filter will be disabled" >&2;} else EXT2FS_CFLAGS=$pkg_cv_EXT2FS_CFLAGS EXT2FS_LIBS=$pkg_cv_EXT2FS_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_EXT2FS 1" >>confdefs.h fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for com_err" >&5 printf %s "checking for com_err... " >&6; } if test -n "$COM_ERR_CFLAGS"; then pkg_cv_COM_ERR_CFLAGS="$COM_ERR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"com_err\""; } >&5 ($PKG_CONFIG --exists --print-errors "com_err") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COM_ERR_CFLAGS=`$PKG_CONFIG --cflags "com_err" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$COM_ERR_LIBS"; then pkg_cv_COM_ERR_LIBS="$COM_ERR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"com_err\""; } >&5 ($PKG_CONFIG --exists --print-errors "com_err") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COM_ERR_LIBS=`$PKG_CONFIG --libs "com_err" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then COM_ERR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "com_err" 2>&1` else COM_ERR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "com_err" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$COM_ERR_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: com_err not found, ext2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: com_err not found, ext2 filter will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: com_err not found, ext2 filter will be disabled" >&5 printf "%s\n" "$as_me: WARNING: com_err not found, ext2 filter will be disabled" >&2;} else COM_ERR_CFLAGS=$pkg_cv_COM_ERR_CFLAGS COM_ERR_LIBS=$pkg_cv_COM_ERR_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_COM_ERR 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct struct_io_manager" "cache_readahead" "ac_cv_member_struct_struct_io_manager_cache_readahead" "$ac_includes_default" if test "x$ac_cv_member_struct_struct_io_manager_cache_readahead" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STRUCT_IO_MANAGER_CACHE_READAHEAD 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct struct_io_manager" "zeroout" "ac_cv_member_struct_struct_io_manager_zeroout" "$ac_includes_default" if test "x$ac_cv_member_struct_struct_io_manager_zeroout" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STRUCT_IO_MANAGER_ZEROOUT 1" >>confdefs.h fi fi if test "x$EXT2FS_LIBS" != "x" && test "x$COM_ERR_LIBS" != "x"; then HAVE_EXT2_TRUE= HAVE_EXT2_FALSE='#' else HAVE_EXT2_TRUE='#' HAVE_EXT2_FALSE= fi # Check whether --enable-torrent was given. if test ${enable_torrent+y} then : enableval=$enable_torrent; else case e in #( e) enable_torrent=check ;; esac fi if test "x$enable_torrent" != "xno" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent-rasterbar" >&5 printf %s "checking for libtorrent-rasterbar... " >&6; } if test -n "$LIBTORRENT_CFLAGS"; then pkg_cv_LIBTORRENT_CFLAGS="$LIBTORRENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBTORRENT_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBTORRENT_LIBS"; then pkg_cv_LIBTORRENT_LIBS="$LIBTORRENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBTORRENT_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBTORRENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar" 2>&1` else LIBTORRENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBTORRENT_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libtorrent-rasterbar not found, bittorrent plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libtorrent-rasterbar not found, bittorrent plugin will be disabled" >&2;} elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libtorrent-rasterbar not found, bittorrent plugin will be disabled" >&5 printf "%s\n" "$as_me: WARNING: libtorrent-rasterbar not found, bittorrent plugin will be disabled" >&2;} else LIBTORRENT_CFLAGS=$pkg_cv_LIBTORRENT_CFLAGS LIBTORRENT_LIBS=$pkg_cv_LIBTORRENT_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi if test "x$have_cxx" = "xyes" && test "x$LIBTORRENT_LIBS" != "x"; then HAVE_TORRENT_TRUE= HAVE_TORRENT_FALSE='#' else HAVE_TORRENT_TRUE='#' HAVE_TORRENT_FALSE= fi # Check whether --enable-vddk was given. if test ${enable_vddk+y} then : enableval=$enable_vddk; else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the host CPU is compatible with VDDK" >&5 printf %s "checking if the host CPU is compatible with VDDK... " >&6; } if test "$host_cpu" = "x86_64" && test "$host_os" = "linux-gnu" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($host)" >&5 printf "%s\n" "yes ($host)" >&6; } enable_vddk=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($host)" >&5 printf "%s\n" "no ($host)" >&6; } enable_vddk=no ;; esac fi ;; esac fi if test "x$enable_vddk" = "xyes"; then HAVE_VDDK_TRUE= HAVE_VDDK_FALSE='#' else HAVE_VDDK_TRUE='#' HAVE_VDDK_FALSE= fi NBDKIT_VERSION_MAJOR=1 NBDKIT_VERSION_MINOR=42 NBDKIT_VERSION_MICRO=2 ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files podwrapper.pl" ac_config_files="$ac_config_files common/protocol/generate-protostrings.sh" ac_config_files="$ac_config_files tests/make-pki.sh" ac_config_files="$ac_config_files Makefile bash-completion/Makefile common/allocators/Makefile common/bitmap/Makefile common/gpt/Makefile common/include/Makefile common/protocol/Makefile common/regions/Makefile common/replacements/Makefile common/replacements/win32/Makefile common/utils/Makefile contrib/Makefile docs/Makefile include/Makefile include/nbdkit-version.h plugins/Makefile plugins/blkio/Makefile plugins/cc/Makefile plugins/cdi/Makefile plugins/curl/Makefile plugins/data/Makefile plugins/eval/Makefile plugins/example1/Makefile plugins/example2/Makefile plugins/example3/Makefile plugins/example4/Makefile plugins/file/Makefile plugins/floppy/Makefile plugins/full/Makefile plugins/gcs/Makefile plugins/golang/Makefile plugins/guestfs/Makefile plugins/info/Makefile plugins/iso/Makefile plugins/libvirt/Makefile plugins/linuxdisk/Makefile plugins/lua/Makefile plugins/memory/Makefile plugins/nbd/Makefile plugins/null/Makefile plugins/ocaml/Makefile plugins/ondemand/Makefile plugins/ones/Makefile plugins/partitioning/Makefile plugins/pattern/Makefile plugins/perl/Makefile plugins/python/Makefile plugins/random/Makefile plugins/rust/Makefile plugins/S3/Makefile plugins/sh/Makefile plugins/ssh/Makefile plugins/sparse-random/Makefile plugins/split/Makefile plugins/tcl/Makefile plugins/tmpdisk/Makefile plugins/torrent/Makefile plugins/vddk/Makefile plugins/zero/Makefile filters/Makefile filters/blocksize/Makefile filters/blocksize-policy/Makefile filters/bzip2/Makefile filters/cache/Makefile filters/cacheextents/Makefile filters/checkwrite/Makefile filters/cow/Makefile filters/ddrescue/Makefile filters/delay/Makefile filters/error/Makefile filters/evil/Makefile filters/exitlast/Makefile filters/exitwhen/Makefile filters/exportname/Makefile filters/ext2/Makefile filters/extentlist/Makefile filters/fua/Makefile filters/gzip/Makefile filters/ip/Makefile filters/limit/Makefile filters/log/Makefile filters/luks/Makefile filters/lzip/Makefile filters/multi-conn/Makefile filters/nocache/Makefile filters/noextents/Makefile filters/nofilter/Makefile filters/noparallel/Makefile filters/nozero/Makefile filters/offset/Makefile filters/partition/Makefile filters/pause/Makefile filters/protect/Makefile filters/qcow2dec/Makefile filters/rate/Makefile filters/readahead/Makefile filters/readonly/Makefile filters/retry/Makefile filters/retry-request/Makefile filters/rotational/Makefile filters/scan/Makefile filters/spinning/Makefile filters/stats/Makefile filters/swab/Makefile filters/tar/Makefile filters/time-limit/Makefile filters/tls-fallback/Makefile filters/truncate/Makefile filters/xz/Makefile fuzzing/Makefile server/local/nbdkit.pc server/Makefile server/nbdkit.pc tests/functions.sh tests/Makefile valgrind/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi # Check whether --enable-year2038 was given. if test ${enable_year2038+y} then : enableval=$enable_year2038; fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COMPILER_WARNINGS_TRUE}" && test -z "${COMPILER_WARNINGS_FALSE}"; then as_fn_error $? "conditional \"COMPILER_WARNINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CAN_TEST_ANSI_C_TRUE}" && test -z "${CAN_TEST_ANSI_C_FALSE}"; then as_fn_error $? "conditional \"CAN_TEST_ANSI_C\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ICONV_TRUE}" && test -z "${HAVE_ICONV_FALSE}"; then as_fn_error $? "conditional \"HAVE_ICONV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${IS_WINDOWS_TRUE}" && test -z "${IS_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"IS_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MC_TRUE}" && test -z "${HAVE_MC_FALSE}"; then as_fn_error $? "conditional \"HAVE_MC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GLIBC_234_TRUE}" && test -z "${HAVE_GLIBC_234_FALSE}"; then as_fn_error $? "conditional \"HAVE_GLIBC_234\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNUTLS_TRUE}" && test -z "${HAVE_GNUTLS_FALSE}"; then as_fn_error $? "conditional \"HAVE_GNUTLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNUTLS_PBKDF2_TRUE}" && test -z "${HAVE_GNUTLS_PBKDF2_FALSE}"; then as_fn_error $? "conditional \"HAVE_GNUTLS_PBKDF2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LIBFUZZER_TRUE}" && test -z "${ENABLE_LIBFUZZER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LIBFUZZER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_LINKER_SCRIPT_TRUE}" && test -z "${USE_LINKER_SCRIPT_FALSE}"; then as_fn_error $? "conditional \"USE_LINKER_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_BASH_COMPLETION_TRUE}" && test -z "${HAVE_BASH_COMPLETION_FALSE}"; then as_fn_error $? "conditional \"HAVE_BASH_COMPLETION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_POD_TRUE}" && test -z "${HAVE_POD_FALSE}"; then as_fn_error $? "conditional \"HAVE_POD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PLUGINS_TRUE}" && test -z "${HAVE_PLUGINS_FALSE}"; then as_fn_error $? "conditional \"HAVE_PLUGINS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PERL_TRUE}" && test -z "${HAVE_PERL_FALSE}"; then as_fn_error $? "conditional \"HAVE_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_OCAML_TRUE}" && test -z "${HAVE_OCAML_FALSE}"; then as_fn_error $? "conditional \"HAVE_OCAML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_OCAMLDOC_TRUE}" && test -z "${HAVE_OCAMLDOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_OCAMLDOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_RUST_TRUE}" && test -z "${HAVE_RUST_FALSE}"; then as_fn_error $? "conditional \"HAVE_RUST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_TCL_TRUE}" && test -z "${HAVE_TCL_FALSE}"; then as_fn_error $? "conditional \"HAVE_TCL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LUA_TRUE}" && test -z "${HAVE_LUA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LUA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GOLANG_TRUE}" && test -z "${HAVE_GOLANG_FALSE}"; then as_fn_error $? "conditional \"HAVE_GOLANG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBBLKIO_TRUE}" && test -z "${HAVE_LIBBLKIO_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBBLKIO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CURL_TRUE}" && test -z "${HAVE_CURL_FALSE}"; then as_fn_error $? "conditional \"HAVE_CURL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SSH_TRUE}" && test -z "${HAVE_SSH_FALSE}"; then as_fn_error $? "conditional \"HAVE_SSH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ISO_TRUE}" && test -z "${HAVE_ISO_FALSE}"; then as_fn_error $? "conditional \"HAVE_ISO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBVIRT_TRUE}" && test -z "${HAVE_LIBVIRT_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBVIRT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_BZLIB_TRUE}" && test -z "${HAVE_BZLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_BZLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBNBD_TRUE}" && test -z "${HAVE_LIBNBD_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBNBD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBLZMA_TRUE}" && test -z "${HAVE_LIBLZMA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBLZMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LZMA_LZIP_DECODER_TRUE}" && test -z "${HAVE_LZMA_LZIP_DECODER_FALSE}"; then as_fn_error $? "conditional \"HAVE_LZMA_LZIP_DECODER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LZIP_TRUE}" && test -z "${HAVE_LZIP_FALSE}"; then as_fn_error $? "conditional \"HAVE_LZIP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBZSTD_TRUE}" && test -z "${HAVE_LIBZSTD_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBZSTD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBGUESTFS_TRUE}" && test -z "${HAVE_LIBGUESTFS_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBGUESTFS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_LIBGUESTFS_FOR_TESTS_TRUE}" && test -z "${USE_LIBGUESTFS_FOR_TESTS_FALSE}"; then as_fn_error $? "conditional \"USE_LIBGUESTFS_FOR_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MKE2FS_WITH_D_TRUE}" && test -z "${HAVE_MKE2FS_WITH_D_FALSE}"; then as_fn_error $? "conditional \"HAVE_MKE2FS_WITH_D\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_EXT2_TRUE}" && test -z "${HAVE_EXT2_FALSE}"; then as_fn_error $? "conditional \"HAVE_EXT2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_TORRENT_TRUE}" && test -z "${HAVE_TORRENT_FALSE}"; then as_fn_error $? "conditional \"HAVE_TORRENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_VDDK_TRUE}" && test -z "${HAVE_VDDK_FALSE}"; then as_fn_error $? "conditional \"HAVE_VDDK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by nbdkit $as_me 1.42.2, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ nbdkit config.status 1.42.2 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "podwrapper.pl") CONFIG_FILES="$CONFIG_FILES podwrapper.pl" ;; "common/protocol/generate-protostrings.sh") CONFIG_FILES="$CONFIG_FILES common/protocol/generate-protostrings.sh" ;; "tests/make-pki.sh") CONFIG_FILES="$CONFIG_FILES tests/make-pki.sh" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bash-completion/Makefile") CONFIG_FILES="$CONFIG_FILES bash-completion/Makefile" ;; "common/allocators/Makefile") CONFIG_FILES="$CONFIG_FILES common/allocators/Makefile" ;; "common/bitmap/Makefile") CONFIG_FILES="$CONFIG_FILES common/bitmap/Makefile" ;; "common/gpt/Makefile") CONFIG_FILES="$CONFIG_FILES common/gpt/Makefile" ;; "common/include/Makefile") CONFIG_FILES="$CONFIG_FILES common/include/Makefile" ;; "common/protocol/Makefile") CONFIG_FILES="$CONFIG_FILES common/protocol/Makefile" ;; "common/regions/Makefile") CONFIG_FILES="$CONFIG_FILES common/regions/Makefile" ;; "common/replacements/Makefile") CONFIG_FILES="$CONFIG_FILES common/replacements/Makefile" ;; "common/replacements/win32/Makefile") CONFIG_FILES="$CONFIG_FILES common/replacements/win32/Makefile" ;; "common/utils/Makefile") CONFIG_FILES="$CONFIG_FILES common/utils/Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/nbdkit-version.h") CONFIG_FILES="$CONFIG_FILES include/nbdkit-version.h" ;; "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; "plugins/blkio/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/blkio/Makefile" ;; "plugins/cc/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/cc/Makefile" ;; "plugins/cdi/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/cdi/Makefile" ;; "plugins/curl/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/curl/Makefile" ;; "plugins/data/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/data/Makefile" ;; "plugins/eval/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/eval/Makefile" ;; "plugins/example1/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/example1/Makefile" ;; "plugins/example2/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/example2/Makefile" ;; "plugins/example3/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/example3/Makefile" ;; "plugins/example4/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/example4/Makefile" ;; "plugins/file/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/file/Makefile" ;; "plugins/floppy/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/floppy/Makefile" ;; "plugins/full/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/full/Makefile" ;; "plugins/gcs/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/gcs/Makefile" ;; "plugins/golang/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/golang/Makefile" ;; "plugins/guestfs/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/guestfs/Makefile" ;; "plugins/info/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/info/Makefile" ;; "plugins/iso/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/iso/Makefile" ;; "plugins/libvirt/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/libvirt/Makefile" ;; "plugins/linuxdisk/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/linuxdisk/Makefile" ;; "plugins/lua/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/lua/Makefile" ;; "plugins/memory/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/memory/Makefile" ;; "plugins/nbd/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/nbd/Makefile" ;; "plugins/null/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/null/Makefile" ;; "plugins/ocaml/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ocaml/Makefile" ;; "plugins/ondemand/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ondemand/Makefile" ;; "plugins/ones/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ones/Makefile" ;; "plugins/partitioning/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/partitioning/Makefile" ;; "plugins/pattern/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pattern/Makefile" ;; "plugins/perl/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/perl/Makefile" ;; "plugins/python/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/python/Makefile" ;; "plugins/random/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/random/Makefile" ;; "plugins/rust/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/rust/Makefile" ;; "plugins/S3/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/S3/Makefile" ;; "plugins/sh/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sh/Makefile" ;; "plugins/ssh/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ssh/Makefile" ;; "plugins/sparse-random/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sparse-random/Makefile" ;; "plugins/split/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/split/Makefile" ;; "plugins/tcl/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/tcl/Makefile" ;; "plugins/tmpdisk/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/tmpdisk/Makefile" ;; "plugins/torrent/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/torrent/Makefile" ;; "plugins/vddk/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/vddk/Makefile" ;; "plugins/zero/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/zero/Makefile" ;; "filters/Makefile") CONFIG_FILES="$CONFIG_FILES filters/Makefile" ;; "filters/blocksize/Makefile") CONFIG_FILES="$CONFIG_FILES filters/blocksize/Makefile" ;; "filters/blocksize-policy/Makefile") CONFIG_FILES="$CONFIG_FILES filters/blocksize-policy/Makefile" ;; "filters/bzip2/Makefile") CONFIG_FILES="$CONFIG_FILES filters/bzip2/Makefile" ;; "filters/cache/Makefile") CONFIG_FILES="$CONFIG_FILES filters/cache/Makefile" ;; "filters/cacheextents/Makefile") CONFIG_FILES="$CONFIG_FILES filters/cacheextents/Makefile" ;; "filters/checkwrite/Makefile") CONFIG_FILES="$CONFIG_FILES filters/checkwrite/Makefile" ;; "filters/cow/Makefile") CONFIG_FILES="$CONFIG_FILES filters/cow/Makefile" ;; "filters/ddrescue/Makefile") CONFIG_FILES="$CONFIG_FILES filters/ddrescue/Makefile" ;; "filters/delay/Makefile") CONFIG_FILES="$CONFIG_FILES filters/delay/Makefile" ;; "filters/error/Makefile") CONFIG_FILES="$CONFIG_FILES filters/error/Makefile" ;; "filters/evil/Makefile") CONFIG_FILES="$CONFIG_FILES filters/evil/Makefile" ;; "filters/exitlast/Makefile") CONFIG_FILES="$CONFIG_FILES filters/exitlast/Makefile" ;; "filters/exitwhen/Makefile") CONFIG_FILES="$CONFIG_FILES filters/exitwhen/Makefile" ;; "filters/exportname/Makefile") CONFIG_FILES="$CONFIG_FILES filters/exportname/Makefile" ;; "filters/ext2/Makefile") CONFIG_FILES="$CONFIG_FILES filters/ext2/Makefile" ;; "filters/extentlist/Makefile") CONFIG_FILES="$CONFIG_FILES filters/extentlist/Makefile" ;; "filters/fua/Makefile") CONFIG_FILES="$CONFIG_FILES filters/fua/Makefile" ;; "filters/gzip/Makefile") CONFIG_FILES="$CONFIG_FILES filters/gzip/Makefile" ;; "filters/ip/Makefile") CONFIG_FILES="$CONFIG_FILES filters/ip/Makefile" ;; "filters/limit/Makefile") CONFIG_FILES="$CONFIG_FILES filters/limit/Makefile" ;; "filters/log/Makefile") CONFIG_FILES="$CONFIG_FILES filters/log/Makefile" ;; "filters/luks/Makefile") CONFIG_FILES="$CONFIG_FILES filters/luks/Makefile" ;; "filters/lzip/Makefile") CONFIG_FILES="$CONFIG_FILES filters/lzip/Makefile" ;; "filters/multi-conn/Makefile") CONFIG_FILES="$CONFIG_FILES filters/multi-conn/Makefile" ;; "filters/nocache/Makefile") CONFIG_FILES="$CONFIG_FILES filters/nocache/Makefile" ;; "filters/noextents/Makefile") CONFIG_FILES="$CONFIG_FILES filters/noextents/Makefile" ;; "filters/nofilter/Makefile") CONFIG_FILES="$CONFIG_FILES filters/nofilter/Makefile" ;; "filters/noparallel/Makefile") CONFIG_FILES="$CONFIG_FILES filters/noparallel/Makefile" ;; "filters/nozero/Makefile") CONFIG_FILES="$CONFIG_FILES filters/nozero/Makefile" ;; "filters/offset/Makefile") CONFIG_FILES="$CONFIG_FILES filters/offset/Makefile" ;; "filters/partition/Makefile") CONFIG_FILES="$CONFIG_FILES filters/partition/Makefile" ;; "filters/pause/Makefile") CONFIG_FILES="$CONFIG_FILES filters/pause/Makefile" ;; "filters/protect/Makefile") CONFIG_FILES="$CONFIG_FILES filters/protect/Makefile" ;; "filters/qcow2dec/Makefile") CONFIG_FILES="$CONFIG_FILES filters/qcow2dec/Makefile" ;; "filters/rate/Makefile") CONFIG_FILES="$CONFIG_FILES filters/rate/Makefile" ;; "filters/readahead/Makefile") CONFIG_FILES="$CONFIG_FILES filters/readahead/Makefile" ;; "filters/readonly/Makefile") CONFIG_FILES="$CONFIG_FILES filters/readonly/Makefile" ;; "filters/retry/Makefile") CONFIG_FILES="$CONFIG_FILES filters/retry/Makefile" ;; "filters/retry-request/Makefile") CONFIG_FILES="$CONFIG_FILES filters/retry-request/Makefile" ;; "filters/rotational/Makefile") CONFIG_FILES="$CONFIG_FILES filters/rotational/Makefile" ;; "filters/scan/Makefile") CONFIG_FILES="$CONFIG_FILES filters/scan/Makefile" ;; "filters/spinning/Makefile") CONFIG_FILES="$CONFIG_FILES filters/spinning/Makefile" ;; "filters/stats/Makefile") CONFIG_FILES="$CONFIG_FILES filters/stats/Makefile" ;; "filters/swab/Makefile") CONFIG_FILES="$CONFIG_FILES filters/swab/Makefile" ;; "filters/tar/Makefile") CONFIG_FILES="$CONFIG_FILES filters/tar/Makefile" ;; "filters/time-limit/Makefile") CONFIG_FILES="$CONFIG_FILES filters/time-limit/Makefile" ;; "filters/tls-fallback/Makefile") CONFIG_FILES="$CONFIG_FILES filters/tls-fallback/Makefile" ;; "filters/truncate/Makefile") CONFIG_FILES="$CONFIG_FILES filters/truncate/Makefile" ;; "filters/xz/Makefile") CONFIG_FILES="$CONFIG_FILES filters/xz/Makefile" ;; "fuzzing/Makefile") CONFIG_FILES="$CONFIG_FILES fuzzing/Makefile" ;; "server/local/nbdkit.pc") CONFIG_FILES="$CONFIG_FILES server/local/nbdkit.pc" ;; "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;; "server/nbdkit.pc") CONFIG_FILES="$CONFIG_FILES server/nbdkit.pc" ;; "tests/functions.sh") CONFIG_FILES="$CONFIG_FILES tests/functions.sh" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "valgrind/Makefile") CONFIG_FILES="$CONFIG_FILES valgrind/Makefile" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps 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 # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # 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 a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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 # 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 DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX 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 # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "podwrapper.pl":F) chmod +x,-w podwrapper.pl ;; "common/protocol/generate-protostrings.sh":F) chmod +x,-w common/protocol/generate-protostrings.sh ;; "tests/make-pki.sh":F) chmod +x,-w tests/make-pki.sh ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo echo echo "----------------------------------------------------------------------" echo "Thank you for downloading $PACKAGE_STRING" echo echo "This is how we have configured the optional components for you today:" echo print () { printf ' %.40s %s\n' \ "$1 ........................................" "$2" } feature () { feat="$1" shift if "$@"; then print "$feat" "yes" else print "$feat" "no" fi } echo "Optional server features:" echo feature "bash-completion" test "x$HAVE_BASH_COMPLETION_TRUE" = "x" feature "libfuzzer (developers only)" \ test "x$ENABLE_LIBFUZZER_TRUE" = "x" feature "linker script" test "x$USE_LINKER_SCRIPT" = "x" feature "manual pages" test "x$HAVE_POD_TRUE" = "x" feature "SELinux" test "x$LIBSELINUX_LIBS" != "x" feature "TLS" test "x$GNUTLS_LIBS" != "x" echo echo "Optional plugins:" echo feature "blkio" test "x$HAVE_LIBBLKIO_TRUE" = "x" feature "curl" test "x$HAVE_CURL_TRUE" = "x" feature "example4" test "x$HAVE_PERL_TRUE" = "x" feature "floppy" test "x$HAVE_ICONV_TRUE" = "x" feature "gcs" test "x$HAVE_PYTHON_TRUE" = "x" feature "guestfs" test "x$HAVE_LIBGUESTFS_TRUE" = "x" feature "iso" test "x$HAVE_ISO_TRUE" = "x" feature "libvirt" test "x$HAVE_LIBVIRT_TRUE" = "x" feature "linuxdisk" test "x$HAVE_MKE2FS_WITH_D_TRUE" = "x" feature "nbd" test "x$HAVE_LIBNBD_TRUE" = "x" feature "S3" test "x$HAVE_PYTHON_TRUE" = "x" feature "ssh" test "x$HAVE_SSH_TRUE" = "x" feature "torrent" test "x$HAVE_TORRENT_TRUE" = "x" feature "vddk" test "x$HAVE_VDDK_TRUE" = "x" echo echo "Languages:" echo feature "go" test "x$HAVE_GOLANG_TRUE" = "x" feature "lua" test "x$HAVE_LUA_TRUE" = "x" feature "ocaml" test "x$HAVE_OCAML_TRUE" = "x" feature "perl" test "x$HAVE_PERL_TRUE" = "x" feature "python" test "x$HAVE_PYTHON_TRUE" = "x" feature "rust" test "x$HAVE_RUST_TRUE" = "x" feature "tcl" test "x$HAVE_TCL_TRUE" = "x" echo echo "Optional filters:" echo feature "bzip2" test "x$HAVE_BZLIB_TRUE" = "x" feature "ext2" test "x$HAVE_EXT2_TRUE" = "x" feature "gzip" test "x$HAVE_ZLIB_TRUE" = "x" feature "luks" test "x$HAVE_GNUTLS_PBKDF2_TRUE" = "x" feature "lzip" test "x$HAVE_LZMA_LZIP_DECODER_TRUE" = "x" feature "stats" test "x$HAVE_CXX_TRUE" = "x" feature "xz" test "x$HAVE_LIBLZMA_TRUE" = "x" echo echo "Other optional features:" echo feature "allocator=zstd" test "x$HAVE_LIBZSTD_TRUE" = "x" feature "compiler warnings" test "x$COMPILER_WARNINGS_TRUE" = "x" feature "tests using libguestfs" \ test "x$HAVE_LIBGUESTFS_TRUE" = "x" && \ test "x$USE_LIBGUESTFS_FOR_TESTS_TRUE" = "x" feature "zlib-ng" test "x$ZLIB_NG_LIBS" != "x" print cc-plugin-CC "$CC_PLUGIN_CC" print cc-plugin-CFLAGS "$CC_PLUGIN_CFLAGS" echo echo "If any optional component is configured ‘no’ when you expected ‘yes’" echo "then you should check the preceding messages and README." echo echo "Please report bugs back to the mailing list:" echo "https://lists.libguestfs.org" echo echo "Next you should type 'make' to build the package," echo "then 'make check' to run the tests." nbdkit-1.42.2/configure.ac0000644000175000017500000017250714771245414011047 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. m4_define([NBDKIT_VERSION_MAJOR], [1]) m4_define([NBDKIT_VERSION_MINOR], [42]) m4_define([NBDKIT_VERSION_MICRO], [2]) AC_INIT([nbdkit], NBDKIT_VERSION_MAJOR.NBDKIT_VERSION_MINOR.NBDKIT_VERSION_MICRO) AC_CONFIG_MACRO_DIR([m4]) dnl This must be used very early else you will get dnl "warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS" m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],[], [m4_define([AC_USE_SYSTEM_EXTENSIONS],[])]) AC_USE_SYSTEM_EXTENSIONS dnl NB: Do not [quote] this parameter. AM_INIT_AUTOMAKE(foreign) LT_INIT([win32-dll]) dnl Extra string, a freeform string defined by downstream packagers. dnl eg. If you are packaging nbdkit for Linux distro X 1.1, you could dnl ./configure --with-extra="X release 1.1" AC_ARG_WITH([extra], [AS_HELP_STRING([--with-extra=...], [extra version information (for use by packagers)])], [NBDKIT_VERSION_EXTRA="$withval"], [NBDKIT_VERSION_EXTRA=] ) AC_DEFINE_UNQUOTED([NBDKIT_VERSION_EXTRA], ["$NBDKIT_VERSION_EXTRA"], [Extra version information (for use by packagers)]) AC_MSG_NOTICE([nbdkit version NBDKIT_VERSION_MAJOR.NBDKIT_VERSION_MINOR.NBDKIT_VERSION_MICRO ($NBDKIT_VERSION_EXTRA)]) dnl List of plugins and filters. lang_plugins="\ cc \ golang \ lua \ ocaml \ perl \ python \ rust \ sh \ tcl \ " non_lang_plugins="\ blkio \ cdi \ curl \ data \ eval \ example1 \ example2 \ example3 \ example4 \ file \ floppy \ full \ gcs \ guestfs \ info \ iso \ libvirt \ linuxdisk \ memory \ nbd \ null \ ondemand \ ones \ partitioning \ pattern \ random \ S3 \ sparse-random \ split \ ssh \ tmpdisk \ torrent \ vddk \ zero \ " plugins="$(echo $(printf %s\\n $lang_plugins $non_lang_plugins | sort -u))" filters="\ blocksize \ blocksize-policy \ bzip2 \ cache \ cacheextents \ checkwrite \ cow \ ddrescue \ delay \ error \ evil \ exitlast \ exitwhen \ exportname \ ext2 \ extentlist \ fua \ gzip \ ip \ limit \ log \ luks \ lzip \ multi-conn \ nocache \ noextents \ nofilter \ noparallel \ nozero \ offset \ partition \ pause \ protect \ qcow2dec \ rate \ readahead \ readonly \ retry \ retry-request \ rotational \ scan \ spinning \ stats \ swab \ tar \ time-limit \ tls-fallback \ truncate \ xz \ " AC_SUBST([plugins]) AC_SUBST([lang_plugins]) AC_SUBST([non_lang_plugins]) AC_SUBST([filters]) dnl Some very basic tools. AC_PROG_SED AC_PROG_RANLIB dnl Bash must be at least version 4. If it is too old, fail hard dnl with a good diagnostic. Note macOS ships an ancient version dnl of bash (https://gitlab.com/nbdkit/nbdkit/-/issues/21) bash=`which bash` AC_MSG_CHECKING([for the major version of $bash]) bash_major=`bash -c 'echo ${BASH_VERSINFO:-0}'` AC_MSG_RESULT([$bash_major]) AS_IF([test $bash_major -lt 4], [AC_MSG_ERROR([ Your bash shell ($bash) is older than version 4. If you are using macOS, please install the latest version of bash from homebrew or macports. If you have installed the latest bash and this error is still showing up, check that \$PATH is set correctly. ])]) dnl Check for basic C environment. AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP AC_SYS_LARGEFILE AC_C_PROTOTYPES test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant]) AM_PROG_CC_C_O dnl Define the host CPU architecture (defines 'host_cpu'). AC_CANONICAL_HOST AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.]) dnl Define 'host_os'. AC_DEFINE_UNQUOTED([host_os],["$host_os"],[Host operating system.]) dnl Defines WORDS_BIGENDIAN on big endian platforms. AC_C_BIGENDIAN dnl These are defined in which is included by dnl AC_DEFAULT_INCLUDES. AC_CHECK_SIZEOF([pid_t]) AC_CHECK_SIZEOF([uid_t]) AC_CHECK_SIZEOF([gid_t]) dnl Check for C++ (optional, we just use this to test the header dnl can be included from C++ code). AC_PROG_CXX dnl The C++ compiler test is pretty useless because even if it fails dnl it sets CXX=g++. So test the compiler actually works. AC_MSG_CHECKING([if the C++ compiler really really works]) AS_IF([$CXX --version >&AS_MESSAGE_LOG_FD 2>&1],[have_cxx=yes],[have_cxx=no]) AC_MSG_RESULT([$have_cxx]) AM_CONDITIONAL([HAVE_CXX], [test "$have_cxx" = "yes"]) dnl If --enable-gcc-warnings is used, then compiler warnings are dnl turned on. Despite the name this applies to GCC, Clang and dnl Rust (clippy) warnings. AC_ARG_ENABLE([gcc-warnings], [AS_HELP_STRING([--enable-gcc-warnings], [turn on compiler warnings (for developers)])], [case $enableval in yes|no) ;; *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; esac compiler_warnings=$enableval], [compiler_warnings=no] ) if test "x$compiler_warnings" = "xyes"; then WARNINGS_CFLAGS="-Wall -Wshadow -Wvla -Werror" AC_SUBST([WARNINGS_CFLAGS]) dnl Hack (temporary?) for FreeBSD which complains about: dnl c++: error: argument unused during compilation: '-pthread' [-Werror,-Wunused-command-line-argument] WARNINGS_MODULE_CXXFLAGS="$WARNINGS_CFLAGS" AC_MSG_CHECKING([if we should disable unused-command-line-argument warning]) AS_CASE([$host_os], [freebsd*], [ WARNINGS_MODULE_CXXFLAGS="$WARNINGS_MODULE_CXXFLAGS -Xcompiler -Wno-unused-command-line-argument" AC_MSG_RESULT([yes]) ], [AC_MSG_RESULT([no])] ) AC_SUBST([WARNINGS_MODULE_CXXFLAGS]) fi AM_CONDITIONAL([COMPILER_WARNINGS], [test "$compiler_warnings" = "yes"]) dnl Check if the compiler supports -std=c90 flag. This is only used dnl during a test. OpenBSD GCC does not support this flag so we skip dnl that test. AC_MSG_CHECKING([if the compiler supports -std=c90 for ANSI C test]) old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=c90" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [supports_std_c90=yes], [supports_std_c90=no]) CFLAGS="$old_CFLAGS" AC_MSG_RESULT([$supports_std_c90]) AM_CONDITIONAL([CAN_TEST_ANSI_C], [test "x$supports_std_c90" = "xyes"]) dnl Check for __builtin_*_overflow. We need the dummy parameters dnl else detection doesn't work correctly for some reason. AC_CHECK_DECLS([__builtin_add_overflow(int, int, int *), __builtin_mul_overflow(int, int, int *)], [], [], []) dnl On Haiku we must use BSD-compatibility headers to get the endian dnl macros we use. AC_MSG_CHECKING(whether OS-dependent include paths are required) AS_CASE([$host_os], [haiku*], [CFLAGS="$CFLAGS -I`findpaths -p /system B_FIND_PATH_HEADERS_DIRECTORY`/bsd"; AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)] ) dnl On Linux /tmp is often tmpfs which is not large enough, so use /var/tmp. dnl But Haiku only has /tmp. AC_MSG_CHECKING([for temporary directory for large files]) AS_CASE([$host_os], [haiku*], [LARGE_TMPDIR=/tmp], [LARGE_TMPDIR=/var/tmp] ) AC_MSG_RESULT([$LARGE_TMPDIR]) AC_DEFINE_UNQUOTED([LARGE_TMPDIR],["$LARGE_TMPDIR"], [Temporary directory for large files]) dnl Check if libc has program_invocation_short_name. AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) AX_PTHREAD dnl Check if __attribute__((cleanup(...))) works. dnl Set -Werror, otherwise gcc will only emit a warning for attributes dnl that it doesn't understand. acx_nbdkit_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -Werror" AC_MSG_CHECKING([if __attribute__((cleanup(...))) works with this compiler]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include #include void freep (void *ptr) { exit (EXIT_SUCCESS); } void test (void) { __attribute__((cleanup(freep))) char *ptr = malloc (100); (void)ptr; } int main (int argc, char *argv[]) { test (); exit (EXIT_FAILURE); } ]]) ],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR( ['__attribute__((cleanup(...)))' does not work. You may not be using a sufficiently recent version of GCC or CLANG, or you may be using a C compiler which does not support this attribute, or the configure test may be wrong. This code requires the attribute to work for proper locking between threads.])]) CFLAGS="${acx_nbdkit_save_CFLAGS}" dnl Check for __auto_type (GCC extension). AC_MSG_CHECKING([if __auto_type is available in this compiler]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ static int test (int a) { __auto_type at = a; return at; } ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_AUTO_TYPE],[1],[__auto_type is available]) ],[ AC_MSG_RESULT([no]) ] ) dnl 'environ' is not always declared in public header files: dnl Linux => Haiku => dnl FreeBSD & OpenBSD => not declared dnl On platforms where it's not declared we must add an extern decl. AC_MSG_CHECKING([if environ is declared in header files]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include #include static int test (void) { char **env = environ; return env ? 1 : 0; // this just forces env to be used } ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_ENVIRON_DECL],[1],[environ is declared in headers]) ],[ AC_MSG_RESULT([no]) ] ) dnl Check sizeof long. AC_CHECK_SIZEOF(long) dnl Check for other headers, all optional. AC_CHECK_HEADERS([\ alloca.h \ afunix.h \ arpa/inet.h \ byteswap.h \ endian.h \ fnmatch.h \ grp.h \ linux/fs.h \ netdb.h \ netinet/in.h \ netinet/tcp.h \ pwd.h \ termios.h \ stdatomic.h \ syslog.h \ sys/disk.h \ sys/disklabel.h \ sys/endian.h \ sys/ioctl.h \ sys/mman.h \ sys/prctl.h \ sys/procctl.h \ sys/socket.h \ sys/statvfs.h \ sys/ucred.h \ sys/un.h \ sys/vsock.h \ sys/wait.h \ winsock2.h]) AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include ]) dnl Check for functions in libc, all optional. AC_CHECK_FUNCS([\ accept4 \ fdatasync \ flockfile \ funlockfile \ inet_ntop \ inet_pton \ mkostemp \ mlock \ mlockall \ munlock \ open_memstream \ pipe \ pipe2 \ ppoll \ posix_fadvise \ posix_memalign \ valloc]) dnl Check for timer_create dnl It may require -lrt. old_LIBS="$LIBS" AC_SEARCH_LIBS([timer_create], [rt], [ AS_IF([test "x$ac_cv_search_timer_create" != "xnone required"], [RT_LIBS="$ac_cv_search_timer_create"], [RT_LIBS=]) AC_SUBST([RT_LIBS]) ], []) AC_CHECK_FUNCS([timer_create]) LIBS="$old_LIBS" dnl Check for structs and members. AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct ucred.uid], [], [], [[ #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UCRED_H #include #endif ]]) AC_CHECK_MEMBERS([struct sockpeercred.uid], [], [], [[ #ifdef HAVE_SYS_SOCKET_H #include #endif ]]) dnl Replacement functions that we provide for some platforms. AC_CONFIG_LIBOBJ_DIR([common/replacements]) AC_REPLACE_FUNCS([\ fdatasync \ fsync \ get_current_dir_name \ getdelim \ getline \ openlog \ open_memstream \ poll \ posix_memalign \ pread \ pwrite \ realpath \ strndup \ sysconf \ syslog \ vsyslog]) dnl Check whether printf("%m") works AC_CACHE_CHECK([whether the printf family supports %m], [nbdkit_cv_func_printf_percent_m], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include #include ]], [[ char buf[200] = ""; errno = EINVAL; snprintf(buf, sizeof buf, "%m"); return !!strcmp (buf, strerror (EINVAL)); ]])], [nbdkit_cv_func_printf_percent_m=yes], [nbdkit_cv_func_printf_percent_m=no], [[ case "$host_os" in *-gnu* | gnu*) nbdkit_cv_func_printf_percent_m=yes;; *) nbdkit_cv_func_printf_percent_m="guessing no";; esac ]])]) AS_IF([test "x$nbdkit_cv_func_printf_percent_m" = xyes], [AC_DEFINE([HAVE_VFPRINTF_PERCENT_M],[1], [Define to 1 if vfprintf supports %m.])]) dnl Check for dlsym (required, on Windows install dlfcn). old_LIBS="$LIBS" AC_SEARCH_LIBS([dlsym], [dl dld], [ AS_IF([test "x$ac_cv_search_dlsym" != "xnone required"], [DL_LIBS="$ac_cv_search_dlsym"], [DL_LIBS=]) AC_SUBST([DL_LIBS]) ], [AC_MSG_ERROR([unable to find the dlsym() function]) ]) LIBS="$old_LIBS" dnl Check for dladdr in -ldl (optional, this is a glibc extension). old_LIBS="$LIBS" LIBS="$DL_LIBS $LIBS" AC_CHECK_FUNCS([dladdr]) LIBS="$old_LIBS" dnl Test if header can build working binaries. dnl dnl On FreeBSD: iconv and libiconv both exist, both can be installed dnl simultaneously, can exist in two separate places, and dnl if you get the wrong header/library mix everything breaks. dnl dnl On Haiku: libiconv is required to link to iconv_* functions. AC_ARG_WITH([iconv], [AS_HELP_STRING([--without-iconv], [don't try to link against iconv @<:@default=check@:>@])], [], [with_iconv=check]) AS_IF([test "x$with_iconv" != "xno"],[ AC_CHECK_HEADER([iconv.h],[ AC_MSG_CHECKING([if can be used to link a program]) AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include #include #include int main (int argc, char *argv[]) { iconv_t ic = iconv_open ("", ""); iconv_close (ic); exit (0); } ]]) ],[ AC_MSG_RESULT([yes]) iconv_working=yes ],[ AC_MSG_RESULT([no]) ]) ]) ]) AM_CONDITIONAL([HAVE_ICONV], [test "x$iconv_working" = "xyes"]) use_linker_script=yes dnl Don't use linker script on FreeBSD because FreeBSD's linker is dnl broken. See eg: dnl https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190851 dnl Also on macOS (darwin) which fails with: dnl ld: unknown option: --version-script=./nbdkit.syms dnl clang: error: linker command failed with exit code 1 AC_MSG_CHECKING([if we should disable the linker script (FreeBSD, macOS)]) AS_CASE([$host_os], [freebsd*|darwin*], [ use_linker_script=no AC_MSG_RESULT([yes]) ], [AC_MSG_RESULT([no])] ) dnl Check if -rdynamic linker flag works. acx_nbdkit_save_LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS} -rdynamic" AC_MSG_CHECKING([if linker supports -rdynamic]) AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include int main (int argc, char *argv[]) { exit (EXIT_SUCCESS); } ]]) ],[ AC_MSG_RESULT([yes]) DL_LDFLAGS=-rdynamic ],[ AC_MSG_RESULT([no]) ]) dnl restore CFLAGS LDFLAGS="${acx_nbdkit_save_LDFLAGS}" AC_SUBST([DL_LDFLAGS]) dnl Is this Windows? AC_MSG_CHECKING([if the target is Windows]) AS_CASE([$host_os], [mingw*|msys*], [ is_windows=yes LIBS="$LIBS -lkernel32 -luser32 -lws2_32" NO_UNDEFINED_ON_WINDOWS="-no-undefined" IMPORT_LIBRARY_ON_WINDOWS='-Wl,-L$(top_builddir)/server -Wl,-lnbdkit' SOEXT="dll" DIR_SEPARATOR_STR='\\' ], [is_windows=no SOEXT="so" DIR_SEPARATOR_STR=/] ) AC_MSG_RESULT([$is_windows]) AC_SUBST([NO_UNDEFINED_ON_WINDOWS]) AC_SUBST([IMPORT_LIBRARY_ON_WINDOWS]) AC_SUBST([SOEXT]) AC_DEFINE_UNQUOTED([SOEXT],["$SOEXT"],[Extension used for shared objects/DLLs.]) AC_DEFINE_UNQUOTED([EXEEXT],["$EXEEXT"],[Extension used for executables.]) AC_DEFINE_UNQUOTED([DIR_SEPARATOR_STR],["$DIR_SEPARATOR_STR"], [String that separates path elements.]) AM_CONDITIONAL([IS_WINDOWS],[test "x$is_windows" = "xyes"]) dnl Look for the mc/windmc utility (optional). AC_CHECK_TOOLS([MC],[windmc mc.exe],[no]) AM_CONDITIONAL([HAVE_MC],[test "x$MC" != "xno"]) dnl On Windows look for dlltool. AS_IF([test "x$is_windows" = "xyes"],[ AC_CHECK_TOOLS([DLLTOOL],[dlltool],[no]) AS_IF([test "x$DLLTOOL" = "xno"], [AC_MSG_ERROR([dlltool utility must be available when compiling for Windows])]) ]) dnl See if getaddrinfo requires an external library. AC_SEARCH_LIBS([getaddrinfo], [network socket]) dnl Does this platform support libc_malloc_debug.so.0 (glibc >= 2.34)? AC_MSG_CHECKING([if this is glibc >= 2.34]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 34) #error "not glibc 2.34" #endif ]])], [if (LD_PRELOAD=libc_malloc_debug.so.0 /bin/true) 2>&1 | grep .; then is_glibc_234='missing suitable libc_malloc_debug.so.0' else is_glibc_234=yes fi], [is_glibc_234=no] ) AC_MSG_RESULT([$is_glibc_234]) AM_CONDITIONAL([HAVE_GLIBC_234], [test "x$is_glibc_234" = "xyes"]) dnl Check for SELinux socket labelling (optional). AC_ARG_WITH([selinux], AS_HELP_STRING([--without-selinux], [disable SELinux support, used for socket labelling @<:@default=check@:>@])) AS_IF([test "x$with_selinux" != xno], [ PKG_CHECK_MODULES([LIBSELINUX], [libselinux], [ AC_SUBST([LIBSELINUX_CFLAGS]) AC_SUBST([LIBSELINUX_LIBS]) AC_DEFINE([HAVE_LIBSELINUX],[1],[libselinux found at compile time.]) ], [AC_MSG_WARN([libselinux not found, sockets will not be labeled.])]) ]) AS_IF([test "x$with_selinux" = xyes && test "x$LIBSELINUX_LIBS" = x], [ AC_MSG_ERROR([selinux requested but not found]) ]) dnl Check for GnuTLS (optional, for TLS support). AC_ARG_WITH([gnutls], [AS_HELP_STRING([--without-gnutls], [disable TLS support via GnuTLS @<:@default=check@:>@])]) AS_IF([test "x$with_gnutls" != xno], [ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.5.18], [ AC_SUBST([GNUTLS_CFLAGS]) AC_SUBST([GNUTLS_LIBS]) AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.]) ], [ AC_MSG_WARN([gnutls not found or < 3.5.18, TLS support will be disabled.]) ]) ]) AS_IF([test "x$with_gnutls" = xyes && test x"$GNUTLS_LIBS" = x], [ AC_MSG_ERROR([gnutls requested but not found]) ]) AM_CONDITIONAL([HAVE_GNUTLS], [test "x$GNUTLS_LIBS" != "x"]) AS_IF([test "x$GNUTLS_LIBS" != "x"],[ AC_MSG_CHECKING([for default TLS session priority string]) AC_ARG_WITH([tls-priority], [AS_HELP_STRING([--with-tls-priority=...], [default TLS session priority string @<:@default=NORMAL@:>@])], [tls_priority=$withval], [tls_priority=NORMAL]) AC_MSG_RESULT([$tls_priority]) AC_DEFINE_UNQUOTED([TLS_PRIORITY],["$tls_priority"], [Default TLS session priority string]) # Check for working . This is only needed for # gnutls 3.7.9 and no other version (unfortunately used by Debian # 12 and others). In that release kTLS functionality was added to # incorrectly, before being moved to # in 3.8.0. breaks on # Windows, so we must make inclusion conditional. When we move # the minimum version of gnutls >= 3.8.0 we can get rid of this. old_CFLAGS="$CFLAGS" CFLAGS="$GNUTLS_CFLAGS $CFLAGS" AC_CHECK_HEADERS([gnutls/socket.h]) CFLAGS="$old_CFLAGS" # Check for APIs which may not be present. old_LIBS="$LIBS" LIBS="$GNUTLS_LIBS $LIBS" AC_CHECK_FUNCS([\ gnutls_base64_decode2 \ gnutls_certificate_set_known_dh_params \ gnutls_group_get \ gnutls_group_get_name \ gnutls_pbkdf2 \ gnutls_srp_server_get_username \ gnutls_transport_is_ktls_enabled \ ]) LIBS="$old_LIBS" dnl macOS has its own program called certtool and packages the dnl GnuTLS tool as "gnutls-certtool". AC_CHECK_PROGS([CERTTOOL],[gnutls-certtool certtool],[certtool]) ]) AM_CONDITIONAL([HAVE_GNUTLS_PBKDF2], [test "x$GNUTLS_LIBS" != "x" && test "x$ac_cv_func_gnutls_pbkdf2" = xyes]) dnl Check for some commands used by the tests which should be the GNU dnl coreutils variants. On macOS these are prefixed with 'g' or 'gnu'. AC_CHECK_PROGS([CUT],[gnucut cut],[cut]) AC_CHECK_PROGS([STAT],[gstat stat],[stat]) AC_CHECK_PROGS([TRUNCATE],[gtruncate truncate],[truncate]) dnl Check for valgrind. AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[no]) dnl If valgrind headers are available (optional). dnl Although the runtime check adds only a trivial amount of code, you can dnl avoid it with explicit --disable-valgrind. AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--disable-valgrind], [disable Valgrind probe])], [], [enable_valgrind=check]) AS_IF([test "x$enable_valgrind" != "xno"],[ PKG_CHECK_MODULES([VALGRIND], [valgrind], [ AC_SUBST([VALGRIND_CFLAGS]) AC_SUBST([VALGRIND_LIBS]) AC_DEFINE([HAVE_VALGRIND],[1],[Valgrind headers found at compile time]) ],[ AS_IF([test "x$enable_valgrind" = "xyes"], [ AC_MSG_ERROR([--enable-valgrind given, but Valgrind headers are not available]) ]) ]) ]) dnl Build the special libFuzzer version of nbdkit. DO NOT USE THIS for dnl normal builds. See fuzzing/README. AC_ARG_ENABLE([libfuzzer], [AS_HELP_STRING([--enable-libfuzzer], [build libFuzzer test binary (developers only)])], [], [enable_libfuzzer=no]) AS_IF([test "x$enable_libfuzzer" = "xyes"],[ AC_DEFINE([ENABLE_LIBFUZZER],[1],[Enable special libFuzzer binary]) # We have to disable the linker script for libFuzzer because Clang # adds loads of fuzzer and ASAN-related symbols that are required # by the plugins but which our linker script tries to hide. use_linker_script=no ]) AM_CONDITIONAL([ENABLE_LIBFUZZER],[test "x$enable_libfuzzer" = "xyes"]) dnl Should we use the linker script (ld --version-script)? Note dnl some tests above may set this variable. AC_ARG_ENABLE([linker-script], [AS_HELP_STRING([--disable-linker-script], [disable linker script for server (developers only)])], [use_linker_script=$enableval], []) AM_CONDITIONAL([USE_LINKER_SCRIPT], [test "x$use_linker_script" = "xyes"]) dnl Bash completion. AC_ARG_WITH([bash-completions], [AS_HELP_STRING([--without-bash-completions], [disable installing bash completions @<:@default=check@:>@])]) AS_IF([test "x$with_bash_completions" != xno], [ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [ bash_completion=yes AC_MSG_CHECKING([for bash-completions directory]) m4_ifdef([PKG_CHECK_VAR],[ PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir]) ]) AS_IF([test -z "$bashcompdir"], [ bashcompdir="${sysconfdir}/bash_completion.d" ]) AC_MSG_RESULT([$bashcompdir]) AC_SUBST([bashcompdir]) ],[ bash_completion=no AC_MSG_WARN([bash-completion not installed]) ]) ]) AS_IF([test "x$bash_completion" = xno && test "x$with_bash_completions" = xyes], [ AC_MSG_ERROR([bash-completions requested but required packages not found]) ]) AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"]) dnl Check we have enough to run podwrapper. AC_ARG_WITH([manpages], [AS_HELP_STRING([--without-manpages], [do not build man pages @<:@default=check@:>@])], [], [: m4_divert_text([DEFAULTS], [with_manpages=check])]) enable_pod=no AC_CHECK_PROGS([PERL], [perl], []) AS_IF([test "x$with_manpages" != xno], [ AS_IF([test "x$PERL" != "x"],[ AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple]) AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[ enable_pod=yes ]) AC_MSG_RESULT([$enable_pod]) ]) ]) AS_IF([test "x$enable_pod" = xno && test "x$with_manpages" = xyes], [ AC_MSG_ERROR([man-pages requested but required packages not found]) ]) AM_CONDITIONAL([HAVE_POD], [test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"]) dnl Define the path to the podwrapper program. PODWRAPPER="$PERL $(pwd)/podwrapper.pl" AC_SUBST([PODWRAPPER]) dnl Allow all plugins and filters to be disabled. AC_ARG_ENABLE([plugins], [AS_HELP_STRING([--disable-plugins], [disable all bundled plugins and filters])]) AM_CONDITIONAL([HAVE_PLUGINS], [test "x$enable_plugins" != "xno"]) dnl For the cc plugin, let the user hard-code their preferred compiler setup dnl Default to the settings used for nbdkit itself AC_ARG_VAR([CC_PLUGIN_CC], [value to hard-code into the cc plugin's default for CC, instead of $CC]) : "${CC_PLUGIN_CC:=$CC}" AC_ARG_VAR([CC_PLUGIN_CFLAGS], [value to hard-code into the cc plugin's default for CFLAGS, instead of $CFLAGS]) : "${CC_PLUGIN_CFLAGS:=$CFLAGS}" dnl Check for Perl, for embedding in the perl plugin. dnl Note that the perl binary is checked above. AC_ARG_ENABLE([perl], [AS_HELP_STRING([--disable-perl], [disable Perl embed plugin])], [], [enable_perl=yes]) AS_IF([test "x$PERL" != "xno" && test "x$enable_perl" != "xno"],[ dnl Check for Perl archlib. AC_MSG_CHECKING([for Perl embed archlib]) PERL_ARCHLIB="$($PERL -MConfig -e 'print $Config{archlib}')" AS_IF([ test -n "$PERL_ARCHLIB" ],[ AC_MSG_RESULT([$PERL_ARCHLIB]) ],[ AC_MSG_NOTICE([Perl embed module disabled]) enable_perl=no ]) dnl Check for Perl CFLAGS. AC_MSG_CHECKING([for Perl embed CFLAGS]) PERL_CFLAGS="$($PERL -MExtUtils::Embed -e 'ccflags')" AS_IF([ test -n "$PERL_CFLAGS" ],[ AC_MSG_RESULT([$PERL_CFLAGS]) ],[ AC_MSG_NOTICE([Perl embed module disabled]) enable_perl=no ]) dnl Check for Perl LDOPTS. AC_MSG_CHECKING([for Perl embed LDOPTS]) PERL_LDOPTS="$($PERL -MExtUtils::Embed -e 'ldopts')" AC_MSG_RESULT([$PERL_LDOPTS]) dnl Check these actually work. old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$PERL_CFLAGS -I$PERL_ARCHLIB/CORE $CFLAGS" LIBS="$PERL_LDOPTS $LIBS" AC_CHECK_FUNCS([perl_alloc]) CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" AC_MSG_CHECKING([whether Perl modules will compile]) if test "x$ac_cv_func_perl_alloc" = xyes; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) enable_perl=no fi ]) AM_CONDITIONAL([HAVE_PERL],[test "x$enable_perl" != "xno" && test "x$PERL" != "xno"]) AC_SUBST([PERL_ARCHLIB]) AC_SUBST([PERL_CFLAGS]) AC_SUBST([PERL_LDOPTS]) dnl Check for Python 3, for embedding in the python plugin. AC_PATH_PROGS([PYTHON],[python3 python],[no]) AC_ARG_ENABLE([python], [AS_HELP_STRING([--disable-python], [disable Python embed plugin])], [], [enable_python=yes]) AS_IF([test "x$PYTHON" != "xno" && test "x$enable_python" != "xno"],[ AC_MSG_CHECKING([version of $PYTHON]) PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"` PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"` PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR" AS_IF([test -n "$PYTHON_VERSION"],[ AC_MSG_RESULT([$PYTHON_VERSION]) ],[ AC_MSG_NOTICE([Python embed module disabled]) enable_python=no ]) AC_MSG_CHECKING([Python major version is 3]) AS_IF([test "x$PYTHON_VERSION_MAJOR" = "x3"],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([Python $PYTHON_VERSION_MAJOR <> 3 is no longer supported. Python 2 end of life was 2020-01-01 and nbdkit >= 1.16 no longer supports it. If you want to use Python 2, you will need to use nbdkit 1.14.]) ]) dnl Check for Python CFLAGS, libraries. dnl For Python >= 3.8 we have to use python--embed.pc, see: dnl https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build dnl The python.pc is called python-.pc on Debian and dnl later versions of Fedora, and python.pc on older versions dnl of Fedora. PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION-embed], [ AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_LIBS]) AC_SUBST([PYTHON_VERSION]) AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time]) ],[ PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [ AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_LIBS]) AC_SUBST([PYTHON_VERSION]) AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time]) ],[ PKG_CHECK_MODULES([PYTHON], [python], [ AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_LIBS]) AC_SUBST([PYTHON_VERSION]) AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time]) ],[ AC_MSG_WARN([python $PYTHON_VERSION not found]) enable_python=no ])])]) ]) AM_CONDITIONAL([HAVE_PYTHON],[test "x$enable_python" != "xno" && test "x$PYTHON" != "xno"]) AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_LIBS]) AC_SUBST([PYTHON_LDFLAGS]) dnl For the OCaml plugin, you can set OCAMLOPTFLAGS before running dnl ./configure to specify any extra flags you want to pass to dnl ocamlopt. For example to enable debug symbols & warnings: dnl OCAMLOPTFLAGS="-g -warn-error +A-3" AC_SUBST([OCAMLOPTFLAGS]) dnl Check for OCaml, for embedding in the ocaml plugin. AC_PROG_OCAML AC_ARG_ENABLE([ocaml], [AS_HELP_STRING([--disable-ocaml], [disable OCaml embed plugin])], [], [enable_ocaml=yes]) AS_IF([test "x$OCAMLOPT" != "xno" && test "x$enable_ocaml" != "xno"],[ dnl Check OCaml can create a shared library (see README for details). AC_MSG_CHECKING([if $OCAMLOPT can create a shared library]) echo 'print_endline "test"' > conftest.ml AS_IF([$OCAMLOPT $OCAMLOPTFLAGS -output-obj -runtime-variant _pic -o conftest.so conftest.ml >&AS_MESSAGE_LOG_FD 2>&1],[ AC_MSG_RESULT([yes]) ocaml_link_shared=yes ],[ AC_MSG_RESULT([no]) ]) rm -f conftest.ml conftest.cmi conftest.cmx conftest.so conftest.o ]) AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLOPT" != "xno" && test "x$ocaml_link_shared" = "xyes"]) AM_CONDITIONAL([HAVE_OCAMLDOC],[test "x$OCAMLDOC" != "xno"]) AS_IF([test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && \ test "x$enable_ocaml" = "xyes"],[ dnl Check for how to link OCaml plugins. AC_MSG_CHECKING([major version of OCaml]) [OCAML_MAJOR=` echo $OCAMLVERSION | $SED 's/\([[:digit:]]*\).*/\1/' `] AC_MSG_RESULT([$OCAML_MAJOR]) AC_SUBST([OCAML_MAJOR]) AC_MSG_CHECKING([for what libraries are needed for OCaml plugins]) AS_IF([test $OCAML_MAJOR -ge 5],[ OCAML_STD_INCLUDES="-I +unix -I +threads" # bigarray is part of the stdlib in OCaml >= 5 OCAML_PLUGIN_LIBRARIES="unix.cmxa threads.cmxa" ],[ OCAML_STD_INCLUDES="" OCAML_PLUGIN_LIBRARIES="unix.cmxa bigarray.cmxa" ]) AC_MSG_RESULT([$OCAML_STD_INCLUDES $OCAML_PLUGIN_LIBRARIES]) AC_SUBST([OCAML_STD_INCLUDES]) AC_SUBST([OCAML_PLUGIN_LIBRARIES]) dnl Check if OCaml has caml_alloc_initialized_string (added 2017). AC_MSG_CHECKING([for caml_alloc_initialized_string]) cat >conftest.c <<'EOF' #include int main () { char *p = (void *) caml_alloc_initialized_string; return 0; } EOF AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CAML_ALLOC_INITIALIZED_STRING],[1], [caml_alloc_initialized_string found at compile time.]) ],[ AC_MSG_RESULT([no]) ]) rm -f conftest.c conftest.o dnl Check if OCaml has caml_shutdown (added 2014). AC_MSG_CHECKING([for caml_shutdown]) cat >conftest.c <<'EOF' #include int main () { char *p = (void *) caml_shutdown; return 0; } EOF AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CAML_SHUTDOWN],[1], [caml_shutdown found at compile time.]) ],[ AC_MSG_RESULT([no]) ]) rm -f conftest.c conftest.o dnl Check if OCaml has AC_MSG_CHECKING([for caml/socketaddr.h]) cat >conftest.c <<'EOF' #include #include int main () { return 0; } EOF AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CAML_SOCKETADDR_H],[1], [caml/socketaddr.h found at compile time.]) ],[ AC_MSG_RESULT([no]) ]) rm -f conftest.c conftest.o dnl Check if OCaml has caml_unix_alloc_sockaddr (added OCaml 5 in 2022). AC_MSG_CHECKING([for caml_unix_alloc_sockaddr]) cat >conftest.c <<'EOF' #include #include int main () { char *p = (void *) caml_unix_alloc_sockaddr; return 0; } EOF AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CAML_UNIX_ALLOC_SOCKADDR],[1], [caml_unix_alloc_sockaddr found at compile time.]) ],[ AC_MSG_RESULT([no]) ]) rm -f conftest.c conftest.o ]) dnl For developing plugins in Rust, optional. dnl Rust does not play nicely with VPATH builds AC_CHECK_PROG([CARGO],[cargo],[cargo],[no]) AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no]) AC_ARG_ENABLE([rust], [AS_HELP_STRING([--disable-rust], [disable Rust plugin])], [], [if test "x$(realpath $srcdir)" = "x$(realpath .)"; then enable_rust=yes else enable_rust=no fi]) AS_IF([test "x$enable_rust" != "xno" && test "x$CARGO" != "xno" && test "x$RUSTC" != "xno"], [have_rust=yes], [have_rust=no]) AM_CONDITIONAL([HAVE_RUST], [test "x$have_rust" = "xyes"]) AS_IF([test "x$have_rust" = "xyes"], [ printf "cargo version: "; $CARGO --version printf "rustc version: "; $RUSTC --version ]) dnl Check for Tcl, for embedding in the Tcl plugin. AC_ARG_ENABLE([tcl], [AS_HELP_STRING([--disable-tcl], [disable Tcl plugin])], [], [enable_tcl=yes]) AS_IF([test "x$enable_tcl" != "xno"],[ PKG_CHECK_MODULES([TCL], [tcl], [ AC_SUBST([TCL_CFLAGS]) AC_SUBST([TCL_LIBS]) ],[ AC_MSG_WARN([Tcl not found]) enable_tcl=no ]) ]) AM_CONDITIONAL([HAVE_TCL],[test "x$enable_tcl" = "xyes"]) dnl Check for Lua, for embedding in the Lua plugin. AC_ARG_ENABLE([lua], [AS_HELP_STRING([--disable-lua], [disable Lua plugin])], [], [enable_lua=yes]) AS_IF([test "x$enable_lua" != "xno"],[ PKG_CHECK_MODULES([LUA], [lua], [ AC_SUBST([LUA_CFLAGS]) AC_SUBST([LUA_LIBS]) dnl Lua 5.1 used by RHEL 7 does not have lua_isinteger. old_LIBS="$LIBS" LIBS="$LUA_LIBS $LIBS" AC_CHECK_FUNCS([lua_isinteger]) LIBS="$old_LIBS" ],[ AC_MSG_WARN([Lua not found]) enable_lua=no ]) ]) AM_CONDITIONAL([HAVE_LUA],[test "x$enable_lua" = "xyes"]) dnl Check for golang. AC_ARG_ENABLE([golang], AS_HELP_STRING([--disable-golang], [disable Go language plugin]), [], [enable_golang=yes]) AS_IF([test "x$enable_golang" != "xno"],[ AC_CHECK_PROG([GOLANG],[go],[go],[no]) AS_IF([test "x$GOLANG" != "xno"],[ AC_MSG_CHECKING([if $GOLANG is usable]) AS_IF([$GOLANG run $srcdir/plugins/golang/config-test.go 2>&AS_MESSAGE_LOG_FD && \ $GOLANG help modules 2>&AS_MESSAGE_LOG_FD 1>&2],[ AC_MSG_RESULT([yes]) # Substitute some golang environment. GOOS=`$GOLANG env GOOS` GOARCH=`$GOLANG env GOARCH` GOROOT=`$GOLANG env GOROOT` AC_SUBST([GOOS]) AC_SUBST([GOARCH]) AC_SUBST([GOROOT]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([golang ($GOLANG) is installed but not usable]) GOLANG=no ]) ]) ],[GOLANG=no]) AM_CONDITIONAL([HAVE_GOLANG],[test "x$GOLANG" != "xno"]) dnl Check for libblkio (only if you want to compile the blkio plugin). AC_ARG_WITH([libblkio], [AS_HELP_STRING([--without-libblkio], [disable blkio plugin @<:@default=check@:>@])], [], [with_libblkio=check]) AS_IF([test "$with_libblkio" != "no"],[ PKG_CHECK_MODULES([LIBBLKIO], [blkio],[ printf "libblkio version is "; $PKG_CONFIG --modversion blkio AC_SUBST([LIBBLKIO_CFLAGS]) AC_SUBST([LIBBLKIO_LIBS]) AC_DEFINE([HAVE_LIBBLKIO],[1],[libblkio found at compile time.]) ], [AC_MSG_WARN([libblkio not found, blkio plugin will be disabled])]) ]) AM_CONDITIONAL([HAVE_LIBBLKIO],[test "x$LIBBLKIO_LIBS" != "x"]) dnl Check for curl (only if you want to compile the curl plugin). AC_ARG_WITH([curl], [AS_HELP_STRING([--without-curl], [disable curl plugin @<:@default=check@:>@])], [], [with_curl=check]) AS_IF([test "$with_curl" != "no"],[ PKG_CHECK_MODULES([CURL], [libcurl],[ printf "libcurl version is "; $PKG_CONFIG --modversion libcurl AC_SUBST([CURL_CFLAGS]) AC_SUBST([CURL_LIBS]) old_CFLAGS="$CFLAGS" CFLAGS="$CURL_CFLAGS $CFLAGS" AC_DEFINE([HAVE_CURL],[1],[curl found at compile time.]) AC_CHECK_DECL([CURLOPT_UNIX_SOCKET_PATH], [ AC_DEFINE([HAVE_CURLOPT_UNIX_SOCKET_PATH],[1], [CURLOPT_UNIX_SOCKET_PATH found at compile time.]) ], [], [#include ]) dnl Detect both CURLOPT_PROTOCOLS_STR and dnl CURLOPT_REDIR_PROTOCOLS_STR. Both were added in curl dnl 7.85.0 so we assume if one exists then both do. AC_CHECK_DECL([CURLOPT_PROTOCOLS_STR], [ AC_DEFINE([HAVE_CURLOPT_PROTOCOLS_STR],[1], [CURLOPT_PROTOCOLS_STR found at compile time.]) ], [], [#include ]) dnl Detect various HTTP version enums supported by curl. AC_CHECK_DECL([CURL_HTTP_VERSION_2_0], [ AC_DEFINE([HAVE_CURL_HTTP_VERSION_2_0],[1], [CURL_HTTP_VERSION_2_0 found at compile time.]) ], [], [#include ]) AC_CHECK_DECL([CURL_HTTP_VERSION_2TLS], [ AC_DEFINE([HAVE_CURL_HTTP_VERSION_2TLS],[1], [CURL_HTTP_VERSION_2TLS found at compile time.]) ], [], [#include ]) AC_CHECK_DECL([CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE], [ AC_DEFINE([HAVE_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE],[1], [CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE found at compile time.]) ], [], [#include ]) AC_CHECK_DECL([CURL_HTTP_VERSION_3], [ AC_DEFINE([HAVE_CURL_HTTP_VERSION_3],[1], [CURL_HTTP_VERSION_3 found at compile time.]) ], [], [#include ]) AC_CHECK_DECL([CURL_HTTP_VERSION_3ONLY], [ AC_DEFINE([HAVE_CURL_HTTP_VERSION_3ONLY],[1], [CURL_HTTP_VERSION_3ONLY found at compile time.]) ], [], [#include ]) CFLAGS="$old_CFLAGS" dnl curl_multi_get_handles was added as a semi-experimental dnl feature in curl 8.3.1. dnl https://github.com/curl/curl/pull/11750 dnl https://github.com/curl/curl/commit/9ffd4117357 dnl curl_version_info was added in 7.10 old_LIBS="$LIBS" LIBS="$CURL_LIBS $LIBS" AC_CHECK_FUNCS([\ curl_multi_get_handles \ curl_version_info \ ]) LIBS="$old_LIBS" ], [AC_MSG_WARN([curl not found, curl plugin will be disabled])]) ]) AM_CONDITIONAL([HAVE_CURL],[test "x$CURL_LIBS" != "x"]) dnl Check for libssh (only if you want to compile the ssh plugin). AC_ARG_WITH([ssh], [AS_HELP_STRING([--without-ssh], [disable ssh plugin @<:@default=check@:>@])], [], [with_ssh=check]) AS_IF([test "$with_ssh" != "no"],[ PKG_CHECK_MODULES([SSH], [libssh >= 0.8.0],[ printf "libssh version is "; $PKG_CONFIG --modversion libssh # Ubuntu 18.04 shipped prerelease of libssh-0.8.0 without # SSH_OPTIONS_NODELAY old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $SSH_CFLAGS" AC_CHECK_DECL([SSH_OPTIONS_NODELAY], [ AC_SUBST([SSH_CFLAGS]) AC_SUBST([SSH_LIBS]) # We don't need this in the code, just in this configure HAVE_SSH_OPTIONS_NODELAY=1 ], [], [ #include ]) CFLAGS="$old_CFLAGS" ], [AC_MSG_WARN([libssh not found, ssh plugin will be disabled])]) ]) AM_CONDITIONAL([HAVE_SSH],[test "x$HAVE_SSH_OPTIONS_NODELAY" != "x"]) dnl Check for xorriso or genisoimage or mkisofs dnl (only if you want to compile the iso plugin). ISOPROG="no" is_xorriso=0 AC_ARG_WITH([iso], [AS_HELP_STRING([--without-iso], [disable iso plugin @<:@default=check@:>@])], [], [with_iso=check]) AS_IF([test "$with_iso" != "no"],[ AC_CHECK_PROG([XORRISO],[xorriso],[xorriso],[no]) AC_CHECK_PROG([GENISOIMAGE],[genisoimage],[genisoimage],[no]) AC_CHECK_PROG([MKISOFS],[mkisofs],[mkisofs],[no]) AS_IF([test "x$XORRISO" != "xno"],[ ISOPROG="$XORRISO" is_xorriso=1 ],[ AS_IF([test "x$GENISOIMAGE" != "xno"],[ ISOPROG="$GENISOIMAGE" ],[ AS_IF([test "x$MKISOFS" != "xno"],[ ISOPROG="$MKISOFS" ]) ]) ]) AS_IF([test "x$ISOPROG" != "xno"],[ printf "picked %s for nbdkit-iso-plugin\n" "$ISOPROG" AC_DEFINE_UNQUOTED([ISOPROG],["$ISOPROG"], [Program used by iso plugin to make ISOs.]) AS_IF([test "x$is_xorriso" = "x1"], [ AC_DEFINE([ISOPROG_IS_XORRISO],[1], [ISO program behaves like xorriso.]) ]) ]) ]) AC_SUBST([ISOPROG]) AM_CONDITIONAL([HAVE_ISO],[test "x$ISOPROG" != "xno"]) dnl Check for libvirt (only if you want to compile the libvirt plugin). AC_ARG_WITH([libvirt], [AS_HELP_STRING([--without-libvirt], [disable libvirt plugin @<:@default=check@:>@])], [], [with_libvirt=check]) AS_IF([test "$with_libvirt" != "no"],[ PKG_CHECK_MODULES([LIBVIRT], [libvirt],[ AC_SUBST([LIBVIRT_CFLAGS]) AC_SUBST([LIBVIRT_LIBS]) AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.]) ], [AC_MSG_WARN([libvirt not found, libvirt plugin will be disabled])]) ]) AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"]) dnl Check for bzlib (only if you want to compile the bzip2 filter). AC_ARG_WITH([bzip2], [AS_HELP_STRING([--without-bzip2], [disable bzip2 filter @<:@default=check@:>@])], [], [with_bzip2=check]) AS_IF([test "$with_bzip2" != "no"],[ PKG_CHECK_MODULES([BZLIB], [bzip2],[ AC_SUBST([BZLIB_CFLAGS]) AC_SUBST([BZLIB_LIBS]) AC_DEFINE([HAVE_BZLIB],[1],[libbz2 found at compile time.]) AC_CHECK_PROGS([BZIP2],[bzip2],[no]) ], [AC_MSG_WARN([libbz2 not found, bzip2 filter will be disabled])]) ]) AM_CONDITIONAL([HAVE_BZLIB], [test "x$BZLIB_LIBS" != "x" && test "x$BZIP2" != "xno"]) dnl Check for zlib (only if you want to compile the gzip filter). AC_ARG_WITH([zlib], [AS_HELP_STRING([--without-zlib], [disable gzip filter @<:@default=check@:>@])], [], [with_zlib=check]) AS_IF([test "$with_zlib" != "no"],[ PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3.5],[ AC_SUBST([ZLIB_CFLAGS]) AC_SUBST([ZLIB_LIBS]) AC_DEFINE([HAVE_ZLIB],[1],[zlib found at compile time.]) ], [AC_MSG_WARN([zlib >= 1.2.3.5 not found, gzip filter will be disabled])]) ]) AM_CONDITIONAL([HAVE_ZLIB],[test "x$ZLIB_LIBS" != "x"]) dnl Check for zlib-ng (optimizes uses of zlib). AC_ARG_WITH([zlib-ng], [AS_HELP_STRING([--without-zlib-ng], [disable zlib-ng support @<:@default=check@:>@])], [], [with_zlib_ng=check]) AS_IF([test "$with_zlib_ng" != "no"],[ PKG_CHECK_MODULES([ZLIB_NG], [zlib-ng],[ AC_SUBST([ZLIB_NG_CFLAGS]) AC_SUBST([ZLIB_NG_LIBS]) AC_DEFINE([HAVE_ZLIB_NG],[1],[zlib-ng found at compile time.]) ], [AC_MSG_WARN([zlib-ng not found, zlib operations will run slower])]) ]) AM_CONDITIONAL([HAVE_ZLIB],[test "x$ZLIB_LIBS" != "x"]) dnl Check for libnbd (only if you want to compile the nbd plugin, and dnl to run some tests). AC_ARG_WITH([libnbd], [AS_HELP_STRING([--without-libnbd], [disable nbd plugin @<:@default=check@:>@])], [], [with_libnbd=check]) AS_IF([test "$with_libnbd" != "no"],[ PKG_CHECK_MODULES([LIBNBD], [libnbd >= 0.9.8],[ printf "libnbd version is "; $PKG_CONFIG --modversion libnbd AC_SUBST([LIBNBD_CFLAGS]) AC_SUBST([LIBNBD_LIBS]) AC_DEFINE([HAVE_LIBNBD],[1],[libnbd found at compile time.]) ], [AC_MSG_WARN([libnbd >= 0.9.8 not found, nbd plugin will be crippled])]) ]) dnl For backwards compatibilty, we have a second way to disable the nbd plugin. AC_ARG_ENABLE([nbd-plugin], [AS_HELP_STRING([--disable-nbd-plugin], [disable nbd plugin (deprecated, use --without-libnbd)])], [], [enable_nbd_plugin=yes]) AM_CONDITIONAL([HAVE_LIBNBD], [test "x$LIBNBD_LIBS" != "x" && test "x$enable_nbd_plugin" = "xyes"]) dnl Check for liblzma (only if you want to compile the xz and lzip filters). AC_ARG_WITH([liblzma], [AS_HELP_STRING([--without-liblzma], [disable xz and lzip filters @<:@default=check@:>@])], [], [with_liblzma=check]) AS_IF([test "$with_liblzma" != "no"],[ PKG_CHECK_MODULES([LIBLZMA], [liblzma],[ AC_SUBST([LIBLZMA_CFLAGS]) AC_SUBST([LIBLZMA_LIBS]) AC_DEFINE([HAVE_LIBLZMA],[1],[liblzma found at compile time.]) ], [AC_MSG_WARN([liblzma not found, xz and lzip filters will be disabled])]) ]) AM_CONDITIONAL([HAVE_LIBLZMA],[test "x$LIBLZMA_LIBS" != "x"]) AS_IF([test "x$LIBLZMA_LIBS" != "x"],[ old_LIBS="$LIBS" LIBS="$LIBLZMA_LIBS $LIBS" AC_CHECK_FUNCS([lzma_lzip_decoder]) LIBS="$old_LIBS" AS_IF([test "x$ac_cv_func_lzma_lzip_decoder" != "xyes"], [ AC_MSG_WARN([liblzma without lzip support, lzip filter will be disabled]) ]) ]) AM_CONDITIONAL([HAVE_LZMA_LZIP_DECODER], [test "x$LIBLZMA_LIBS" != "x" && \ test "x$ac_cv_func_lzma_lzip_decoder" = "xyes"]) AC_CHECK_PROG([LZIP],[lzip],[lzip],[no]) AM_CONDITIONAL([HAVE_LZIP], [test "x$LZIP" != "xno"]) dnl Check for zstd (only if you want to compile allocator=zstd). AC_ARG_WITH([libzstd], [AS_HELP_STRING([--without-libzstd], [disable allocator=zstd @<:@default=check@:>@])], [], [with_libzstd=check]) AS_IF([test "$with_libzstd" != "no"],[ PKG_CHECK_MODULES([LIBZSTD], [libzstd],[ AC_SUBST([LIBZSTD_CFLAGS]) AC_SUBST([LIBZSTD_LIBS]) AC_DEFINE([HAVE_LIBZSTD],[1],[libzstd found at compile time.]) ], [AC_MSG_WARN([libzstd not found, allocator=zstd will be disabled])]) ]) AM_CONDITIONAL([HAVE_LIBZSTD],[test "x$LIBZSTD_LIBS" != "x"]) dnl Check for libguestfs (only for the guestfs plugin and parts of dnl the test suite). AC_ARG_WITH([libguestfs], [AS_HELP_STRING([--without-libguestfs], [disable guestfs plugin and tests @<:@default=check@:>@])], [], [with_libguestfs=check]) AS_IF([test "$with_libguestfs" != "no"],[ PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs],[ # Although the library was found, we want to make sure it supports nbd AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ #ifndef GUESTFS_ADD_DRIVE_OPTS_PROTOCOL #error unsupported #endif ]])], [ AC_SUBST([LIBGUESTFS_CFLAGS]) AC_SUBST([LIBGUESTFS_LIBS]) AC_DEFINE([HAVE_LIBGUESTFS],[1],[libguestfs found at compile time.]) ],[ LIBGUESTFS_LIBS= AC_MSG_WARN([libguestfs too old, guestfs plugin and tests will be disabled])]) ], [AC_MSG_WARN([libguestfs not found, guestfs plugin and tests will be disabled])]) ]) AM_CONDITIONAL([HAVE_LIBGUESTFS],[test "x$LIBGUESTFS_LIBS" != "x"]) dnl Disable tests which need libguestfs. AC_ARG_ENABLE([libguestfs-tests], [AS_HELP_STRING([--disable-libguestfs-tests], [disable tests which need libguestfs])], [], [enable_libguestfs_tests=check] ) AM_CONDITIONAL([USE_LIBGUESTFS_FOR_TESTS], [test "x$LIBGUESTFS_LIBS" != "x" && \ test "x$enable_libguestfs_tests" != "xno"]) dnl Check for mke2fs -d (used by linuxdisk plugin). There are three dnl possible outcomes that we care about: (1) We have mke2fs and it dnl supports the -d option. (2) We either don't have mke2fs or it's dnl too old to support the -d option (eg. on RHEL 7). (3) The user dnl disables the linuxdisk plugin. AC_ARG_ENABLE([linuxdisk], [AS_HELP_STRING([--disable-linuxdisk], [disable linuxdisk plugin @<:@default=check@:>@])], [], [enable_linuxdisk=check]) mke2fs_with_d=no AS_IF([test "$enable_linuxdisk" != "no"], [ AC_MSG_CHECKING([for mke2fs supporting the -d option]) AS_IF([mke2fs -V >/dev/null 2>&1], [ AS_IF([LANG=C mke2fs -d 2>&1 | grep -sq "option requires an argument"], [ mke2fs_with_d=yes ]) ]) AC_MSG_RESULT([$mke2fs_with_d]) ]) AM_CONDITIONAL([HAVE_MKE2FS_WITH_D],[test "x$mke2fs_with_d" = "xyes"]) dnl Check for ext2fs and com_err, for the ext2 filter. AC_ARG_WITH([ext2], [AS_HELP_STRING([--without-ext2], [disable ext2 filter @<:@default=check@:>@])], [], [with_ext2=check]) AS_IF([test "$with_ext2" != "no"], [ PKG_CHECK_MODULES([EXT2FS], [ext2fs], [ AC_SUBST([EXT2FS_CFLAGS]) AC_SUBST([EXT2FS_LIBS]) AC_DEFINE([HAVE_EXT2FS],[1],[ext2fs found at compile time.]) ], [AC_MSG_WARN([ext2fs not found, ext2 filter will be disabled])]) PKG_CHECK_MODULES([COM_ERR], [com_err], [ AC_SUBST([COM_ERR_CFLAGS]) AC_SUBST([COM_ERR_LIBS]) AC_DEFINE([HAVE_COM_ERR],[1],[com_err found at compile time.]) ], [AC_MSG_WARN([com_err not found, ext2 filter will be disabled])]) AC_CHECK_MEMBERS([struct struct_io_manager.cache_readahead, struct struct_io_manager.zeroout]) ]) AM_CONDITIONAL([HAVE_EXT2], [test "x$EXT2FS_LIBS" != "x" && test "x$COM_ERR_LIBS" != "x"]) dnl libtorrent-rasterbar for the bittorrent plugin. AC_ARG_ENABLE([torrent], [AS_HELP_STRING([--disable-torrent], [disable bittorrent plugin])], [], [enable_torrent=check] ) AS_IF([test "x$enable_torrent" != "xno"], [ PKG_CHECK_MODULES([LIBTORRENT], [libtorrent-rasterbar], [ AC_SUBST([LIBTORRENT_CFLAGS]) AC_SUBST([LIBTORRENT_LIBS]) ], [AC_MSG_WARN([libtorrent-rasterbar not found, bittorrent plugin will be disabled])]) ]) AM_CONDITIONAL([HAVE_TORRENT], [test "x$have_cxx" = "xyes" && test "x$LIBTORRENT_LIBS" != "x"]) dnl Check if the user wants to disable VDDK support. dnl See plugins/vddk/README.VDDK. AC_ARG_ENABLE([vddk], [AS_HELP_STRING([--disable-vddk], [disable VMware VDDK plugin])], [], [ dnl While VDDK was available on i686 in 5.1.1, we only support dnl newer versions which are supported only on x86-64. Don't dnl compile on other platforms. AC_MSG_CHECKING([if the host CPU is compatible with VDDK]) AS_IF([test "$host_cpu" = "x86_64" && test "$host_os" = "linux-gnu"],[ AC_MSG_RESULT([yes ($host)]) enable_vddk=yes ],[ AC_MSG_RESULT([no ($host)]) enable_vddk=no ]) ]) AM_CONDITIONAL([HAVE_VDDK], [test "x$enable_vddk" = "xyes"]) dnl Expose version information to the public headers [NBDKIT_]VERSION_MAJOR=NBDKIT_VERSION_MAJOR [NBDKIT_]VERSION_MINOR=NBDKIT_VERSION_MINOR [NBDKIT_]VERSION_MICRO=NBDKIT_VERSION_MICRO AC_SUBST([NBDKIT_VERSION_MAJOR]) AC_SUBST([NBDKIT_VERSION_MINOR]) AC_SUBST([NBDKIT_VERSION_MICRO]) dnl Produce output files. AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([podwrapper.pl], [chmod +x,-w podwrapper.pl]) AC_CONFIG_FILES([common/protocol/generate-protostrings.sh], [chmod +x,-w common/protocol/generate-protostrings.sh]) AC_CONFIG_FILES([tests/make-pki.sh], [chmod +x,-w tests/make-pki.sh]) AC_CONFIG_FILES([Makefile bash-completion/Makefile common/allocators/Makefile common/bitmap/Makefile common/gpt/Makefile common/include/Makefile common/protocol/Makefile common/regions/Makefile common/replacements/Makefile common/replacements/win32/Makefile common/utils/Makefile contrib/Makefile docs/Makefile include/Makefile include/nbdkit-version.h plugins/Makefile plugins/blkio/Makefile plugins/cc/Makefile plugins/cdi/Makefile plugins/curl/Makefile plugins/data/Makefile plugins/eval/Makefile plugins/example1/Makefile plugins/example2/Makefile plugins/example3/Makefile plugins/example4/Makefile plugins/file/Makefile plugins/floppy/Makefile plugins/full/Makefile plugins/gcs/Makefile plugins/golang/Makefile plugins/guestfs/Makefile plugins/info/Makefile plugins/iso/Makefile plugins/libvirt/Makefile plugins/linuxdisk/Makefile plugins/lua/Makefile plugins/memory/Makefile plugins/nbd/Makefile plugins/null/Makefile plugins/ocaml/Makefile plugins/ondemand/Makefile plugins/ones/Makefile plugins/partitioning/Makefile plugins/pattern/Makefile plugins/perl/Makefile plugins/python/Makefile plugins/random/Makefile plugins/rust/Makefile plugins/S3/Makefile plugins/sh/Makefile plugins/ssh/Makefile plugins/sparse-random/Makefile plugins/split/Makefile plugins/tcl/Makefile plugins/tmpdisk/Makefile plugins/torrent/Makefile plugins/vddk/Makefile plugins/zero/Makefile filters/Makefile filters/blocksize/Makefile filters/blocksize-policy/Makefile filters/bzip2/Makefile filters/cache/Makefile filters/cacheextents/Makefile filters/checkwrite/Makefile filters/cow/Makefile filters/ddrescue/Makefile filters/delay/Makefile filters/error/Makefile filters/evil/Makefile filters/exitlast/Makefile filters/exitwhen/Makefile filters/exportname/Makefile filters/ext2/Makefile filters/extentlist/Makefile filters/fua/Makefile filters/gzip/Makefile filters/ip/Makefile filters/limit/Makefile filters/log/Makefile filters/luks/Makefile filters/lzip/Makefile filters/multi-conn/Makefile filters/nocache/Makefile filters/noextents/Makefile filters/nofilter/Makefile filters/noparallel/Makefile filters/nozero/Makefile filters/offset/Makefile filters/partition/Makefile filters/pause/Makefile filters/protect/Makefile filters/qcow2dec/Makefile filters/rate/Makefile filters/readahead/Makefile filters/readonly/Makefile filters/retry/Makefile filters/retry-request/Makefile filters/rotational/Makefile filters/scan/Makefile filters/spinning/Makefile filters/stats/Makefile filters/swab/Makefile filters/tar/Makefile filters/time-limit/Makefile filters/tls-fallback/Makefile filters/truncate/Makefile filters/xz/Makefile fuzzing/Makefile server/local/nbdkit.pc server/Makefile server/nbdkit.pc tests/functions.sh tests/Makefile valgrind/Makefile]) AC_OUTPUT dnl Summary. echo echo echo "----------------------------------------------------------------------" echo "Thank you for downloading $PACKAGE_STRING" echo echo "This is how we have configured the optional components for you today:" echo print () { printf ' %.40s %s\n' \ "$1 ........................................" "$2" } feature () { feat="$1" shift if "$@"; then print "$feat" "yes" else print "$feat" "no" fi } echo "Optional server features:" echo feature "bash-completion" test "x$HAVE_BASH_COMPLETION_TRUE" = "x" feature "libfuzzer (developers only)" \ test "x$ENABLE_LIBFUZZER_TRUE" = "x" feature "linker script" test "x$USE_LINKER_SCRIPT" = "x" feature "manual pages" test "x$HAVE_POD_TRUE" = "x" feature "SELinux" test "x$LIBSELINUX_LIBS" != "x" feature "TLS" test "x$GNUTLS_LIBS" != "x" echo echo "Optional plugins:" echo feature "blkio" test "x$HAVE_LIBBLKIO_TRUE" = "x" feature "curl" test "x$HAVE_CURL_TRUE" = "x" feature "example4" test "x$HAVE_PERL_TRUE" = "x" feature "floppy" test "x$HAVE_ICONV_TRUE" = "x" feature "gcs" test "x$HAVE_PYTHON_TRUE" = "x" feature "guestfs" test "x$HAVE_LIBGUESTFS_TRUE" = "x" feature "iso" test "x$HAVE_ISO_TRUE" = "x" feature "libvirt" test "x$HAVE_LIBVIRT_TRUE" = "x" feature "linuxdisk" test "x$HAVE_MKE2FS_WITH_D_TRUE" = "x" feature "nbd" test "x$HAVE_LIBNBD_TRUE" = "x" feature "S3" test "x$HAVE_PYTHON_TRUE" = "x" feature "ssh" test "x$HAVE_SSH_TRUE" = "x" feature "torrent" test "x$HAVE_TORRENT_TRUE" = "x" feature "vddk" test "x$HAVE_VDDK_TRUE" = "x" echo echo "Languages:" echo feature "go" test "x$HAVE_GOLANG_TRUE" = "x" feature "lua" test "x$HAVE_LUA_TRUE" = "x" feature "ocaml" test "x$HAVE_OCAML_TRUE" = "x" feature "perl" test "x$HAVE_PERL_TRUE" = "x" feature "python" test "x$HAVE_PYTHON_TRUE" = "x" feature "rust" test "x$HAVE_RUST_TRUE" = "x" feature "tcl" test "x$HAVE_TCL_TRUE" = "x" echo echo "Optional filters:" echo feature "bzip2" test "x$HAVE_BZLIB_TRUE" = "x" feature "ext2" test "x$HAVE_EXT2_TRUE" = "x" feature "gzip" test "x$HAVE_ZLIB_TRUE" = "x" feature "luks" test "x$HAVE_GNUTLS_PBKDF2_TRUE" = "x" feature "lzip" test "x$HAVE_LZMA_LZIP_DECODER_TRUE" = "x" feature "stats" test "x$HAVE_CXX_TRUE" = "x" feature "xz" test "x$HAVE_LIBLZMA_TRUE" = "x" echo echo "Other optional features:" echo feature "allocator=zstd" test "x$HAVE_LIBZSTD_TRUE" = "x" feature "compiler warnings" test "x$COMPILER_WARNINGS_TRUE" = "x" feature "tests using libguestfs" \ test "x$HAVE_LIBGUESTFS_TRUE" = "x" && \ test "x$USE_LIBGUESTFS_FOR_TESTS_TRUE" = "x" feature "zlib-ng" test "x$ZLIB_NG_LIBS" != "x" print cc-plugin-CC "$CC_PLUGIN_CC" print cc-plugin-CFLAGS "$CC_PLUGIN_CFLAGS" echo echo "If any optional component is configured ‘no’ when you expected ‘yes’" echo "then you should check the preceding messages and README." echo echo "Please report bugs back to the mailing list:" echo "https://lists.libguestfs.org" echo echo "Next you should type 'make' to build the package," echo "then 'make check' to run the tests." nbdkit-1.42.2/aclocal.m40000644000175000017500000015470614771245444010425 # generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, [m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. dnl dnl If pkg-config is not found or older than specified, it will result dnl in an empty PKG_CONFIG variable. To avoid widespread issues with dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting. dnl You can specify [PKG_CONFIG=false] as an action instead, which would dnl result in pkg-config tests failing, but no bogus error messages. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi if test -z "$PKG_CONFIG"; then m4_default([$2], [AC_MSG_ERROR([pkg-config not found])]) fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _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. # This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_pthread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/ocaml.m4]) nbdkit-1.42.2/Makefile.in0000644000175000017500000012161714771245445010626 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_LIBFUZZER_FALSE@noinst_PROGRAMS = nbdkit$(EXEEXT) @HAVE_PLUGINS_TRUE@am__append_1 = \ @HAVE_PLUGINS_TRUE@ common/allocators \ @HAVE_PLUGINS_TRUE@ common/bitmap \ @HAVE_PLUGINS_TRUE@ common/gpt \ @HAVE_PLUGINS_TRUE@ common/regions \ @HAVE_PLUGINS_TRUE@ plugins \ @HAVE_PLUGINS_TRUE@ filters \ @HAVE_PLUGINS_TRUE@ $(NULL) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = podwrapper.pl server/local/nbdkit.pc CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__nbdkit_SOURCES_DIST = wrapper.c server/options.h @ENABLE_LIBFUZZER_FALSE@am_nbdkit_OBJECTS = nbdkit-wrapper.$(OBJEXT) nbdkit_OBJECTS = $(am_nbdkit_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_LIBFUZZER_FALSE@nbdkit_DEPENDENCIES = $(top_builddir)/common/utils/libutils.la \ @ENABLE_LIBFUZZER_FALSE@ $(top_builddir)/common/replacements/libcompat.la \ @ENABLE_LIBFUZZER_FALSE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(nbdkit_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit-wrapper.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nbdkit_SOURCES) DIST_SOURCES = $(am__nbdkit_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = bash-completion docs fuzzing valgrind include \ common/include common/protocol common/replacements \ common/utils server contrib common/allocators common/bitmap \ common/gpt common/regions plugins filters . tests am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/podwrapper.pl.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/server/local/nbdkit.pc.in README.md TODO compile \ config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll html/*.html scripts/*~ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ BENCHMARKING \ .dir-locals.el \ .gitignore \ html/pod.css \ LICENSE \ m4/.gitignore \ OTHER_PLUGINS \ README.md \ scripts/git.orderfile \ SECURITY \ .vscode/settings.json \ .vscode/tasks.json \ $(NULL) @ENABLE_LIBFUZZER_FALSE@nbdkit_SOURCES = wrapper.c server/options.h @ENABLE_LIBFUZZER_FALSE@nbdkit_CPPFLAGS = \ @ENABLE_LIBFUZZER_FALSE@ -I$(top_srcdir)/server \ @ENABLE_LIBFUZZER_FALSE@ -I$(top_srcdir)/common/include \ @ENABLE_LIBFUZZER_FALSE@ -I$(top_srcdir)/common/utils \ @ENABLE_LIBFUZZER_FALSE@ -I$(top_srcdir)/common/replacements \ @ENABLE_LIBFUZZER_FALSE@ -Dbuilddir=\"$(abs_top_builddir)\" \ @ENABLE_LIBFUZZER_FALSE@ -Dsrcdir=\"$(abs_top_srcdir)\" \ @ENABLE_LIBFUZZER_FALSE@ -DVALGRIND=\"$(VALGRIND)\" \ @ENABLE_LIBFUZZER_FALSE@ $(NULL) @ENABLE_LIBFUZZER_FALSE@nbdkit_CFLAGS = $(WARNINGS_CFLAGS) @ENABLE_LIBFUZZER_FALSE@nbdkit_LDADD = \ @ENABLE_LIBFUZZER_FALSE@ $(top_builddir)/common/utils/libutils.la \ @ENABLE_LIBFUZZER_FALSE@ $(top_builddir)/common/replacements/libcompat.la \ @ENABLE_LIBFUZZER_FALSE@ $(NULL) @ENABLE_LIBFUZZER_FALSE@EXTRA_nbdkit_DEPENDENCIES = config.status SUBDIRS = bash-completion docs fuzzing valgrind include common/include \ common/protocol common/replacements common/utils server \ contrib $(am__append_1) . tests all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 podwrapper.pl: $(top_builddir)/config.status $(srcdir)/podwrapper.pl.in cd $(top_builddir) && $(SHELL) ./config.status $@ server/local/nbdkit.pc: $(top_builddir)/config.status $(top_srcdir)/server/local/nbdkit.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list nbdkit$(EXEEXT): $(nbdkit_OBJECTS) $(nbdkit_DEPENDENCIES) $(EXTRA_nbdkit_DEPENDENCIES) @rm -f nbdkit$(EXEEXT) $(AM_V_CCLD)$(nbdkit_LINK) $(nbdkit_OBJECTS) $(nbdkit_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit-wrapper.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit-wrapper.o: wrapper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-wrapper.o -MD -MP -MF $(DEPDIR)/nbdkit-wrapper.Tpo -c -o nbdkit-wrapper.o `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-wrapper.Tpo $(DEPDIR)/nbdkit-wrapper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wrapper.c' object='nbdkit-wrapper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-wrapper.o `test -f 'wrapper.c' || echo '$(srcdir)/'`wrapper.c nbdkit-wrapper.obj: wrapper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -MT nbdkit-wrapper.obj -MD -MP -MF $(DEPDIR)/nbdkit-wrapper.Tpo -c -o nbdkit-wrapper.obj `if test -f 'wrapper.c'; then $(CYGPATH_W) 'wrapper.c'; else $(CYGPATH_W) '$(srcdir)/wrapper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit-wrapper.Tpo $(DEPDIR)/nbdkit-wrapper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wrapper.c' object='nbdkit-wrapper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_CPPFLAGS) $(CPPFLAGS) $(nbdkit_CFLAGS) $(CFLAGS) -c -o nbdkit-wrapper.obj `if test -f 'wrapper.c'; then $(CYGPATH_W) 'wrapper.c'; else $(CYGPATH_W) '$(srcdir)/wrapper.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/nbdkit-wrapper.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/nbdkit-wrapper.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles am--refresh check check-am clean clean-cscope \ clean-generic clean-libtool clean-noinstPROGRAMS cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile $(NULL) check-valgrind: $(MAKE) -C tests check-valgrind check-root: $(MAKE) -C tests check-root check-vddk: $(MAKE) -C tests check-vddk bench: all @for d in common/utils; do \ $(MAKE) -C $$d bench || exit 1; \ done #---------------------------------------------------------------------- # Maintainers only! # Check no files are missing from EXTRA_DIST rules, and that all # generated files have been included in the tarball. (Note you must # have done 'make dist') maintainer-check-extra-dist: @tar ztf $(PACKAGE_NAME)-$(VERSION).tar.gz | sort | \ sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tarfiles @git ls-files | \ grep -v \ -e '^\.cirrus.yml' \ -e '^\.gitlab-ci.yml' \ -e '^ci/' | \ sort > gitfiles @comm -13 tarfiles gitfiles > comm-out @echo Checking for differences between EXTRA_DIST and git ... @cat comm-out @[ ! -s comm-out ] @rm tarfiles gitfiles comm-out @echo PASS: EXTRA_DIST tests # Commit everything in the current directory and set the commit # message to the current version number. maintainer-commit: git commit -a -m "Version $(VERSION)." # Tag HEAD with the current version. maintainer-tag: git tag -a v$(VERSION) -m "Version $(VERSION)." -f # Run tests and display the time taken to run each test, which is # useful for diagnosing slow-running tests. # # Try also setting LIBGUESTFS_BACKEND_SETTINGS=force_tcg which # emulates what happens in Koji. maintainer-check-times: make check -j1 | ts -i # 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: nbdkit-1.42.2/config.h.in0000644000175000017500000004011614771245445010576 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* String that separates path elements. */ #undef DIR_SEPARATOR_STR /* Enable special libFuzzer binary */ #undef ENABLE_LIBFUZZER /* Extension used for executables. */ #undef EXEEXT /* Define to 1 if you have the 'accept4' function. */ #undef HAVE_ACCEPT4 /* Define to 1 if you have the header file. */ #undef HAVE_AFUNIX_H /* Define to 1 if you have the header file. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* __auto_type is available */ #undef HAVE_AUTO_TYPE /* Define to 1 if you have the header file. */ #undef HAVE_BYTESWAP_H /* libbz2 found at compile time. */ #undef HAVE_BZLIB /* caml_alloc_initialized_string found at compile time. */ #undef HAVE_CAML_ALLOC_INITIALIZED_STRING /* caml_shutdown found at compile time. */ #undef HAVE_CAML_SHUTDOWN /* caml/socketaddr.h found at compile time. */ #undef HAVE_CAML_SOCKETADDR_H /* caml_unix_alloc_sockaddr found at compile time. */ #undef HAVE_CAML_UNIX_ALLOC_SOCKADDR /* com_err found at compile time. */ #undef HAVE_COM_ERR /* curl found at compile time. */ #undef HAVE_CURL /* CURLOPT_PROTOCOLS_STR found at compile time. */ #undef HAVE_CURLOPT_PROTOCOLS_STR /* CURLOPT_UNIX_SOCKET_PATH found at compile time. */ #undef HAVE_CURLOPT_UNIX_SOCKET_PATH /* CURL_HTTP_VERSION_2TLS found at compile time. */ #undef HAVE_CURL_HTTP_VERSION_2TLS /* CURL_HTTP_VERSION_2_0 found at compile time. */ #undef HAVE_CURL_HTTP_VERSION_2_0 /* CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE found at compile time. */ #undef HAVE_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE /* CURL_HTTP_VERSION_3 found at compile time. */ #undef HAVE_CURL_HTTP_VERSION_3 /* CURL_HTTP_VERSION_3ONLY found at compile time. */ #undef HAVE_CURL_HTTP_VERSION_3ONLY /* Define to 1 if you have the 'curl_multi_get_handles' function. */ #undef HAVE_CURL_MULTI_GET_HANDLES /* Define to 1 if you have the 'curl_version_info' function. */ #undef HAVE_CURL_VERSION_INFO /* Define to 1 if you have the declaration of 'program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the declaration of '__builtin_add_overflow(int, int, int *)', and to 0 if you don't. */ #undef HAVE_DECL___BUILTIN_ADD_OVERFLOW /* Define to 1 if you have the declaration of '__builtin_mul_overflow(int, int, int *)', and to 0 if you don't. */ #undef HAVE_DECL___BUILTIN_MUL_OVERFLOW /* Define to 1 if you have the 'dladdr' function. */ #undef HAVE_DLADDR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H /* environ is declared in headers */ #undef HAVE_ENVIRON_DECL /* ext2fs found at compile time. */ #undef HAVE_EXT2FS /* Define to 1 if you have the 'fdatasync' function. */ #undef HAVE_FDATASYNC /* Define to 1 if you have the 'flockfile' function. */ #undef HAVE_FLOCKFILE /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the 'fsync' function. */ #undef HAVE_FSYNC /* Define to 1 if you have the 'funlockfile' function. */ #undef HAVE_FUNLOCKFILE /* Define to 1 if you have the 'getdelim' function. */ #undef HAVE_GETDELIM /* Define to 1 if you have the 'getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the 'get_current_dir_name' function. */ #undef HAVE_GET_CURRENT_DIR_NAME /* gnutls found at compile time. */ #undef HAVE_GNUTLS /* Define to 1 if you have the 'gnutls_base64_decode2' function. */ #undef HAVE_GNUTLS_BASE64_DECODE2 /* Define to 1 if you have the 'gnutls_certificate_set_known_dh_params' function. */ #undef HAVE_GNUTLS_CERTIFICATE_SET_KNOWN_DH_PARAMS /* Define to 1 if you have the 'gnutls_group_get' function. */ #undef HAVE_GNUTLS_GROUP_GET /* Define to 1 if you have the 'gnutls_group_get_name' function. */ #undef HAVE_GNUTLS_GROUP_GET_NAME /* Define to 1 if you have the 'gnutls_pbkdf2' function. */ #undef HAVE_GNUTLS_PBKDF2 /* Define to 1 if you have the header file. */ #undef HAVE_GNUTLS_SOCKET_H /* Define to 1 if you have the 'gnutls_srp_server_get_username' function. */ #undef HAVE_GNUTLS_SRP_SERVER_GET_USERNAME /* Define to 1 if you have the 'gnutls_transport_is_ktls_enabled' function. */ #undef HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the 'inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the 'inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* libblkio found at compile time. */ #undef HAVE_LIBBLKIO /* libguestfs found at compile time. */ #undef HAVE_LIBGUESTFS /* liblzma found at compile time. */ #undef HAVE_LIBLZMA /* libnbd found at compile time. */ #undef HAVE_LIBNBD /* libselinux found at compile time. */ #undef HAVE_LIBSELINUX /* libvirt found at compile time. */ #undef HAVE_LIBVIRT /* libzstd found at compile time. */ #undef HAVE_LIBZSTD /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VM_SOCKETS_H /* Define to 1 if you have the 'lua_isinteger' function. */ #undef HAVE_LUA_ISINTEGER /* Define to 1 if you have the 'lzma_lzip_decoder' function. */ #undef HAVE_LZMA_LZIP_DECODER /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* Define to 1 if you have the 'mkostemp' function. */ #undef HAVE_MKOSTEMP /* Define to 1 if you have the 'mlock' function. */ #undef HAVE_MLOCK /* Define to 1 if you have the 'mlockall' function. */ #undef HAVE_MLOCKALL /* Define to 1 if you have the 'munlock' function. */ #undef HAVE_MUNLOCK /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_H /* Define to 1 if you have the 'openlog' function. */ #undef HAVE_OPENLOG /* Define to 1 if you have the 'open_memstream' function. */ #undef HAVE_OPEN_MEMSTREAM /* Define to 1 if you have the 'perl_alloc' function. */ #undef HAVE_PERL_ALLOC /* Define to 1 if you have the 'pipe' function. */ #undef HAVE_PIPE /* Define to 1 if you have the 'pipe2' function. */ #undef HAVE_PIPE2 /* Define to 1 if you have the 'poll' function. */ #undef HAVE_POLL /* Define to 1 if you have the 'posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE /* Define to 1 if you have the 'posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define to 1 if you have the 'ppoll' function. */ #undef HAVE_PPOLL /* Define to 1 if you have the 'pread' function. */ #undef HAVE_PREAD /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the 'pwrite' function. */ #undef HAVE_PWRITE /* Python library found at compile time */ #undef HAVE_PYTHON /* Define to 1 if you have the 'realpath' function. */ #undef HAVE_REALPATH /* Define to 1 if you have the header file. */ #undef HAVE_STDATOMIC_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the 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 'strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if 'd_type' is a member of 'struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_TYPE /* Define to 1 if 'uid' is a member of 'struct sockpeercred'. */ #undef HAVE_STRUCT_SOCKPEERCRED_UID /* Define to 1 if 'cache_readahead' is a member of 'struct struct_io_manager'. */ #undef HAVE_STRUCT_STRUCT_IO_MANAGER_CACHE_READAHEAD /* Define to 1 if 'zeroout' is a member of 'struct struct_io_manager'. */ #undef HAVE_STRUCT_STRUCT_IO_MANAGER_ZEROOUT /* Define to 1 if 'uid' is a member of 'struct ucred'. */ #undef HAVE_STRUCT_UCRED_UID /* Define to 1 if you have the 'sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the 'syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DISKLABEL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DISK_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ENDIAN_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_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PRCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCCTL_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_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UCRED_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VSOCK_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the 'timer_create' function. */ #undef HAVE_TIMER_CREATE /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Valgrind headers found at compile time */ #undef HAVE_VALGRIND /* Define to 1 if you have the 'valloc' function. */ #undef HAVE_VALLOC /* Define to 1 if vfprintf supports %m. */ #undef HAVE_VFPRINTF_PERCENT_M /* Define to 1 if you have the 'vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* zlib found at compile time. */ #undef HAVE_ZLIB /* zlib-ng found at compile time. */ #undef HAVE_ZLIB_NG /* Program used by iso plugin to make ISOs. */ #undef ISOPROG /* ISO program behaves like xorriso. */ #undef ISOPROG_IS_XORRISO /* Temporary directory for large files */ #undef LARGE_TMPDIR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Extra version information (for use by packagers) */ #undef NBDKIT_VERSION_EXTRA /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if the C compiler supports function prototypes. */ #undef PROTOTYPES /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* The size of 'gid_t', as computed by sizeof. */ #undef SIZEOF_GID_T /* The size of 'long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of 'pid_t', as computed by sizeof. */ #undef SIZEOF_PID_T /* The size of 'uid_t', as computed by sizeof. */ #undef SIZEOF_UID_T /* Extension used for shared objects/DLLs. */ #undef SOEXT /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Default TLS session priority string */ #undef TLS_PRIORITY /* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by C23 Annex F. */ #ifndef __STDC_WANT_IEC_60559_EXT__ # undef __STDC_WANT_IEC_60559_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define to 1 on platforms where this makes off_t a 64-bit type. */ #undef _LARGE_FILES /* Number of bits in time_t, on hosts where this is settable. */ #undef _TIME_BITS /* Define to 1 on platforms where this makes time_t a 64-bit type. */ #undef __MINGW_USE_VC2005_COMPAT /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES /* Host architecture. */ #undef host_cpu /* Host operating system. */ #undef host_os nbdkit-1.42.2/podwrapper.pl.in0000755000175000017500000004631214771245250011701 #!/usr/bin/env perl # podwrapper.pl # @configure_input@ # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. use warnings; use strict; #use Carp; #$SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; use Pod::Usage; use Getopt::Long; use Pod::Man; use Pod::Simple; use Pod::Simple::Text; use Pod::Simple::XHTML; use File::Basename; # https://www.redhat.com/archives/libguestfs/2013-May/thread.html#00088 eval { $Text::Wrap::huge = "overflow" }; # All man page names must match this function. sub validate_name_field { local $_ = shift; $_ =~ m/^nbdkit/; } # The license for man pages in this package - see LICENSE below. my $package_license = "bsd"; =head1 NAME podwrapper.pl - generate documentation from POD input files =head1 SYNOPSIS EXTRA_DIST = foo.pod if HAVE_POD man_MANS = foo.1 CLEANFILES += $(man_MANS) foo.1: foo.pod $(PODWRAPPER) --section 1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD =head1 DESCRIPTION podwrapper.pl is a Perl script that generates various output formats from POD input files that this project uses for most documentation. You must specify one input file, and one or more output formats. The output options are I<--man>, I<--html> and I<--text> (see below). In C files, use a variation of the boilerplate shown in the L section above. For information about the POD format, see L. =head1 OPTIONS =over 4 =cut my $help; =item B<--help> Display brief help. =cut my $allow_long_lines; =item B<--allow-long-lines> Allow lines longer than 76 characters in the input. Use this if the man page is not written by hand. =cut my $html; =item B<--html> output.html Write a web page to F. If this option is not given, then no web page output is produced. =cut my @inserts; =item B<--insert> filename:__PATTERN__ In the input file, replace the literal text C<__PATTERN__> with the replacement file F. You can give this option multiple times. The contents of F are treated as POD. Compare and contrast with I<--verbatim>. Although it is conventional to use C<__...__> (double underscores) for patterns, in fact you can use any string as the pattern. =cut my $man; =item B<--man> output.n Write a man page to F (C is the manual section number). If this option is not given, then no man page output is produced. =cut my $name; =item B<--name> NAME Set the name of the man page. If not set, defaults to the basename of the input file. =cut my @replaces; =item B<--replace> __PATTERN__:CONTENT In the input file, replace the literal text C<__PATTERN__> with the literal replacement string . You can give this option multiple times. Although it is conventional to use C<__...__> (double underscores) for patterns, in fact you can use any string as the pattern. =cut my $section; =item B<--section> N Set the section of the man page (a number such as C<1> for command line utilities or C<3> for C API documentation). If not set, defaults to C<1>. =cut my $text; =item B<--text> output.txt Write a text file to F. If this option is not given, then no text output is produced. =cut my @verbatims; =item B<--verbatim> filename:__PATTERN__ In the input file, replace the literal text C<__PATTERN__> with the replacement file F. You can give this option multiple times. The contents of F are inserted as verbatim text, and are I interpreted as POD. Compare and contrast with I<--insert>. Although it is conventional to use C<__...__> (double underscores) for patterns, in fact you can use any string as the pattern. =cut # Clean up the program name. my $progname = $0; $progname =~ s{.*/}{}; # Parse options. GetOptions ("help|?" => \$help, "allow-long-lines" => \$allow_long_lines, "html=s" => \$html, "insert=s" => \@inserts, "man=s" => \$man, "name=s" => \$name, "replace=s" => \@replaces, "section=s" => \$section, "text=s" => \$text, "verbatim=s" => \@verbatims, ) or pod2usage (2); pod2usage (1) if $help; die "$progname: missing argument: podwrapper input.pod\n" unless @ARGV == 1; my $input = $ARGV[0]; # There should be at least one output. die "$progname: $input: no output format specified. Use --man and/or --html and/or --text.\n" unless defined $man || defined $html || defined $text; # Default for $name and $section. $name = basename ($input, ".pod") unless defined $name; $section = 1 unless defined $section; # Note that these @...@ are substituted by ./configure. my $abs_top_srcdir = "@abs_top_srcdir@"; my $abs_top_builddir = "@abs_top_builddir@"; my $package_name = "@PACKAGE_NAME@"; my $package_version = "@PACKAGE_VERSION@"; die "$progname: ./configure substitutions were not performed" unless $abs_top_srcdir && $abs_top_builddir && $package_name && $package_version; # Create a stable date (thanks Hilko Bengen). my $date; my $filename = "$abs_top_srcdir/.git"; if (!$date && -d $filename) { local $ENV{GIT_DIR} = $filename; $date = `git show -O/dev/null -s --format=format:%cs`; } if (!$date) { my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} || time))[3,4,5]; $date = sprintf ("%04d-%02d-%02d", $year+1900, $month+1, $day); } # Create a release string. my $release = "$package_name-$package_version"; #print "input=$input\n"; #print "name=$name\n"; #print "section=$section\n"; #print "date=$date\n"; # Read the input. my $content = read_whole_file ($input); # Perform @inserts. foreach (@inserts) { my @a = split /:/, $_, 2; die "$progname: $input: no colon in parameter of --insert\n" unless @a >= 2; my $replacement = read_whole_file ($a[0]); my $oldcontent = $content; $content =~ s/$a[1]/$replacement/ge; die "$progname: $input: could not find pattern '$a[1]' in input file\n" if $content eq $oldcontent; } # Turn external links to this man page into simple cross-section links. $content =~ s,\QL<$name($section)/\E,L= 2; my $oldcontent = $content; $content =~ s/$a[0]/$a[1]/g; die "$progname: $input: could not find pattern '$a[0]' in input file\n" if $content eq $oldcontent; } # Perform @verbatims. foreach (@verbatims) { my @a = split /:/, $_, 2; die "$progname: $input: no colon in parameter of --verbatim\n" unless @a >= 2; my $replacement = read_verbatim_file ($a[0]); my $oldcontent = $content; $content =~ s/$a[1]/$replacement/ge; die "$progname: $input: could not find pattern '$a[1]' in input file\n" if $content eq $oldcontent; } # Check the content is valid UTF8. die "$progname: $input: is not valid utf8" unless utf8::is_utf8 ($content); # There should be no =encoding line present in the content. die "$progname: $input: =encoding must not be present in input\n" if $content =~ /^=encoding/m; # Don't permit trailing whitespace. die "$progname: $input: trailing whitespace in input\n" if $content =~ /[ \t]$/m; # We may add an encoding line, but this breaks RHEL 6-era Pod::Simple # with the error "Cannot decode string with wide characters". $content =~ s/^=(.*)/\n=encoding utf8\n\n=$1/m if $] >= 5.011; # Perl >= 5.11 # Verify sections present / not present. die "$progname: $input: missing NAME section\n" if $content !~ /^=head1 NAME/m; die "$progname: $input: missing DESCRIPTION section\n" if $content !~ /^=head1 DESCRIPTION/m; die "$progname: $input: missing AUTHOR or AUTHORS section\n" unless $content =~ /^=head1 AUTHOR/m; die "$progname: $input: missing SEE ALSO section\n" unless $content =~ /^=head1 SEE ALSO/m; die "$progname: $input: missing COPYRIGHT section\n" unless $content =~ /^=head1 COPYRIGHT/m; die "$progname: $input: BUGS is now added automatically, do not add it to the POD file\n" if $content =~ /^=head1 (REPORTING )?BUGS/m; die "$progname: $input: LICENSE is now added automatically, do not add it to the POD file\n" if $content =~ /^=head1 LICENSE/m; # Check NAME section conformity. my @lines = split /\n/, $content; my @name; foreach (@lines) { push @name, $_ if /^=head1 NAME/../^=head1 (?!NAME)/ } shift @name; # remove =head1 and empty line shift @name; # from beginning and end pop @name; pop @name; die "$progname: $input: empty NAME section\n" unless @name >= 1; die "$progname: $input: NAME doesn't start with $package_name\n" unless validate_name_field ($name[0]); die "$progname: $input: NAME doesn't match man page name\n" unless $name[0] =~ /\b$name\b.* - / || $name[0] =~ /\b$name\b,/; die "$progname: $input: NAME does not conform with Linux man pages standard\n" if ($name[0] !~ m/- [a-z]/ && $name[0] !~ /,$/) || $name[@name-1] =~ m/\.$/; unless ($allow_long_lines) { # Check no over-long lines in the input. (As a special exception # this is permitted in verbatim sections or if the line contains a # URL). foreach (@lines) { die "$progname: $input: line too long:\n$_\n" if length $_ > 76 && substr ($_, 0, 1) ne ' ' && ! m/https?:/; } } # Check for bare URLs. They should probably be replaced by L<> links. # (Allow them in verbatim sections) # Older Perl did not support variable length lookbehind, hence the # eval here. my $re = eval ' qr/(? link\n" } } } # Check cross-references to other nbdkit man pages exist. my @xrefs = $content =~ /L<(nbdkit[-_].*?\([1-9]\))>/g; foreach (@xrefs) { # Plugins can be in section 1 or 3. Here we only check the plugin # name exists, but we should check the section (XXX). if (m/^nbdkit-(.*?)-plugin\(([13])\)$/) { my $name = $1; my $section = $2; die "$progname: $input: cannot find cross reference for $_\n" if ! -d "$abs_top_srcdir/plugins/$name" } # All filters should be in section 1, so we only need to check # they exist. elsif (m/^nbdkit-(.*?)-filter\(1\)$/) { my $name = $1; die "$progname: $input: cannot find cross reference for $_\n" if ! -d "$abs_top_srcdir/filters/$name" } # Other documentation in section 1. elsif (m/^nbdkit-(.*)\(1\)$/) { my $name = $1; die "$progname: $input: cannot find cross reference for $_\n" if ! -f "$abs_top_srcdir/docs/nbdkit-$name.pod" } # nbdkit-plugin(3) and nbdkit-filter(3). elsif (m/^nbdkit-plugin\(3\)$/ || m/^nbdkit-filter\(3\)$/) { # nothing } # Other C API man pages are in section 3. elsif (m/^nbdkit_(.*)\(3\)$/) { my $name = $1; die "$progname: $input: cannot find cross reference for $_\n" unless -f "$abs_top_srcdir/docs/nbdkit_$name.pod" || -f "$abs_top_srcdir/docs/nbdkit_$name.3"; } else { die "$progname: $input: cannot find cross-reference for $_\n" } } # Add standard LICENSE section at the end. my $license_lgplv2plus = "\ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA "; my $license_bsd = "\ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: =over 4 =item * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. =item * 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. =item * Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. =back THIS SOFTWARE IS PROVIDED BY RED HAT 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 RED HAT 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. "; $content .= "\n=head1 LICENSE\n"; $content .= eval "\$license_$package_license"; # Output man page. SUBMAN: { package Podwrapper::Man; use vars qw(@ISA $VERSION); @ISA = qw(Pod::Man); $VERSION = $package_version; # Override the L<> method. sub cmd_l { my ($self, $attrs, $text) = @_; return $text; } } if ($man) { my $parser = Podwrapper::Man->new ( name => $name, release => $release, section => $section, center => uc $package_name, date => $date, stderr => 1, utf8 => 1 ); my $output; $parser->no_errata_section (1); $parser->complain_stderr (1); $parser->output_string (\$output); $parser->parse_string_document ($content) or die "$progname: could not parse input document"; open OUT, ">$man" or die "$progname: $man: $!"; print OUT $output or die "$progname: $man: $!"; close OUT or die "$progname: $man: $!"; if ($parser->any_errata_seen) { unlink $man; die "$input: errors or warnings in this POD file, see messages above\n" } #print "$progname: wrote $man\n"; } # Output HTML. SUBHTML: { # Subclass Pod::Simple::XHTML. See the documentation. package Podwrapper::XHTML; use vars qw(@ISA $VERSION); @ISA = qw(Pod::Simple::XHTML); $VERSION = $package_version; # Note this also allows links to related projects because they all # appear together under the http://libguestfs.org website. sub is_a_local_page { local $_ = shift; return 1 if /^Sys::Guestfs/; return 0 if /^virt-install/; return 1 if /^virt-/; return 1 if /^libguestf/; return 1 if /^guestf/; return 1 if /^guestmount/; return 1 if /^guestunmount/; return 1 if /^hivex/; return 1 if /^supermin/; return 1 if /^libnbd/; return 0 if /^nbd-server\(/ || /^nbd-client\(/; return 1 if /^nbd/; return 0; } sub resolve_man_page_link { my $self = shift; my $name = $_[0]; # eg. "foobar(3)", can be undef my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef my $r = ""; if (defined $name) { return $self->SUPER::resolve_man_page_link (@_) unless is_a_local_page ($name); $name =~ s/\((.*)\)$/.$1/; $r .= "$name.html"; } $r .= "#" . $self->idify ($anchor, 1) if defined $anchor; $r; } } if ($html) { mkdir "$abs_top_builddir/html"; my $parser = Podwrapper::XHTML->new; my $output; $parser->no_errata_section (1); $parser->complain_stderr (1); $parser->force_title ($name[0]); # from @name above $parser->output_string (\$output); # Added in Pod::Simple 3.16, 2011-03-14. eval { $parser->html_charset ("UTF-8") }; $parser->html_css ("pod.css"); $parser->index (1); $parser->parse_string_document ($content); # Hack for Perl 5.16. $output =~ s{/>pod.css<}{/>\n<}; open OUT, ">$html" or die "$progname: $html: $!"; print OUT $output or die "$progname: $html: $!"; close OUT or die "$progname: $html: $!"; if ($parser->any_errata_seen) { unlink $html; die "$input: errors or warnings in this POD file, see messages above\n" } #print "$progname: wrote $html\n"; } # Output text. if ($text) { my $parser = Pod::Simple::Text->new; my $output; $parser->no_errata_section (1); $parser->complain_stderr (1); $parser->output_string (\$output); $parser->parse_string_document ($content); open OUT, ">$text" or die "$progname: $text: $!"; binmode OUT, ":utf8"; print OUT $output or die "$progname: $text: $!"; close OUT or die "$progname: $text: $!"; if ($parser->any_errata_seen) { unlink $text; die "$input: errors or warnings in this POD file, see messages above\n" } #print "$progname: wrote $text\n"; } sub read_whole_file { my $input = shift; local $/ = undef; open FILE, "<:encoding(UTF-8)", $input or die "$progname: $input: $!"; $_ = ; close FILE; $_; } sub read_verbatim_file { my $input = shift; my @r = (); open FILE, "<:encoding(UTF-8)", $input or die "$progname: $input: $!"; while () { chomp; if (length) { push @r, " $_" } else { push @r, "" } } close FILE; return join ("\n", @r) . "\n"; } =head1 SEE ALSO L, L. =head1 AUTHOR Richard W.M. Jones. =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/common-rules.mk0000644000175000017500000000313314534316443011514 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll nbdkit-1.42.2/README.md0000644000175000017500000002610614771245250010027 ## NBD server with stable plugin ABI and permissive license nbdkit is an NBD server. NBD — Network Block Device — is a protocol for accessing Block Devices (hard disks and disk-like things) over a Network. The key features of nbdkit are: * Multithreaded NBD server written in C with good performance. * Minimal dependencies for the basic server. * Liberal license (BSD) allows nbdkit to be linked to proprietary libraries or included in proprietary code. * Well-documented, simple plugin API with a stable ABI guarantee. Lets you export “unconventional†block devices easily. * You can write plugins in C/C++, Go, Lua, Perl, Python, OCaml, Rust, shell script or Tcl. * Filters can be stacked in front of plugins to transform the output. * Server can run standalone or can be invoked from other programs. For documentation, see the [docs directory](docs/). For plugins and filters, see the [plugins](plugins/) and [filters](filters/) directories. Example plugins can be found in `plugins/example*`. There are many NBD clients, but the nbdkit project has a companion client library called https://gitlab.com/nbdkit/libnbd Upstream repository: https://gitlab.com/nbdkit/nbdkit ## License This software is Copyright Red Hat and licensed under a BSD license. See [LICENSE](LICENSE) for details. Examples are usually licensed even more permissively ("as close to public domain as possible"), see the individual files for details. ## Building from source ### Requirements * Linux, macOS, Windows, FreeBSD, OpenBSD or Haiku * GCC or Clang * bash ≥ 4 * GNU make Recommended for TLS (authentication and encryption) support, but it is possible to build without it: * gnutls ≥ 3.5.18 For Windows support see [the Windows section below](README.md#windows). For macOS support see [the macOS section below](README.md#macos). ### Optional dependencies To build the man pages, you will optionally need to install: * Perl * `Pod::Man` and `Pod::Simple` (Perl libraries) For SELinux socket labelling support: * libselinux For the gzip filter, or for supporting compressed qcow2: * zlib or zlib-ng For the bzip2 filter: * bzip2 For the xz and lzip filters: * liblzma For the memory plugin with allocator=zstd, or for supporting compressed qcow2: * zstd For the curl (HTTP/FTP) plugin: * libcurl For the ssh plugin: * libssh ≥ 0.8.0 (this is a different library from libssh2 - that will not work) For the iso plugin: * xorriso or genisoimage or mkisofs For the floppy plugin: * iconv (on Linux this is built into glibc, on other systems it may be a separate library) For the libvirt plugin: * libvirt For the libguestfs plugin, and to run parts of the test suite: * libguestfs * guestfish (from libguestfs) For the ext2 filter: * ext2fs * com_err For the linuxdisk plugin: * mke2fs ≥ 1.42.10 (from e2fsprogs) For the nbd plugin, to get URI and TLS support, and also to run parts of the test suite: * libnbd ≥ 0.9.8 For the bittorrent plugin: * [libtorrent-rasterbar](https://www.libtorrent.org) For the blkio plugin: * [libblkio](https://libblkio.gitlab.io/libblkio) For the containerized data importer (CDI) plugin: * podman * jq For the Perl and example4 plugins: * perl interpreter * perl development libraries * perl module `ExtUtils::Embed` For the Python plugin: * python interpreter (version 3 only) * python development libraries * python unittest to run the test suite * boto3 is required to run the S3 plugin written in Python * google-cloud-storage is required to run the gcs plugin written in Python For the OCaml plugin: * OCaml ≥ 4.03 For the Tcl plugin: * Tcl development library and headers For the Lua plugin: * Lua development library and headers For the Rust plugin: * cargo (other dependencies will be downloaded at build time) For the golang plugin: * go ≥ 1.13 For bash tab completion: * bash-completion ≥ 1.99 To test for memory leaks (`make check-valgrind`): * valgrind program and development headers For non-essential enhancements to the test suite: * expect * fdisk, sfdisk (from util-linux) * flake8 * hexdump * ip, ss (from iproute package) * jq * libc_malloc_debug.so.0 (from glibc-utils) * losetup (from util-linux) * lzip * mke2fs (from e2fsprogs) * nbdcopy, nbdinfo, nbdsh (from libnbd) * qemu-img, qemu-io, qemu-nbd (usually shipped with qemu) * socat * stat (from coreutils) ### Building ``` autoreconf -i # only required when building from git clone ./configure make make check ``` On FreeBSD and OpenBSD which do not have GNU make by default you must use `gmake` instead of `make`. To run nbdkit from the source directory, use the top level ./nbdkit wrapper. It will run nbdkit and plugins from the locally compiled directory: ``` $ ./nbdkit example1 -f -v ./server/nbdkit ./plugins/example1/.libs/nbdkit-example1-plugin.so -f -v [etc] ``` Optionally run this command as root to install everything: ``` make install ``` ### Python Since nbdkit ≥ 1.16, only Python ≥ 3.6 is supported. By default nbdkit uses the Python version of the Python interpreter called “python†on the current $PATH. If you have parallel versions of Python installed then you can choose a different version by setting the PYTHON variable when configuring. For example: ``` ./configure PYTHON=/usr/bin/python3.8 ``` ### OCaml Most recent (less than, say, 8 years old) versions of the OCaml compiler should work. By default the configure script should detect the bytecode and native code compilers and enable either one or both. To enable OCaml warnings and turn them into hard errors (developers only): ``` ./configure OCAMLOPTFLAGS="-warn-error +A-3" ``` ### Running the tests To run the test suite: ``` make check ``` If there is a failure, look at the corresponding `tests/*.log` file for debug information. A few tests require root privileges, and are skipped by default. To run them you must do: ``` make check-root ``` If you have the proprietary VDDK library, you can test [nbdkit-vddk-plugin](plugins/vddk/) against the library like this: ``` make check-vddk vddkdir=vmware-vix-disklib-distrib ``` ### Running the benchmarks To run benchmarks: ``` make bench ``` ## Download tarballs Tarballs are available from: http://libguestfs.org/download/nbdkit ## Downstream packagers If you are packaging nbdkit, use: ``` ./configure --with-extra='...' ``` providing extra information about the distribution, and/or distro-specific versions. It helps us with troubleshooting bug reports. (Also, talk to us!) ## Developers Install the valgrind program and development headers. Use: ``` ./configure --enable-gcc-warnings --enable-valgrind ``` When testing use: ``` make check make check-valgrind ``` For development ideas, see the [TODO](TODO) file. The upstream git repository is: https://gitlab.com/nbdkit/nbdkit Please send patches to the libguestfs mailing list: https://lists.libguestfs.org For further information, see: https://libguestfs.org/ https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md ## Address sanitizer (ASAN) You can compile nbdkit with clang and ASAN with: ``` ./configure CC=clang CXX=clang++ \ CFLAGS="-O0 -g -fsanitize=address -fno-omit-frame-pointer" \ --disable-linker-script \ --disable-golang make clean make ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0" make check ``` ## Test coverage ``` ./configure CFLAGS="--coverage -g" LDFLAGS="--coverage -g" make clean make make check lcov -c -d . -o gcov.info genhtml -o coverage gcov.info ``` Open your browser and examine the `coverage/` directory. At the time of writing (2024-05) test coverage of the server is reasonable, but things are much worse for certain plugins and filters. ## macOS nbdkit works on macOS and is mostly feature complete. Some tests may fail or be skipped. We have tested macOS 12 (Monterey), 13 (Ventura) and 14 (Sonoma), using MacPorts. Other versions of macOS and Homebrew may work too. We installed the following MacPorts packages: * autoconf * autoconf-archive * automake * bash * coreutils * gcc * gmake * gsed * jq * libtool * m4 * ocaml * pkg-config * qemu * ranlib We configured nbdkit using: ``` ./configure --enable-gcc-warnings --disable-perl \ CFLAGS="-g -O2 -I/opt/local/include" \ LDFLAGS="-L/opt/local/lib" ``` ## Windows Experimentally, the server can be compiled on Windows or cross-compiled from Linux using mingw-w64. Only a small subset of features are available. To find out what is missing read the TODO "Windows port". Note that GCC or Clang is required even if you are compiling on Windows because of some C language extensions we use. MSVC will not work. ### Cross-compiling from Linux to Windows For the rest of this section we talk about cross-compiling for Windows using Linux and mingw-w64. At a minimum you will need: * mingw-w64 gcc * mingw-w64 dlfcn * mingw-w64 winpthreads * mingw-w64 gnutls (optional, but highly recommended) * wine (if you want to run it on Linux) You may want to patch Wine with support for `AF_UNIX` sockets. It is needed to get most of the test suite to work, but if you don't care about the -U option then it is not needed. https://bugs.winehq.org/show_bug.cgi?id=52568 Other mingw-w64 libraries may be installed which will add functionality (see full list of requirements above), but you may end up hitting areas we have not compiled or tested before. To cross compile under Fedora or RHEL, ensure you have the following prerequisites: ``` dnf install -y mingw64-{gcc,dlfcn,winpthreads,gnutls} dnf install -y autoconf automake libtool make ``` then do: ``` autoreconf -i # when building from git mingw64-configure --disable-ocaml --disable-perl make ``` You can test if the server is working by doing: ``` ./nbdkit.exe --dump-config ``` (This usually runs wine automatically. If not, you may need to prefix the command "wine nbdkit.exe ...") To see which plugins and filters were compiled: ``` find plugins filters -name '*.dll' ``` You can run them under Wine without installing using eg: ``` ./nbdkit.exe -f -v memory 1G ``` You can run the test suite in the usual way: ``` make check ``` ### Running the cross-compiled binary on Windows To test the binary on a real Windows system you will need to copy server/.libs/nbdkit.exe, any plugins and filters you need (`plugins/*/.libs/*.dll` and `filters/*/.libs/*.dll`), and many mingw DLLs (`libdl.dll`, `libgnutls.dll`, `libwinpthread.dll`, etc.). Notes: 1. libtool creates files called nbdkit.exe in the top level directory and in [server](server/). These are the stripped binaries. The "real" binaries are located in hidden `.libs/` subdirectories. 2. The top level `.libs/nbdkit.exe` is the wrapper used to run nbdkit from the build directory, not the server binary. You need `server/.libs/nbdkit.exe` instead. 3. To find the list of mingw DLLs I ran nbdkit.exe iteratively until Windows stopped complaining about missing libraries. You could also use a tool like Dependency Walker. If you copy everything into a single directory on the Windows server then you should be able to run nbdkit normally, eg: ``` nbdkit.exe -f -v nbdkit-memory-plugin.dll 1G ``` You will probably need to open port 10809 on the Windows Firewall. nbdkit-1.42.2/TODO0000644000175000017500000004207514730027756007247 To-do list for nbdkit ====================================================================== General ideas for improvements ------------------------------ * Listen on specific interfaces or protocols. * Performance - measure and improve it. Chart it over various buffer sizes and threads, as that should make it easier to identify systematic issues. * For parallel plugins, only create threads on demand from parallel client requests, rather than pre-creating all threads at connection time, up to the thread pool size limit. Of course, once created, a thread is reused as possible until the connection closes. * A new threading model, SERIALIZE_RETIREMENT, which lets the client queue up multiple requests and processes them in parallel in the plugin, but where the responses sent back to the client are in the same order as the client's request rather than the plugin's completion. This is stricter than fully parallel, but looser than SERIALIZE_REQUESTS (in particular, a client can get non-deterministic behavior if batched requests touch the same area of the export). * Async callbacks. The current parallel support requires one thread per pending message; a solution with fewer threads would split low-level code between request and response, where the callback has to inform nbdkit when the response is ready: https://www.redhat.com/archives/libguestfs/2018-January/msg00149.html * More NBD protocol features. The currently missing features are structured replies for sparse reads, and online resize. * Test that zero-length read/write/extents requests behave sanely (NBD protocol says they are unspecified). * If a client negotiates structured replies, and issues a read/extents call that exceeds EOF (qemu 3.1 is one such client, when nbdkit serves non-sector-aligned images), return the valid answer for the subset of the request in range and then NBD_REPLY_TYPE_ERROR_OFFSET for the tail, rather than erroring the entire request. * Audit the code base to get rid of strerror() usage (the function is not thread-safe); however, using strerror_r() can be tricky as it has a different signature in glibc than in POSIX. * Teach nbdkit_error() to have smart newline appending (for existing inconsistent clients), while fixing internal uses to omit the newline. Commit ef4f72ef has some ideas on smart newlines, but that should probably be factored into a utility function. * Add a mode of operation where nbdkit is handed a pre-opened fd to be used immediately in transmission phase (skipping handshake). There are already third-party clients of the kernel's /dev/nbdX which rely on their own protocol instead of NBD handshake, before calling ioctl(NBD_SET_SOCK); this mode would let the third-party client continue to keep their non-standard handshake while utilizing nbdkit to prototype new behaviors in serving the kernel. * "nbdkit.so": nbdkit as a loadable shared library. The aim of nbdkit is to make it reusable from other programs (see nbdkit-captive(1)). If it was a loadable shared library it would be even more reusable. API would allow you to create an nbdkit instance, configure it (same as the current command line), start it serving on a socket, etc. However perhaps the current ability to work well as a subprocess is good enough? Also allowing multiple instances of nbdkit to be loaded in the same process is probably impossible. * common/utils/vector.h could be extended and used in other places: - there are some more possible places in the server (anywhere using realloc is suspect) - add more iterators, map function, etc, as required. * password=- to mean read a password interactively from /dev/tty (not stdin). * Add separate man pages for a few missing NBDKIT_EXTERN_DECL functions, including those for extents, contexts, and exports. * Enhance --keepalive by allowing more socket options to be set, in particular SOL_TCP + TCP_KEEPCNT, SOL_TCP + TCP_KEEPIDLE, and SOL_TCP + TCP_KEEPINTVL. * Fix --port=0 / allow nbdkit to choose a TCP port: Several tests rely on picking a random TCP port, which is racy. The kernel can pick a port for us, and nbdkit --print-uri function can be used to display the random port to the user. Because of a bug, nbdkit lets you choose --port=0, causing the kernel to pick a port, but --print-uri doesn't display the port, and a different port is picked for IPv4 and IPv6 (so it only makes sense to use this with -4 or -6 option). Once this mess is fixed, the tests should be updated to use this. Suggestions for plugins ----------------------- Note: qemu supports other formats such as libnfs, iscsi, gluster and ceph/rbd, and while similar plugins could be written for nbdkit there is no compelling reason unless the result is better than qemu-nbd. For the majority of users it would be better if they were directed to qemu-nbd for these use cases. * XVA files https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg02971.html is a partial solution but it needs cleaning up. nbdkit-floppy-plugin: * Add boot sector support. In theory this is easy (eg. using SYSLINUX), but the practical reality of making a fully bootable floppy is rather more complex. * Add multiple dir merging. nbdkit-linuxdisk-plugin: * Add multiple dir merging (in e2fsprogs mke2fs). VDDK: * Map export name to file parameter, allowing clients to access multiple disks from a single VM. * For testing VDDK, try to come up with delay filter + sparse plugin settings which behave closely (in terms of performance and API latency) to the real thing. This would allow us to tune some performance tools without needing VMware all the time. nbdkit-torrent-plugin: * There are lots of settings we could map into parameters: https://www.libtorrent.org/reference-Settings.html#settings_pack * The C++ could be a lot more natural. At the moment it's a kind of “C with C++ extensionsâ€. nbdkit-ondemand-plugin: * Implement more callbacks, eg. .zero * Allow client to select size up to a limit, eg. by sending export names like ‘export:4G’. This would have to be controlled by a flag, since existing clients might be using ':'. nbdkit-data-plugin: * Allow expressions to evaluate to numbers, offsets, etc so that this works: nbdkit data '(0x55 0xAA)*n' n=1000 * Allow inclusion of files where the file is not binary but is written in the data format. * Like $VAR but the variable is either binary or base64. nbdkit-cdi-plugin: * Look at using skopeo instead of podman pull (https://github.com/containers/skopeo) nbdkit-blkio-plugin: * Use event-driven mode instead of blocking mode. This involves restructuring the plugin so that there is one or more background threads to handle the events, and nbdkit threads issue requests to these threads. (See how it is done in the VDDK plugin.) Suggestions for language plugins -------------------------------- Python: * Get the __docstring__ from the module and print it in --help output. This requires changes to the core API so that config_help is a function rather than a variable (see V3 suggestions below). Suggestions for filters ----------------------- * Add shared filter. Take advantage of filter context APIs to open a single context into the backend shared among multiple client connections. This may even allow a filter to offer a more parallel threading model than the underlying plugin. * CBT filter to track dirty blocks. See these links for inspiration: https://www.cloudandheat.com/block-level-data-tracking-using-davice-mappers-dm-era/ https://github.com/qemu/qemu/blob/master/docs/interop/bitmaps.rst * masking plugin features for testing clients (see 'nozero' and 'fua' filters for examples) * "bandwidth quota" filter which would close a connection after it exceeded a certain amount of bandwidth up or down. * "forward-only" filter. This would turn random access requests from the client into serial requests in the plugin, meaning that the plugin could be written to assume that requests only happen from beginning to end. This is would be useful for plugins that have to deal with non-seekable compressed data. Note the filter would have to work by caching already-read data in a temporary file. * nbdkit-cache-filter should handle ENOSPC errors automatically by reclaiming blocks from the cache * nbdkit-cache-filter could use a background thread for reclaiming. * zstd filter was requested as a way to do what we currently do with xz but saving many hours on compression (at the cost of hundreds of MBs of extra data) https://github.com/facebook/zstd/issues/395#issuecomment-535875379 * nbdkit-exitlast-filter could probably use a configurable timeout so that there is a grace period in case another connection comes along. * nbdkit-pause-filter would probably be more useful if the filter could inject a flush after pausing. However this requires that filter background threads have access to the plugin (see above). nbdkit-luks-filter: * This filter should also support LUKSv2 (and so should qemu). * There are some missing features: ESSIV, more ciphers. * Implement trim and zero if possible. nbdkit-readahead-filter: * The filter should open a new connection to the plugin per background thread so it is able to work with plugins that use the serialize_requests thread model (like curl). At the moment it makes requests on the same connection, so it requires plugins to use the parallel thread model. * It should combine (or avoid) overlapping cache requests. nbdkit-rate-filter: * allow other kinds of traffic shaping such as VBR * limit traffic per client (ie. per IP address) * split large requests to avoid long, lumpy sleeps when request size is much larger than rate limit nbdkit-retry-filter: * allow user to specify which errors cause a retry and which ones are passed through; for example there's probably no point retrying on ENOMEM * there are all kinds of extra complications possible here, eg. specifying a pattern of retrying and reopening: retry-method=RRRORRRRRORRRRR meaning to retry the data command 3 times, reopen, retry 5 times, etc. * subsecond times nbdkit-ip-filter: * permit hostnames and hostname wildcards to be used in the allow and deny lists * the allow and deny lists should be updatable while nbdkit is running, for example by storing them in a database file nbdkit-extentlist-filter: * read the extents generated by qemu-img map, allowing extents to be ported from a qemu block device * make non-read-only access safe by updating the extent list when the filter sees writes and trims nbdkit-exportname-filter: * find a way to call the plugin's .list_exports during .open, so that we can enforce exportname-strict=true without command line redundancy * add a mode for passing in a file containing exportnames in the same manner accepted by the sh/eval plugins, rather than one name (and no description) per config parameter nbdkit-evil-filter: * improve the algorithm so it can simulate bursts of corrupted bits (https://listman.redhat.com/archives/libguestfs/2023-May/031567.html) nbdkit-qcow2dec-filter: * implement extents - we know which clusters are preallocated and sparse, so map that into extent information * implement internal snapshots - it should be possible to select an internal snapshot by name nbdkit-spinning-filter: * fix multiconn / multiple connections so there is a single view of heads across all NBD clients nbdkit-time-limit-filter: * start counting at preconnect * fix idle connection issue mentioned in the man page * separate overall time limit and idle time limit Filters for security -------------------- Things like filtering by IP address can be done using external wrappers (TCP wrappers, systemd), or nbdkit-ip-filter. However it might be nice to have a configurable filter for preventing valid but not sensible requests. The server already filters invalid requests. This would be like seccomp, and could be implemented using an eBPF-based parser. Unfortunately actual eBPF is difficult to use for userspace processes. The "standard" isn't solidly defined - the Linux kernel implementation is the standard - and Linux has by far the best implementation, particularly around bytecode verification and JITting. There is a userspace VM (ubpf) but it has very limited capabilities compared to Linux. Composing nbdkit ---------------- Filters allow certain types of composition, but others would not be possible, for example RAIDing over multiple nbd sources. Because the plugin API limits us to loading a single plugin to the server, the best way to do this (and the most robust) is to compose multiple nbdkit processes. Perhaps libnbd will prove useful for this purpose. Build-related ------------- * Figure out how to get 'make distcheck' working. VPATH builds are working, but various pkg-config results that try to stick bash-completion and ocaml add-ons into their system-wide home do not play nicely with --prefix builds for a non-root user. * Right now, 'make check' builds keys with an expiration of 1 year only if they don't exist, and we leave the keys around except under 'make distclean'. This leads to testsuite failures when (re-)building in an incremental tree first started more than a year ago. Better would be having make unconditionally run the generator scripts, but tweak the scripts themselves to be a no-op unless the keys don't exist or have expired. Windows port ------------ Currently many features are missing, including: * Daemonization. This is not really applicable for Windows where you would instead want to run nbdkit as a service using something like SRVANY. You must use the -f option or one of the other options that implies -f. * These options are all unimplemented: --exit-with-parent, --group, --run, --selinux-label, --single, --swap, --user, --vsock * Many other plugins and filters. * errno_is_preserved should use GetLastError and/or WSAGetLastError but currently does neither so errors from plugins are probably wrong in many cases. * Most tests are skipped because of the missing features above. V3 plugin protocol ------------------ From time to time we may update the plugin protocol. This section collects ideas for things which might be fixed in the next version of the protocol. Note that we keep the old protocol(s) around so that source compatibility is retained. Plugins must opt in to the new protocol using ‘#define NBDKIT_API_VERSION ’. * All methods taking a ‘count’ field should be uint64_t (instead of uint32_t). Although the NBD protocol does not support 64 bit lengths, it might do in future. * v2 .can_zero is tri-state for filters, but bool for plugins; in v3, even plugins should get a say on whether to emulate * v2 .can_extents is bool, and cannot affect our response to NBD_OPT_SET_META_CONTEXT (that is, we are blindly emulating extent support regardless of the export name). In v3, .can_extents should be tri-state, with an explicit way to disable that context on a per-export basis. * pread could be changed to allow it to support Structured Replies (SRs). This could mean allowing it to return partial data, holes, zeroes, etc. For a client that negotiates SR coupled with a plugin that supports .extents, the v2 protocol would allow us to at least synthesize NBD_REPLY_TYPE_OFFSET_HOLE for less network traffic, even though the plugin will still have to fully populate the .pread buffer; the v3 protocol should make sparse reads more direct. * Parameters should be systematized so that they aren't just (key, value) strings. nbdkit should know the possible keys for the plugin and filters, and the type of the values, and both check and parse them for the plugin. * Modify open() API so it takes an export name and tls parameter. * Modify get_ready() API to pass final selected thread model. Filters already get this information, but to date, we have not yet seen a reason to add nbdkit_get_thread_model for use by v2 plugins. * Change config_help from a variable to a function. * Consider extra parameters to .block_size(). First so that we can separately control maximum data request (eg. pread) vs maximum virtual request (eg. zero). Note that the NBD protocol does not yet support this distinction. We may also need a 'bool strict' parameter to specify whether the client requested block size information or not. qemu-nbd can distinguish these two cases. * Renumber thread models. Redefine existing thread models like this: model existing value new value SERIALIZE_CONNECTIONS 0 1000 SERIALIZE_ALL_REQUESTS 1 2000 SERIALIZE_REQUESTS 2 3000 PARALLEL 3 4000 This allows new thread models to be inserted before and between the existing ones. In particular SERIALIZE_RETIREMENT has been suggested above (inserted between SERIALIZE_REQUESTS and PARALLEL). We could also imagine a thread model more like the one VDDK really wants which calls open and close from the main thread. For backwards compatibility the old numbers 0-3 can be transparently mapped to the new values. nbdkit-1.42.2/compile0000755000175000017500000001635014771245445010134 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: nbdkit-1.42.2/config.guess0000755000175000017500000014305114771245445011075 #!/usr/bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2024 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 # Just in case it came from the environment. GUESS= # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver 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 } # 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 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 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. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; 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. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; 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'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; 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) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # 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:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) 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; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 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 GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 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 test -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 test "$HP_ARCH" = ""; then 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 test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) 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; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; 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*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; 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:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; 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/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 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/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; 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. GUESS=i386-sequent-sysv4 ;; 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. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; 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 GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; 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 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *: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 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #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 (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 #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #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; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&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 fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: nbdkit-1.42.2/config.sub0000755000175000017500000010776114771245445010550 #!/usr/bin/sh # Configuration validation subroutine script. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # 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. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2024 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 ;; *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 # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # 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) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. obj= case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 fi ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac case $obj in aout* | coff* | elf* | pe*) ;; '') # empty is fine ;; *) echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 exit 1 ;; esac # Here we handle the constraint that a (synthetic) cpu and os are # valid only in combination with each other and nowhere else. case $cpu-$os in # The "javascript-unknown-ghcjs" triple is used by GHC; we # accept it here in order to tolerate that, but reject any # variations. javascript-ghcjs) ;; javascript-* | *-ghcjs) echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-relibc*- | linux-uclibc*- ) ;; uclinux-uclibc*- ) ;; managarm-mlibc*- | managarm-kernel*- ) ;; windows*-msvc*-) ;; -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; kfreebsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; nto-qnx*-) ;; os2-emx-) ;; *-eabi*- | *-gnueabi*-) ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format ;; -*-) # Blank kernel with real OS is always fine. ;; --*) # Blank kernel and OS with real machine code file format is always fine. ;; *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) 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 ;; esac echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: nbdkit-1.42.2/depcomp0000755000175000017500000005602014771245450010125 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: nbdkit-1.42.2/install-sh0000744000175000017500000003610514771245450010554 #!/usr/bin/sh # install - install a program, script, or datafile scriptversion=2023-11-23.18; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Report bugs to . GNU Automake home page: . General help using GNU software: ." while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: nbdkit-1.42.2/ltmain.sh0000644000175000017500000121201014771245443010364 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" # Keeping compiler generated duplicates in $postdeps and $predeps is not # harmful, and is necessary in a majority of systems that use it to satisfy # symbol dependencies. opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: nbdkit-1.42.2/missing0000755000175000017500000001533614771245445010160 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: nbdkit-1.42.2/wrapper.c0000644000175000017500000002521714623341243010371 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /*------------------------------------------------------------ * This is not nbdkit. This is a wrapper which lets you run nbdkit * from the source directory without installing nbdkit. * * You can use either: * * ./nbdkit file [arg=value] [arg=value] ... * * or: * * /path/to/nbdkit file [arg=value] [arg=value] ... * * or you can set $PATH to include the nbdkit source directory and run * the bare "nbdkit" command without supplying the full path. * * The wrapper modifies the bare plugin name (eg. "file") to be the * full path to the locally compiled plugin. If you don't use this * program and run server/nbdkit directly then it will pick up the * globally installed plugins which is usually not what you want. * * This program is also used to run the tests (make check). * * You can enable valgrind by setting NBDKIT_VALGRIND=1 (this * is mainly used by the internal tests). * * You can enable debugging by setting NBDKIT_GDB=1 *------------------------------------------------------------ */ #include #include #include #include #include #include #include #include #include #include #include "const-string-vector.h" #include "options.h" #include "windows-compat.h" #include "utils.h" /* Plugins written in scripting languages need to be rewritten on the * command line in a different way from plugins written in C. So we * have to list those here, and return the language plugin needed to * run them. */ static bool is_script_plugin (const char *name, const char **language) { if (strcmp (name, "example4") == 0) { *language = "perl"; return true; } if (strcmp (name, "S3") == 0 || strcmp (name, "gcs") == 0) { *language = "python"; return true; } return false; } /* Construct an array of parameters passed through to real nbdkit. */ static const_string_vector cmd; static void passthru (const char *s) { if (const_string_vector_append (&cmd, s) == -1) abort (); } static void __attribute__ ((format (printf, 1, 2))) passthru_format (const char *fs, ...) { va_list args; char *str; va_start (args, fs); if (vasprintf (&str, fs, args) == -1) abort (); va_end (args); passthru (str); } static void end_passthru (void) { passthru (NULL); } static void print_command (void) { size_t i; if (cmd.len > 0) shell_quote (cmd.ptr[0], stderr); for (i = 1; i < cmd.len && cmd.ptr[i] != NULL; ++i) { fputc (' ', stderr); shell_quote (cmd.ptr[i], stderr); } fputc ('\n', stderr); } #ifdef WIN32 /* Windows behaviour of _spawnvp is completely insane: * https://stackoverflow.com/questions/4146980/how-to-avoid-space-splitting-and-quote-removal-with-spawnvp * See also glib sources where it's described as "really weird". */ static const char * quote_string_for_spawn (const char *str) { size_t i, len, pb; char *p, *ret = (char *) str; if (*str == 0 || strchr (str, ' ') || strchr (str, '\t')) { len = strlen (str); p = ret = malloc (2 + len*2 + 1); if (ret == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } *p++ = '"'; pb = 0; for (i = 0; i < len; ++i) { switch (str[i]) { case '"': *p++ = '\\'; for (; pb > 0; --pb) *p++ = '\\'; *p++ = '"'; break; case '\\': pb++; *p++ = str[i]; break; default: pb = 0; *p++ = str[i]; } } for (; pb > 0; --pb) *p++ = '\\'; *p++ = '"'; *p++ = '\0'; } /* We never free these strings. */ return ret; } #endif /* WIN32 */ int main (int argc, char *argv[]) { bool verbose = false; char *s; int r; #ifndef WIN32 bool valgrind = false, gdb = false; #endif #ifndef WIN32 /* If NBDKIT_VALGRIND=1 is set in the environment, then we run the * program under valgrind. This is used by the tests. Similarly if * NBDKIT_GDB=1 is set, we run the program under GDB, useful during * development. */ s = getenv ("NBDKIT_VALGRIND"); if (s && strcmp (s, "1") == 0) valgrind = true; s = getenv ("NBDKIT_GDB"); if (s && strcmp (s, "1") == 0) gdb = true; if (valgrind) { passthru (VALGRIND); if (!gdb) passthru ("--vgdb=no"); else /* https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver */ passthru ("--vgdb-error=0"); passthru ("--leak-check=full"); passthru ("--show-leak-kinds=all"); passthru ("--error-exitcode=119"); passthru_format ("--suppressions=%s/valgrind/suppressions", builddir); passthru ("--trace-children=no"); passthru ("--run-libc-freeres=no"); passthru ("--num-callers=100"); /* This is a temporary workaround until RHBZ#1662656 is fixed: */ passthru ("--read-inline-info=no"); /* Don't invoke malloc debugging when we are valgrinding because * it duplicates work done by valgrind and might even hide issues. * * Originally this was a workaround for: * https://sourceware.org/bugzilla/show_bug.cgi?id=28256 */ unsetenv ("GLIBC_TUNABLES"); } else if (gdb) { passthru ("gdb"); passthru ("--args"); } #endif /* Needed for plugins written in OCaml. */ #if defined (WIN32) #define LD_LIBRARY_PATH "PATH" #elif defined (__APPLE__) #define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" #else #define LD_LIBRARY_PATH "LD_LIBRARY_PATH" #endif s = getenv (LD_LIBRARY_PATH); if (s) r = asprintf (&s, "%s/plugins/ocaml/.libs:%s", builddir, s); else r = asprintf (&s, "%s/plugins/ocaml/.libs", builddir); if (r < 0) { perror ("asprintf"); exit (EXIT_FAILURE); } setenv (LD_LIBRARY_PATH, s, 1); free (s); s = getenv ("LIBRARY_PATH"); if (s) r = asprintf (&s, "%s/plugins/ocaml/.libs:%s", builddir, s); else r = asprintf (&s, "%s/plugins/ocaml/.libs", builddir); if (r < 0) { perror ("asprintf"); exit (EXIT_FAILURE); } setenv ("LIBRARY_PATH", s, 1); free (s); /* Absolute path of the real nbdkit command. */ passthru_format ("%s/server/nbdkit" EXEEXT, builddir); /* Option parsing. We don't really parse options here. We are only * interested in which options have arguments and which need * rewriting. */ for (;;) { int c; int long_index = -1; bool is_long_option; c = getopt_long (argc, argv, short_options, long_options, &long_index); if (c == -1) break; if (c == '?') /* getopt prints an error */ exit (EXIT_FAILURE); /* long_index is only set if it's an actual long option. */ is_long_option = long_index >= 0; /* Verbose is special because we will print the final command. */ if (c == 'v') { verbose = true; if (is_long_option) passthru ("--verbose"); else passthru ("-v"); } /* Filters can be rewritten if they are a short name. */ else if (c == FILTER_OPTION) { if (is_short_name (optarg)) passthru_format ("--filter=" "%s/filters/%s/.libs/nbdkit-%s-filter." SOEXT, builddir, optarg, optarg); else passthru_format ("--filter=%s", optarg); } /* Any long option. */ else if (is_long_option) { if (optarg) /* Long option which takes an argument. */ passthru_format ("--%s=%s", long_options[long_index].name, optarg); else /* Long option which takes no argument. */ passthru_format ("--%s", long_options[long_index].name); } /* Any short option. */ else { passthru_format ("-%c", c); if (optarg) passthru (optarg); } } /* Are there any non-option arguments? */ if (optind < argc) { /* Ensure any further parameters can never be parsed as options by * real nbdkit. */ passthru ("--"); /* The first non-option argument is the plugin name. If it is a * short name then rewrite it. */ if (is_short_name (argv[optind])) { const char *language; /* Plugins written in scripting languages. */ if (is_script_plugin (argv[optind], &language)) { passthru_format ("%s/plugins/%s/.libs/nbdkit-%s-plugin." SOEXT, builddir, language, language); passthru_format ("%s/plugins/%s/nbdkit-%s-plugin", builddir, argv[optind], argv[optind]); } /* Otherwise normal plugins written in C or other languages that * compile to .so files. */ else { passthru_format ("%s/plugins/%s/.libs/nbdkit-%s-plugin." SOEXT, builddir, argv[optind], argv[optind]); } ++optind; } /* Everything else is passed through without rewriting. */ while (optind < argc) { passthru (argv[optind]); ++optind; } } end_passthru (); if (verbose) print_command (); /* Run the final command. */ #ifndef WIN32 execvp (cmd.ptr[0], (char **) cmd.ptr); perror (cmd.ptr[0]); exit (EXIT_FAILURE); #else /* WIN32 */ size_t i; for (i = 1; cmd.ptr[i] != NULL; ++i) cmd.ptr[i] = quote_string_for_spawn (cmd.ptr[i]); r = _spawnvp (_P_WAIT, cmd.ptr[0], cmd.ptr); if (r == -1) { perror (cmd.ptr[0]); exit (EXIT_FAILURE); } exit (r == 0 ? EXIT_SUCCESS : EXIT_FAILURE); #endif /* WIN32 */ } nbdkit-1.42.2/BENCHMARKING0000644000175000017500000001232714623341243010316 A GUIDE TO BENCHMARKING NBDKIT General comments ================ * The plugin matters! Different plugins have completely different uses, implementations and threading models. There is little point in talking generically about “the performance of nbdkit†without mentioning what plugin you are testing. * The client matters! Does the client support multi-conn? Does the client use the oldstyle or newstyle protocol? Has the client been written with performance in mind? The currently best clients are (a) the Linux kernel (nbd.ko), (b) qemu, and (c) fio. Make sure you are using recent versions and have multi-conn enabled. * Filters impair performance! When benchmarking you should never use filters unless filters are what you are trying to benchmark. Testing using fio ================= FIO is a Flexible I/O tester written by Jens Axboe, and it is the primary tool used for generating the load to test filesystems and block devices. (1) Install libnbd. (2) Clone and compile fio: https://github.com/axboe/fio using: ./configure --enable-libnbd (3) Edit the test file in examples/nbd.fio, if required. (4) Run nbdkit and fio together. From the fio source directory: rm -f /tmp/socket nbdkit -f -U /tmp/socket null 1G --run 'export uri; ./fio examples/nbd.fio' If you want to use nbdkit from the source directory too, change ‘nbdkit’ to the path of the wrapper, eg: rm -f /tmp/socket ../nbdkit/nbdkit -f -U /tmp/socket null 1G --run 'export uri; ./fio examples/nbd.fio' Variations ---------- * Try adjusting the number of fio jobs (threads). * Try adjusting the number of nbdkit threads (nbdkit -t option). * Use other plugins. Both nbdkit-memory-plugin and nbdkit-file-plugin are important ones to test. * Run nbdkit under perf: perf record -a -g --call-graph=dwarf -- \ server/nbdkit -f -U /tmp/socket \ ./plugins/null/.libs/nbdkit-null-plugin.so 1G Testing using the Linux kernel client ===================================== Step (1) is the same as above - obtain or compile fio. (2) Create the fio configuation file. Create /var/tmp/test.fio containing: ---------------------------------------------------------------------- [test] rw=randrw size=64m directory=/var/tmp/nbd ioengine=libaio iodepth=4 direct=1 numjobs=8 group_reporting time_based runtime=120 ---------------------------------------------------------------------- (3) Run nbdkit. From the nbdkit source directory: rm -f /tmp/socket ./nbdkit -f -U /tmp/socket memory 1G (4) Loop mount the NBD server: modprobe nbd nbd-client -C 8 -unix /tmp/socket /dev/nbd0 mkfs.xfs -f /dev/nbd0 mkdir /var/tmp/nbd mount /dev/nbd0 /var/tmp/nbd (5) Run the fio test: fio /var/tmp/test.fio Testing using qemu ================== Qemu contains an NBD client with excellent performance. However it's not very useful for general benchmarking. But two tests you can perform are described below. Test linear copying performance ------------------------------- In some situations, linear copying is important, particularly when copying large disk images or virtual machines around. Both nbdkit and the qemu client support sparseness detection and efficient zeroing. To test copying speed you can use ‘qemu-img convert’, to or from nbdkit: nbdkit memory 1G --run 'qemu-img convert file.qcow2 -O raw "$uri"' nbdkit memory 1G --run 'qemu-img convert "$uri" -O qcow2 file.qcow2' Notes: * In the second case, because the memory plugin is entirely sparse and zero, the convert command should do almost no work. A more realistic test might use the file, data or pattern plugins. * Try copying to and from remote sources like nbdkit-curl-plugin and nbdkit-ssh-plugin. * nbdkit-readahead-filter can optimize copying when reading from nbdkit. This filter can particularly affect performance when the nbdkit plugin source is remote (eg. nbdkit-curl-plugin). * qemu-img has options for optimizing number of threads and whether out of order writes are permitted. Test end-to-end VM block device performance ------------------------------------------- Set up a virtual machine using an NBD block device, connected to nbdkit. On the qemu command line you would use: qemu ... -drive file=nbd:unix:/tmp/sock,if=virtio,format=raw ... In libvirt you would use: Set up nbdkit to serve on the Unix domain socket: nbdkit -U /tmp/sock memory 1G Inside the guest you will see a block device like /dev/vdX which is backed by the nbdkit instance, and you can use fio or other filesystem testing tools to evaluate performance. This is very much a real world, end-to-end test which tests many different things together, including the client, guest kernel, qemu, virtio transport, host kernel and nbdkit. So it's more useful as a way to detect that there is a problem, rather than as a way to identify which component is at fault. If you have sufficiently recent kernel and qemu you can try using virtio-vsock as the transport (instead of a Unix domain socket), see AF_VSOCK in nbdkit-service(1). nbdkit-1.42.2/.dir-locals.el0000644000175000017500000000032014534316443011167 ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") ((autoconf-mode . ((indent-tabs-mode . nil))) (c-mode . ((indent-tabs-mode . nil) (c-basic-offset . 2)))) nbdkit-1.42.2/.gitignore0000644000175000017500000000773314771245341010546 *~ *.bak *.cmi *.cmx *.dll *.exe *.gcda *.gcno *.la *.lo *.log *.o *.swp *.trs .deps .dirstamp .gdb_history .libs Makefile Makefile.in __pycache__ /local* /nbdkit-*.tar.gz /nbdkit-*.tar.gz.sig /nbdkit-*.*/ docs/*.1 docs/nbdkit_debug.3 docs/nbdkit_error.3 docs/nbdkit_export_name.3 docs/nbdkit-filter.3 docs/nbdkit_is_tls.3 docs/nbdkit_nanosleep.3 docs/nbdkit_parse_bool.3 docs/nbdkit_parse_delay.3 docs/nbdkit_parse_int.3 docs/nbdkit_parse_probability.3 docs/nbdkit_parse_size.3 docs/nbdkit_peer_name.3 docs/nbdkit_peer_tls_dn.3 docs/nbdkit-plugin.3 docs/nbdkit_read_password.3 docs/nbdkit_realpath.3 docs/nbdkit_shutdown.3 docs/nbdkit_stdio_safe.3 docs/nbdkit_strdup_intern.3 filters/*/*.1 plugins/*/*.1 plugins/*/*.3 .libs/*.so /tests/*.so /aclocal.m4 /autom4te.cache /common/bitmap/test-bitmap /common/include/test-array-size /common/include/test-ascii-ctype /common/include/test-ascii-string /common/include/test-byte-swapping /common/include/test-checked-overflow /common/include/test-human-size /common/include/test-isaligned /common/include/test-ispowerof2 /common/include/test-iszero /common/include/test-minmax /common/include/test-nextnonzero /common/include/test-random /common/include/test-tvdiff /common/protocol/generate-protostrings.sh /common/protocol/protostrings.c /common/protocol/test-protostrings /common/replacements/libcompat.a /common/replacements/test-current-dir-name /common/replacements/win32/stamp-data /common/utils/test-quotes /common/utils/test-vector /common/utils/windows-errors.c /compile /config.cache /config.guess /config.h /config.h.in /config.log /config.status /config.sub /configure /contrib/sparseloadtest /depcomp /docs/filter-links.pod /docs/lang-plugin-links.pod /docs/plugin-links.pod /filters/lzip/blkcache.c /fuzzing/sync_dir/ /fuzzing/testcase_dir/[0-f]* /html/*.html /include/nbdkit-version.h /INSTALL /install-sh /libtool /ltmain.sh /missing /nbdkit /plugins/example4/nbdkit-example4-plugin /plugins/eval/call.c /plugins/eval/methods.c /plugins/eval/tmpdir.c /plugins/gcs/nbdkit-gcs-plugin /plugins/golang/examples/*/nbdkit-*-plugin.h /plugins/golang/examples/*/nbdkit-*-plugin.so /plugins/ocaml/nbdkit-ocamlexample-plugin.so /plugins/ondemand/default-command.c /plugins/rust/Cargo.lock /plugins/rust/target /plugins/S3/nbdkit-S3-plugin /plugins/tmpdisk/default-command.c /podwrapper.pl /server/libnbdkit.a /server/local/nbdkit.pc /server/nbdkit /server/nbdkit.def /server/nbdkit.pc /server/synopsis.c /server/test-public /stamp-h1 /tests/disk /tests/disk.bz2 /tests/disk.gz /tests/disk.lz /tests/disk.tar /tests/disk.tar.gz /tests/disk.tar.lz /tests/disk.tar.xz /tests/disk.xz /tests/ext2.img /tests/file-data /tests/functions.sh /tests/keys.psk /tests/make-pki.sh /tests/nbdkit /tests/partition-disk /tests/pki /tests/shebang-crlf.py /tests/split1 /tests/split2 /tests/split3 /tests/test-bzip2 /tests/test-connect /tests/test-curl /tests/test-curl-cookie-script /tests/test-curl-header-script /tests/test-curl-head-forbidden /tests/test-data /tests/test-delay /tests/test-exit-with-parent /tests/test-exitwhen-pipe-closed /tests/test-ext2 /tests/test-file-block /tests/test-file-block-nbd /tests/test-golang /tests/test-gzip /tests/test-gzip-curl /tests/test-just-filter-header /tests/test-just-plugin-header /tests/test-layers /tests/test-lua /tests/test-lzip /tests/test-lzip-curl /tests/test-memory /tests/test-memory-allocator-malloc /tests/test-memory-allocator-zstd /tests/test-newstyle /tests/test-nbd /tests/test-null /tests/test-ocaml /tests/test-ocaml-errorcodes /tests/test-offset /tests/test-oldstyle /tests/test-old-plugins-*.sh /tests/test-partition /tests/test-pause /tests/test-perl /tests/test-protect /tests/test-python /tests/test-random /tests/test-readahead /tests/test-retry-request-mirror /tests/test-shell /tests/test-shell.img /tests/test-socket-activation /tests/test-split /tests/test-tar-gzip-curl /tests/test-tar-lzip-curl /tests/test-tar-xz-curl /tests/test-tcl /tests/test-tmpdisk /tests/test-vddk /tests/test-xz /tests/test-xz-curl /test-driver /valgrind/suppressions nbdkit-1.42.2/LICENSE0000644000175000017500000000260514534316443007553 nbdkit Copyright Red Hat Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. nbdkit-1.42.2/OTHER_PLUGINS0000644000175000017500000000177314730027756010564 Have you written an nbdkit plugin that you're willing to share? Email to get it added to this list. * XVA (XenServer Virtual Appliance) This simple plugin written in Perl lets you read these files and reexport them as NBD. It does not require that the XVA is unpacked: https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg02971.html https://lists.gnu.org/archive/html/qemu-devel/2017-11/plHKJ062x5Uo.pl The whole thread is worth reading because several different approaches to dealing with XVA files are presented: https://lists.gnu.org/archive/html/qemu-devel/2017-11/threads.html#02839 * Minecraft "block block device" https://github.com/williambl/blockblockdevice "Block Block Device is a Minecraft mod and NBDKit plugin which work together to allow you to create block devices on your computer which are backed by redstone in a Minecraft world." * Tom7's Hard(er) Drives http://tom7.org/harder/ This is a C++ nbdkit plugin which stores data "in flight" in ping packets. nbdkit-1.42.2/SECURITY0000644000175000017500000000123314534316443007734 If you think you've found a serious or potential security bug that you don't want to report on a public mailing list, then send email to both and . Make it clear in the email Subject line that it's a serious or security-related bug in nbdkit. You can also sign and/or encrypt messages using our GPG public keys available on the usual keyservers, or online here: https://download.libguestfs.org/libguestfs.keyring For information about past security issues, see docs/nbdkit-security.pod, or the nbdkit-security(1) man page if you have installed nbdkit, also available online here: http://libguestfs.org/nbdkit-security.1.html nbdkit-1.42.2/bash-completion/0000755000175000017500000000000014771247240011710 5nbdkit-1.42.2/bash-completion/Makefile.am0000644000175000017500000000306514534316443013667 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = README if HAVE_BASH_COMPLETION dist_bashcomp_DATA = nbdkit endif nbdkit-1.42.2/bash-completion/nbdkit0000644000175000017500000000757514534316443013043 # nbdkit bash completion script -*- shell-script -*- # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. _nbdkit_list_plugins () { local plugindir plugindir="$( nbdkit --dump-config | grep ^plugindir= | sed 's/^plugindir=//' )" ls -1 "$plugindir" | sed 's/^nbdkit-//' | sed 's/-plugin.*//' } _nbdkit_list_filters () { local filterdir filterdir="$( nbdkit --dump-config | grep ^filterdir= | sed 's/^filterdir=//' )" ls -1 "$filterdir" | sed 's/^nbdkit-//' | sed 's/-filter.*//' } # This handler function is called when the user presses tab. _nbdkit () { local cur prev words cword split local shortopts longopts plugin plugins filters args i _init_completion -s || return # Did we get the plugin name yet? # This is only a heuristic because it can be confused by # long opt parameters with an arguments. XXX plugin= for (( i=1; i < ${#words[@]}; ++i)) ; do if [[ "${words[i]}" =~ ^[a-zA-Z0-9]+$ ]]; then plugin="${words[i]}" break fi done # Previous item on the current line is a completable flag or plugin name? case "$prev" in --filter) filters="$(_nbdkit_list_filters)" COMPREPLY=( $(compgen -W "$filters" "$cur") ) return ;; --tls) COMPREPLY=( $(compgen -W "off on require" "$cur") ) return ;; # Could complete -u and -g options too. XXX esac # Current item is an option we can expand? case "$cur" in --*) longopts="$(nbdkit --long-options)" COMPREPLY=( $(compgen -W "$longopts" -- "$cur") ) return ;; -*) shortopts="$(nbdkit --short-options)" longopts="$(nbdkit --long-options)" COMPREPLY=( $(compgen -W "$shortopts $longopts" -- "$cur") ) return ;; *) if [ "$plugin" = "" ] || [ "$plugin" = "$cur" ]; then # Complete plugin name. plugins="$(_nbdkit_list_plugins)" COMPREPLY=( $(compgen -W "$plugins" "$cur") ) return else # Complete plugin args. args="$( nbdkit $plugin --help 2>/dev/null | grep -E '^[-a-z0-9]+=' | sed 's/=.*/=/' )" COMPREPLY=( $(compgen -W "$args" "$cur") ) return fi ;; esac } # Install the handler function. complete -o default -F _nbdkit nbdkit nbdkit-1.42.2/bash-completion/Makefile.in0000644000175000017500000005137614771245445013716 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = bash-completion ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_bashcomp_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_bashcomp_DATA_DIST = nbdkit am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bashcompdir)" DATA = $(dist_bashcomp_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll EXTRA_DIST = README @HAVE_BASH_COMPLETION_TRUE@dist_bashcomp_DATA = nbdkit all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bash-completion/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bash-completion/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_bashcompDATA: $(dist_bashcomp_DATA) @$(NORMAL_INSTALL) @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bashcompdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bashcompdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashcompdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompdir)" || exit $$?; \ done uninstall-dist_bashcompDATA: @$(NORMAL_UNINSTALL) @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(bashcompdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(bashcompdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_bashcompDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_bashcompDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_bashcompDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_bashcompDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/bash-completion/README0000644000175000017500000000045614534316443012514 This directory contains the scripts for tab-completing commands in bash. Note these new-style demand-loaded scripts require bash-completion >= 1.99. Tip: To test the bash completions without having to install them, simply start a new shell and do: source ./bash-completion/nbdkit; PATH=$PWD:$PATH nbdkit-1.42.2/docs/0000755000175000017500000000000014771247240007554 5nbdkit-1.42.2/docs/Makefile.am0000644000175000017500000002522114771245250011531 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = \ make-links.sh \ nbdkit.pod \ nbdkit-captive.pod \ nbdkit-client.pod \ nbdkit_debug.pod \ nbdkit_error.pod \ nbdkit_export_name.pod \ nbdkit-filter.pod \ nbdkit_is_tls.pod \ nbdkit-loop.pod \ nbdkit_nanosleep.pod \ nbdkit_parse_bool.pod \ nbdkit_parse_delay.pod \ nbdkit_parse_int.pod \ nbdkit_parse_probability.pod \ nbdkit_parse_size.pod \ nbdkit_peer_name.pod \ nbdkit_peer_tls_dn.pod \ nbdkit-plugin.pod \ nbdkit-probing.pod \ nbdkit-protocol.pod \ nbdkit_read_password.pod \ nbdkit_realpath.pod \ nbdkit-release-notes-1.4.pod \ nbdkit-release-notes-1.6.pod \ nbdkit-release-notes-1.8.pod \ nbdkit-release-notes-1.10.pod \ nbdkit-release-notes-1.12.pod \ nbdkit-release-notes-1.14.pod \ nbdkit-release-notes-1.16.pod \ nbdkit-release-notes-1.18.pod \ nbdkit-release-notes-1.20.pod \ nbdkit-release-notes-1.22.pod \ nbdkit-release-notes-1.24.pod \ nbdkit-release-notes-1.26.pod \ nbdkit-release-notes-1.28.pod \ nbdkit-release-notes-1.30.pod \ nbdkit-release-notes-1.32.pod \ nbdkit-release-notes-1.34.pod \ nbdkit-release-notes-1.36.pod \ nbdkit-release-notes-1.38.pod \ nbdkit-release-notes-1.40.pod \ nbdkit-release-notes-1.42.pod \ nbdkit-security.pod \ nbdkit-service.pod \ nbdkit_shutdown.pod \ nbdkit_stdio_safe.pod \ nbdkit_strdup_intern.pod \ nbdkit-tls.pod \ synopsis.txt \ $(NULL) # These man pages are links to other man pages, they are not generated # from pod sources. Therefore we have to distribute them in the # tarball. non_generated_mans = \ nbdkit_absolute_path.3 \ nbdkit_disconnect.3 \ nbdkit_parse_int8_t.3 \ nbdkit_parse_int16_t.3 \ nbdkit_parse_int32_t.3 \ nbdkit_parse_int64_t.3 \ nbdkit_parse_uint8_t.3 \ nbdkit_parse_uint16_t.3 \ nbdkit_parse_uint32_t.3 \ nbdkit_parse_uint64_t.3 \ nbdkit_parse_unsigned.3 \ nbdkit_peer_gid.3 \ nbdkit_peer_pid.3 \ nbdkit_peer_uid.3 \ nbdkit_peer_security_context.3 \ nbdkit_peer_tls_issuer_dn.3 \ nbdkit_printf_intern.3 \ nbdkit_set_error.3 \ nbdkit_strndup_intern.3 \ nbdkit_vdebug.3 \ nbdkit_verror.3 \ nbdkit_vprintf_intern.3 \ $(NULL) EXTRA_DIST += $(non_generated_mans) if HAVE_POD # These man pages are generated from pod sources. Use a separate # variable here so we can add only these to CLEANFILES below. generated_mans = \ nbdkit.1 \ nbdkit-captive.1 \ nbdkit-client.1 \ nbdkit_debug.3 \ nbdkit_error.3 \ nbdkit_export_name.3 \ nbdkit-filter.3 \ nbdkit_is_tls.3 \ nbdkit-loop.1 \ nbdkit_nanosleep.3 \ nbdkit_parse_bool.3 \ nbdkit_parse_delay.3 \ nbdkit_parse_int.3 \ nbdkit_parse_probability.3 \ nbdkit_parse_size.3 \ nbdkit_peer_name.3 \ nbdkit_peer_tls_dn.3 \ nbdkit-plugin.3 \ nbdkit-probing.1 \ nbdkit-protocol.1 \ nbdkit_read_password.3 \ nbdkit_realpath.3 \ nbdkit-release-notes-1.4.1 \ nbdkit-release-notes-1.6.1 \ nbdkit-release-notes-1.8.1 \ nbdkit-release-notes-1.10.1 \ nbdkit-release-notes-1.12.1 \ nbdkit-release-notes-1.14.1 \ nbdkit-release-notes-1.16.1 \ nbdkit-release-notes-1.18.1 \ nbdkit-release-notes-1.20.1 \ nbdkit-release-notes-1.22.1 \ nbdkit-release-notes-1.24.1 \ nbdkit-release-notes-1.26.1 \ nbdkit-release-notes-1.28.1 \ nbdkit-release-notes-1.30.1 \ nbdkit-release-notes-1.32.1 \ nbdkit-release-notes-1.34.1 \ nbdkit-release-notes-1.36.1 \ nbdkit-release-notes-1.38.1 \ nbdkit-release-notes-1.40.1 \ nbdkit-release-notes-1.42.1 \ nbdkit-security.1 \ nbdkit-service.1 \ nbdkit_shutdown.3 \ nbdkit_stdio_safe.3 \ nbdkit_strdup_intern.3 \ nbdkit-tls.1 \ $(NULL) CLEANFILES += $(generated_mans) man_MANS = \ $(generated_mans) \ $(non_generated_mans) \ $(NULL) nbdkit.1: nbdkit.pod plugin-links.pod lang-plugin-links.pod filter-links.pod \ synopsis.txt $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ --insert plugin-links.pod:__PLUGIN_LINKS__ \ --insert lang-plugin-links.pod:__LANG_PLUGIN_LINKS__ \ --insert filter-links.pod:__FILTER_LINKS__ \ --verbatim $(srcdir)/synopsis.txt:__SYNOPSIS__ \ $< nbdkit-captive.1: nbdkit-captive.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-client.1: nbdkit-client.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_debug.3: nbdkit_debug.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_error.3: nbdkit_error.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_export_name.3: nbdkit_export_name.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-filter.3: nbdkit-filter.pod filter-links.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ --insert filter-links.pod:__FILTER_LINKS__ \ $< nbdkit_is_tls.3: nbdkit_is_tls.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-loop.1: nbdkit-loop.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_nanosleep.3: nbdkit_nanosleep.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_parse_bool.3: nbdkit_parse_bool.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_parse_delay.3: nbdkit_parse_delay.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_parse_int.3: nbdkit_parse_int.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_parse_probability.3: nbdkit_parse_probability.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_parse_size.3: nbdkit_parse_size.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_peer_name.3: nbdkit_peer_name.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_peer_tls_dn.3: nbdkit_peer_tls_dn.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-plugin.3: nbdkit-plugin.pod plugin-links.pod lang-plugin-links.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ --insert plugin-links.pod:__PLUGIN_LINKS__ \ --insert lang-plugin-links.pod:__LANG_PLUGIN_LINKS__ \ $< nbdkit-probing.1: nbdkit-probing.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-protocol.1: nbdkit-protocol.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_read_password.3: nbdkit_read_password.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_realpath.3: nbdkit_realpath.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-release-notes-%.1: nbdkit-release-notes-%.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-security.1: nbdkit-security.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-service.1: nbdkit-service.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_shutdown.3: nbdkit_shutdown.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_stdio_safe.3: nbdkit_stdio_safe.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit_strdup_intern.3: nbdkit_strdup_intern.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ $< nbdkit-tls.1: nbdkit-tls.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD # All plugins. plugin-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh plugin 1 $(non_lang_plugins) > $@-t echo \; >> $@-t $(srcdir)/make-links.sh plugin 3 $(lang_plugins) >> $@-t mv $@-t $@ # Only language plugins (in section 3). lang-plugin-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh plugin 3 $(lang_plugins) >> $@-t mv $@-t $@ # All filters. filter-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh filter 1 $(filters) > $@-t mv $@-t $@ DISTCLEANFILES = plugin-links.pod lang-plugin-links.pod filter-links.pod nbdkit-1.42.2/docs/Makefile.in0000644000175000017500000010552214771245446011554 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_POD_TRUE@am__append_1 = $(generated_mans) subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" man3dir = $(mandir)/man3 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_1) EXTRA_DIST = make-links.sh nbdkit.pod nbdkit-captive.pod \ nbdkit-client.pod nbdkit_debug.pod nbdkit_error.pod \ nbdkit_export_name.pod nbdkit-filter.pod nbdkit_is_tls.pod \ nbdkit-loop.pod nbdkit_nanosleep.pod nbdkit_parse_bool.pod \ nbdkit_parse_delay.pod nbdkit_parse_int.pod \ nbdkit_parse_probability.pod nbdkit_parse_size.pod \ nbdkit_peer_name.pod nbdkit_peer_tls_dn.pod nbdkit-plugin.pod \ nbdkit-probing.pod nbdkit-protocol.pod \ nbdkit_read_password.pod nbdkit_realpath.pod \ nbdkit-release-notes-1.4.pod nbdkit-release-notes-1.6.pod \ nbdkit-release-notes-1.8.pod nbdkit-release-notes-1.10.pod \ nbdkit-release-notes-1.12.pod nbdkit-release-notes-1.14.pod \ nbdkit-release-notes-1.16.pod nbdkit-release-notes-1.18.pod \ nbdkit-release-notes-1.20.pod nbdkit-release-notes-1.22.pod \ nbdkit-release-notes-1.24.pod nbdkit-release-notes-1.26.pod \ nbdkit-release-notes-1.28.pod nbdkit-release-notes-1.30.pod \ nbdkit-release-notes-1.32.pod nbdkit-release-notes-1.34.pod \ nbdkit-release-notes-1.36.pod nbdkit-release-notes-1.38.pod \ nbdkit-release-notes-1.40.pod nbdkit-release-notes-1.42.pod \ nbdkit-security.pod nbdkit-service.pod nbdkit_shutdown.pod \ nbdkit_stdio_safe.pod nbdkit_strdup_intern.pod nbdkit-tls.pod \ synopsis.txt $(NULL) $(non_generated_mans) # These man pages are links to other man pages, they are not generated # from pod sources. Therefore we have to distribute them in the # tarball. non_generated_mans = \ nbdkit_absolute_path.3 \ nbdkit_disconnect.3 \ nbdkit_parse_int8_t.3 \ nbdkit_parse_int16_t.3 \ nbdkit_parse_int32_t.3 \ nbdkit_parse_int64_t.3 \ nbdkit_parse_uint8_t.3 \ nbdkit_parse_uint16_t.3 \ nbdkit_parse_uint32_t.3 \ nbdkit_parse_uint64_t.3 \ nbdkit_parse_unsigned.3 \ nbdkit_peer_gid.3 \ nbdkit_peer_pid.3 \ nbdkit_peer_uid.3 \ nbdkit_peer_security_context.3 \ nbdkit_peer_tls_issuer_dn.3 \ nbdkit_printf_intern.3 \ nbdkit_set_error.3 \ nbdkit_strndup_intern.3 \ nbdkit_vdebug.3 \ nbdkit_verror.3 \ nbdkit_vprintf_intern.3 \ $(NULL) # These man pages are generated from pod sources. Use a separate # variable here so we can add only these to CLEANFILES below. @HAVE_POD_TRUE@generated_mans = \ @HAVE_POD_TRUE@ nbdkit.1 \ @HAVE_POD_TRUE@ nbdkit-captive.1 \ @HAVE_POD_TRUE@ nbdkit-client.1 \ @HAVE_POD_TRUE@ nbdkit_debug.3 \ @HAVE_POD_TRUE@ nbdkit_error.3 \ @HAVE_POD_TRUE@ nbdkit_export_name.3 \ @HAVE_POD_TRUE@ nbdkit-filter.3 \ @HAVE_POD_TRUE@ nbdkit_is_tls.3 \ @HAVE_POD_TRUE@ nbdkit-loop.1 \ @HAVE_POD_TRUE@ nbdkit_nanosleep.3 \ @HAVE_POD_TRUE@ nbdkit_parse_bool.3 \ @HAVE_POD_TRUE@ nbdkit_parse_delay.3 \ @HAVE_POD_TRUE@ nbdkit_parse_int.3 \ @HAVE_POD_TRUE@ nbdkit_parse_probability.3 \ @HAVE_POD_TRUE@ nbdkit_parse_size.3 \ @HAVE_POD_TRUE@ nbdkit_peer_name.3 \ @HAVE_POD_TRUE@ nbdkit_peer_tls_dn.3 \ @HAVE_POD_TRUE@ nbdkit-plugin.3 \ @HAVE_POD_TRUE@ nbdkit-probing.1 \ @HAVE_POD_TRUE@ nbdkit-protocol.1 \ @HAVE_POD_TRUE@ nbdkit_read_password.3 \ @HAVE_POD_TRUE@ nbdkit_realpath.3 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.4.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.6.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.8.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.10.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.12.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.14.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.16.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.18.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.20.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.22.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.24.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.26.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.28.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.30.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.32.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.34.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.36.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.38.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.40.1 \ @HAVE_POD_TRUE@ nbdkit-release-notes-1.42.1 \ @HAVE_POD_TRUE@ nbdkit-security.1 \ @HAVE_POD_TRUE@ nbdkit-service.1 \ @HAVE_POD_TRUE@ nbdkit_shutdown.3 \ @HAVE_POD_TRUE@ nbdkit_stdio_safe.3 \ @HAVE_POD_TRUE@ nbdkit_strdup_intern.3 \ @HAVE_POD_TRUE@ nbdkit-tls.1 \ @HAVE_POD_TRUE@ $(NULL) @HAVE_POD_TRUE@man_MANS = \ @HAVE_POD_TRUE@ $(generated_mans) \ @HAVE_POD_TRUE@ $(non_generated_mans) \ @HAVE_POD_TRUE@ $(NULL) DISTCLEANFILES = plugin-links.pod lang-plugin-links.pod filter-links.pod all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man3 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man3 .PRECIOUS: Makefile @HAVE_POD_TRUE@nbdkit.1: nbdkit.pod plugin-links.pod lang-plugin-links.pod filter-links.pod \ @HAVE_POD_TRUE@ synopsis.txt $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ --insert plugin-links.pod:__PLUGIN_LINKS__ \ @HAVE_POD_TRUE@ --insert lang-plugin-links.pod:__LANG_PLUGIN_LINKS__ \ @HAVE_POD_TRUE@ --insert filter-links.pod:__FILTER_LINKS__ \ @HAVE_POD_TRUE@ --verbatim $(srcdir)/synopsis.txt:__SYNOPSIS__ \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-captive.1: nbdkit-captive.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-client.1: nbdkit-client.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_debug.3: nbdkit_debug.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_error.3: nbdkit_error.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_export_name.3: nbdkit_export_name.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-filter.3: nbdkit-filter.pod filter-links.pod \ @HAVE_POD_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ --insert filter-links.pod:__FILTER_LINKS__ \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_is_tls.3: nbdkit_is_tls.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-loop.1: nbdkit-loop.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_nanosleep.3: nbdkit_nanosleep.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_parse_bool.3: nbdkit_parse_bool.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_parse_delay.3: nbdkit_parse_delay.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_parse_int.3: nbdkit_parse_int.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_parse_probability.3: nbdkit_parse_probability.pod \ @HAVE_POD_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_parse_size.3: nbdkit_parse_size.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_peer_name.3: nbdkit_peer_name.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_peer_tls_dn.3: nbdkit_peer_tls_dn.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-plugin.3: nbdkit-plugin.pod plugin-links.pod lang-plugin-links.pod \ @HAVE_POD_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ --insert plugin-links.pod:__PLUGIN_LINKS__ \ @HAVE_POD_TRUE@ --insert lang-plugin-links.pod:__LANG_PLUGIN_LINKS__ \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-probing.1: nbdkit-probing.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-protocol.1: nbdkit-protocol.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_read_password.3: nbdkit_read_password.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_realpath.3: nbdkit_realpath.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-release-notes-%.1: nbdkit-release-notes-%.pod \ @HAVE_POD_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-security.1: nbdkit-security.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-service.1: nbdkit-service.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_shutdown.3: nbdkit_shutdown.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_stdio_safe.3: nbdkit_stdio_safe.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit_strdup_intern.3: nbdkit_strdup_intern.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< @HAVE_POD_TRUE@nbdkit-tls.1: nbdkit-tls.pod $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@ $< # All plugins. plugin-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh plugin 1 $(non_lang_plugins) > $@-t echo \; >> $@-t $(srcdir)/make-links.sh plugin 3 $(lang_plugins) >> $@-t mv $@-t $@ # Only language plugins (in section 3). lang-plugin-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh plugin 3 $(lang_plugins) >> $@-t mv $@-t $@ # All filters. filter-links.pod: $(top_srcdir)/configure.ac rm -f $@ $@-t $(srcdir)/make-links.sh filter 1 $(filters) > $@-t mv $@-t $@ # 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: nbdkit-1.42.2/docs/make-links.sh0000755000175000017500000000346114534316443012071 #!/usr/bin/env bash # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # Turn a list of plugins or filters into a comma-separated # list of POD links. # eg: # ./make-links.sh plugin 1 foo bar # --> L, L type="$1" section="$2" shift 2 for (( i = 1; i <= $#; ++i )); do printf %s "L" if [ "$i" -lt "$#" ]; then printf %s , ; fi echo done nbdkit-1.42.2/docs/nbdkit.pod0000644000175000017500000005632114771245300011455 =head1 NAME nbdkit - toolkit for creating Network Block Device (NBD) servers =head1 SYNOPSIS __SYNOPSIS__ =head1 DESCRIPTION Network Block Device (NBD) is a network protocol for accessing block devices over the network. Block devices are hard disks and things that behave like hard disks such as disk images and virtual machines. nbdkit is both a toolkit for creating NBD servers from “unconventional†sources, and the name of an NBD server. nbdkit ships with many plugins for performing common tasks like serving local files. =head2 Plugins and filters nbdkit is different from other NBD servers because you can easily create new Network Block Device sources by writing a few glue functions, possibly in C, or perhaps in a high level language like Perl or Python. The liberal licensing of nbdkit is meant to allow you to link nbdkit with proprietary libraries or to include nbdkit in proprietary code. If you want to write your own nbdkit plugin you should read L. nbdkit also has a concept of filters which can be layered on top of plugins. Several filters are provided with nbdkit and if you want to write your own you should read L. =head1 EXAMPLES =head2 Basic file serving =over 4 =item * Serve file F on port 10809 using L, and connect to it using L: nbdkit file disk.img guestfish --rw --format=raw -a nbd://localhost =item * Serve file F on port 10809, requiring clients to use encrypted (TLS) connections: nbdkit --tls=require file disk.img =back =head2 Other nbdkit plugins =over 4 =item * Create a small disk containing test patterns using L: nbdkit data ' ( 0x55 0xAA )*2048 ' =item * Forward an NBD connection to a remote server over HTTPS or SSH using L or L: nbdkit -r curl https://example.com/disk.img =for paragraph nbdkit ssh host=example.com /var/tmp/disk.img =item * Create a sparse 1 terabyte RAM disk using L and use it as a loop device (L): nbdkit memory 1T nbd-client localhost /dev/nbd0 =item * Create a floppy disk image containing files from a local directory using L: nbdkit floppy dir/ =back =head2 Combining plugins and filters =over 4 =item * Serve only the first partition from compressed disk image F, combining L, L and L. nbdkit --filter=partition --filter=xz file disk.img.xz partition=1 To understand this command line: plugin name and plugin parameter │ ┌───────┴──────┠│ │ nbdkit --filter=partition --filter=xz file disk.img.xz partition=1 │ │ │ └──────────────┴────┬─────────────────────┘ │ filters and filter parameter =item * Create a scratch, empty nbdkit device and inject errors and delays, for testing clients, using L, L and L: nbdkit --filter=error --filter=delay memory 100M \ error-rate=10% rdelay=1 wdelay=1 =back =head2 Writing plugins in shell script =over 4 =item * Write a simple, custom plugin in shell script using L: nbdkit sh - <<'EOF' case "$1" in get_size) echo 1M ;; pread) dd if=/dev/zero count=$3 iflag=count_bytes ;; *) exit 2 ;; esac EOF =item * The same example as above can be written entirely on the command line using L: nbdkit eval get_size='echo 1M' \ pread='dd if=/dev/zero count=$3 iflag=count_bytes' =back =head2 Display information Display information about nbdkit or a specific plugin: nbdkit --help nbdkit --version nbdkit --dump-config nbdkit example1 --help nbdkit example1 --dump-plugin =head2 NBD URIs and endpoints NBD has a way to specify the L of an NBD endpoint to make it easy to interconnect NBD tools. Use the nbdkit I<--print-uri> option to print the URI of this server instance. For example: $ nbdkit -U /tmp/socket --print-uri null nbd+unix://?socket=/tmp/socket Shell-quoted URI: "nbd+unix://?socket=/tmp/socket" Command to query the NBD endpoint: nbdinfo "nbd+unix://?socket=/tmp/socket" =head1 GLOBAL OPTIONS =over 4 =item B<--help> Display brief command line usage information and exit. =item B<-4> =item B<--ipv4-only> =item B<-6> =item B<--ipv6-only> When a non-numeric argument is passed to the I<-i> option (such as a Fully Qualified Domain Name, or a host name from C), restrict the name resolution to IPv4 or IPv6 addresses. When the I<-i> option is omitted, listen on only the IPv4 or IPv6 address of all interfaces (C<0.0.0.0> or C<::>, respectively). When both I<-4> and I<-6> options are present on the command line, the last one takes effect. =item B<-D> PLUGIN.FLAG=N =item B<-D> FILTER.FLAG=N =item B<--debug> PLUGIN.FLAG=N =item B<--debug> FILTER.FLAG=N Set the plugin or filter Debug Flag called C to the integer value C. See L. =item B<-D> nbdkit.FLAG=N =item B<--debug> nbdkit.FLAG=N (nbdkit E 1.18) Set the nbdkit server Debug Flag called C to the integer value C. See L below. =item B<--dump-config> Dump out the compile-time configuration values and exit. See L. =item B<--dump-plugin> Dump out information about the plugin and exit. See L. =item B<--exit-with-parent> If the parent process exits, we exit. This can be used to avoid complicated cleanup or orphaned nbdkit processes. There are some important caveats with this, see L. An alternative to this is L. This option implies I<--foreground>. =item B<-e> EXPORTNAME =item B<--export=>EXPORTNAME =item B<--export-name=>EXPORTNAME =item B<--exportname=>EXPORTNAME Set a preferred exportname to expose in the shell environment created during I<--run>. The use of this option without I<--run> has no effect. This option does I change what nbdkit advertises as a server, but can aid in writing a captive client that wants to access particular content from a plugin that differentiates content based on the client's choice of export name. If not set, the I<--run> environment is set to access the default exportname C<""> (empty string). =item B<--filter=>FILTER Add a filter before the plugin. This option may be given one or more times to stack filters in front of the plugin. They are processed in the order they appear on the command line. See L and L. =item B<-f> =item B<--foreground> =item B<--no-fork> I fork into the background. =item B<-g> GROUP =item B<--group=>GROUP Change group to C after starting up. A group name or numeric group ID can be used. The server needs sufficient permissions to be able to do this. Normally this would mean starting the server up as root. See also I<-u>. =item B<-i> IPADDR =item B<--ip-addr=>IPADDR =item B<--ipaddr=>IPADDR Listen on the specified interface. The default is to listen on all interfaces. See also I<-4>, I<-6>, and I<-p>. =item B<--keep-alive> =item B<--keepalive> Enable TCP keepalive (C) on TCP sockets. This can allow clients that reboot to be detected earlier. You may also have to adjust kernel parameters. For Linux see: L Only has an effect if nbdkit uses a TCP socket (so not for I<-U>, I<-s>, etc.) =item B<--log=stderr> =item B<--log=syslog> =item B<--log=null> Send error messages to standard error (I<--log=stderr>), or to the system log (I<--log=syslog>), or discard them completely (I<--log=null>, not recommended for normal use). The default is to send error messages to stderr, unless nbdkit forks into the background in which case they are sent to syslog. These messages can be generated from plugins by calling L or L. Debug messages (I<-v>/I<--verbose>) always go to standard error and are never sent to the system log. =item B<--mask-handshake=>MASK This option can be used to mask off particular global features which are advertised during new-style handshake (defaulting to all supported bits set). See L. =item B<-n> =item B<--new-style> =item B<--newstyle> Use the newstyle NBD protocol. This is the default in nbdkit E 1.3. In earlier versions the default was oldstyle. See L. =item B<--no-mc> =item B<--no-meta-contexts> Do not advertise meta contexts. Normally, nbdkit handles all client requests for arbitrary meta context names, with the response being affirmative for only the C meta context (nbdkit synthesizes this context even when the plugin does not support extents), so that clients can use the block status command. However, meta contexts are not a mandatory part of the newstyle NBD protocol, so this option can be used to debug client fallbacks for dealing with older servers that lack meta context support. See L. =item B<--no-sr> =item B<--no-structured-replies> Do not advertise structured replies. A client must request structured replies to take advantage of block status and potential sparse reads; however, as structured reads are not a mandatory part of the newstyle NBD protocol, this option can be used to debug client fallbacks for dealing with older servers. See L. =item B<-o> =item B<--old-style> =item B<--oldstyle> Use the oldstyle NBD protocol. This I the default in nbdkit E 1.2, but now the default is newstyle. Note this is incompatible with newer features such as export names and TLS. See L. =item B<-P> PIDFILE =item B<--pid-file=>PIDFILE =item B<--pidfile=>PIDFILE Write C (containing the process ID of the server) after nbdkit becomes ready to accept connections. If the file already exists, it is overwritten. nbdkit I delete the file when it exits. =item B<-p> PORT =item B<--port=>PORT Change the TCP/IP port number on which nbdkit serves requests. The default is C<10809>. See also I<-i>. =item B<--print-uri> Print the URI. See L above. =item B<-r> =item B<--read-only> =item B<--readonly> The export will be read-only. If a client writes, then it will get an error. Note that some plugins inherently don't support writes. With those plugins the I<-r> option is added implicitly. L can be placed over read-only plugins to provide copy-on-write (or "snapshot") functionality. If you are using qemu as a client then it also supports snapshots. L or L can selectively add write-protection. =item B<--run> 'COMMAND ARGS ...' Run nbdkit as a captive subprocess of the command. When the command exits, nbdkit is killed. See L. Note that the command is executed by F. On some platforms like Debian this might not be a full-featured shell. This option implies I<--foreground>. In nbdkit E 1.34 you normally had to add I<-U ->, otherwise nbdkit would use a TCP/IP port which was not what you wanted. In nbdkit E 1.36, using I<--run> implies I<-U ->. If you want the old behaviour of nbdkit then you must use the I<--port> option explicitly. =item B<--selinux-label=>SOCKET-LABEL Apply the SELinux label C to the nbdkit listening socket. The common — perhaps only — use of this option is to allow libvirt guests which are using SELinux and sVirt confinement to access nbdkit Unix domain sockets. The example below shows how to do this. Note that the socket and filesystem labels are different. nbdkit -U /tmp/sock --selinux-label=system_u:object_r:svirt_socket_t:s0 ... chcon system_u:object_r:svirt_image_t:s0 /tmp/sock =item B<-s> =item B<--single> =item B<--stdin> Don't fork. Handle a single NBD connection on stdin/stdout. After stdin closes, the server exits. You can use this option to run nbdkit from inetd or similar superservers; or just for testing; or if you want to run nbdkit in a non-conventional way. Note that if you want to run nbdkit from systemd, then it may be better to use L instead of this option. This option implies I<--foreground>. =item B<--swap> (nbdkit E 1.18) Specifies that the NBD device will be used as swap space loop mounted on the same machine which is running nbdkit. To avoid deadlocks this locks the whole nbdkit process into memory using L. This may require additional permissions, such as starting the server as root or raising the C (L I<-l>) limit on the process. =item B<-t> THREADS =item B<--threads=>THREADS Set the number of threads to be used per connection, which in turn controls the number of outstanding requests that can be processed at once. Only matters for plugins with thread_model=parallel (where it defaults to 16). To force serialized behavior (useful if the client is not prepared for out-of-order responses), set this to 1. =item B<--timeout=>TIMEOUT (nbdkit E 1.42, not Windows) If the client does not negotiate a full NBD session within C seconds, then drop the connection. This can be used as an additional security measure to ensure that clients don't consume resources by opening lots of connections and then not negotiating (or negotiating slowly) the full NBD session. It is particularly useful in conjunction with TLS client authentication (see L). The timeout is measured from the point of the initial TCP connection to the point where NBD session negotiation ends (including TLS, if used). If the timeout is exceeded during this negotiation, the connection is dropped. Setting this too low will cause problems for clients listing lots of exports. The default is I. C can be any format supported by L. =item B<--tls=off> =item B<--tls=on> =item B<--tls=require> Disable, enable or require TLS (authentication and encryption support). See L. =item B<--tls-certificates=>/path/to/certificates Set the path to the TLS certificates directory. If not specified, some built-in paths are checked. See L for more details. =item B<--tls-psk=>/path/to/pskfile Set the path to the pre-shared keys (PSK) file. If used, this overrides certificate authentication. There is no built-in path. See L for more details. =item B<--tls-verify-peer> Enables TLS client certificate verification. The default is I to check the client's certificate. =item B<-U> SOCKET =item B<--unix=>SOCKET =item B<-U -> =item B<--unix -> Accept connections on the Unix domain socket C (which is a path). nbdkit creates this socket, but it will probably have incorrect permissions (too permissive). If it is a problem that some unauthorized user could connect to this socket between the time that nbdkit starts up and the authorized user connects, then put the socket into a directory that has restrictive permissions. nbdkit does B delete the socket file when it exits. The caller should delete the socket file after use (else if you try to start nbdkit up again you will get an C
error). If the socket name is I<-> then nbdkit generates a randomly named private socket. This is implied by the I<--run> option. See also L. =item B<-u> USER =item B<--user=>USER Change user to C after starting up. A user name or numeric user ID can be used. The server needs sufficient permissions to be able to do this. Normally this would mean starting the server up as root. See also I<-g>. =item B<-v> =item B<--verbose> Enable verbose messages. It's a good idea to use I<-f> as well so the process does not fork into the background. The messages are sent to stderr. Note they are I affected by the I<--log> option (which is only for error messages). These messages can be generated from plugins by calling L or L. =item B<-V> =item B<--version> Print the version number of nbdkit and exit. The I<--dump-config> option provides separate major and minor numbers and may be easier to parse from shell scripts. =item B<--vsock> (nbdkit E 1.16) Use the AF_VSOCK protocol (instead of TCP/IP). You must use this in conjunction with I<-p>/I<--port>. See L. =back =head1 PLUGIN NAME You can give the full path to the plugin, like this: nbdkit $libdir/nbdkit/plugins/nbdkit-file-plugin.so [...] but it is usually more convenient to use this equivalent syntax: nbdkit file [...] C<$libdir> is set at compile time. To print it out, do: nbdkit --dump-config =head1 PLUGIN CONFIGURATION After specifying the plugin name you can (optionally, it depends on the plugin) give plugin configuration on the command line in the form of C. For example: nbdkit file file=disk.img To list all the options supported by a plugin, do: nbdkit --help file To dump information about a plugin, do: nbdkit file --dump-plugin =head2 Magic parameters Some plugins declare a special "magic config key". This is a key which is assumed if no C part is present. For example: nbdkit file disk.img is assumed to be C because the file plugin declares C as its magic config key. There can be ambiguity in the parsing of magic config keys if the value might look like a C. If there could be ambiguity then modify the value, eg. by prefixing it with C<./> There is also a special exception for plugins which do not declare a magic config key, but where the first plugin argument does not contain an C<'='> character: it is assumed to be C. This is used by scripting language plugins: nbdkit perl foo.pl [args...] has the same meaning as: nbdkit perl script=foo.pl [args...] =head2 Shebang scripts You can use C<#!> to run nbdkit plugins written in most scripting languages. The file should be executable. For example: #!/usr/sbin/nbdkit perl sub open { # etc } (see L for a full example). =head1 SERVER DEBUG FLAGS As well as enabling or disabling debugging in the server using I<--verbose> you can control extra debugging in the server using the S> flags listed in this section. Note these flags are an internal implementation detail of the server and may be changed or removed at any time in the future. =over 4 =item B<-D nbdkit.backend.controlpath=0> =item B<-D nbdkit.backend.controlpath=1> =item B<-D nbdkit.backend.datapath=0> =item B<-D nbdkit.backend.datapath=1> These flags control the verbosity of nbdkit backend debugging messages (the ones which show every request processed by the server). The default for both settings is C<1> (normal debugging) but you can set them to C<0> to suppress these messages. S> is the more useful setting which lets you suppress messages about pread, pwrite, zero, trim, etc. commands. When transferring large amounts of data these messages are numerous and not usually very interesting. S> suppresses the non-datapath commands (config, open, close, can_write, etc.) =item B<-D nbdkit.environ=1> Print nbdkit's environment variables in the debug output at start up. This is insecure because environment variables may contain both sensitive and user-controlled information, so it should not be used routinely. But it is useful for tracking down problems related to environment variables. =item B<-D nbdkit.tls.log=>N Enable TLS logging. C can be in the range 0 (no logging) to 99. See L. =item B<-D nbdkit.tls.session=1> Print additional information about the TLS session, such as the type of authentication and encryption, and client certificate information. =back =head1 SIGNALS nbdkit responds to the following signals: =over 4 =item C =item C =item C The server exits cleanly. =item C This signal is ignored. =back =head1 ENVIRONMENT VARIABLES =over 4 =item C =item C If present in the environment when nbdkit starts up, these trigger L. =back =head1 SEE ALSO =head2 Other topics L — Run nbdkit under another process and have it reliably cleaned up. L — How to mount NBD filesystems on a client machine. L — Use nbdkit with the Linux kernel client to create loop devices and loop mounts. L — How to probe for nbdkit configuration and plugins. L — Which parts of the NBD protocol nbdkit supports. L — Lists past security issues in nbdkit. L — Running nbdkit as a service, and systemd socket activation. L — Authentication and encryption of NBD connections (sometimes incorrectly called "SSL"). =head2 Plugins __PLUGIN_LINKS__. =head2 Filters __FILTER_LINKS__. =head2 For developers L, L. =head2 Writing plugins in other programming languages __LANG_PLUGIN_LINKS__. =head2 Release notes for previous releases of nbdkit L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L. =head2 NBD clients L, L, L, L, L, L, L, L. =head2 nbdkit links L — Source code. =head2 Other NBD servers L, L, L, L. =head2 Documentation for the NBD protocol L, L, L. =head2 Similar protocols L, L, L. =head2 Other manual pages of interest L, L, L, L. =head1 AUTHORS Eric Blake Laszlo Ersek Richard W.M. Jones Yann E. MORIN Nikolaus Rath François Revol Nir Soffer Alan Somers Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-captive.pod0000644000175000017500000001414214623341243013100 =head1 NAME nbdkit-captive - run nbdkit under another process and have it reliably cleaned up =head1 SYNOPSIS nbdkit PLUGIN [...] [-e|--exportname EXPORTNAME] \ --run 'COMMAND ARGS ...' =for paragraph nbdkit --exit-with-parent PLUGIN [...] =head1 DESCRIPTION You can run nbdkit under another process and have nbdkit reliably clean up. There are two techniques depending on whether you want nbdkit to start the other process (L), or if you want the other process to start nbdkit (L). Another way is to have nbdkit exit after the last client connection (L) or after an event (L). =head1 CAPTIVE NBDKIT You can run nbdkit as a "captive process", using the I<--run> option. This means that nbdkit runs as long as (for example) L or L is running. When those exit, nbdkit is killed. Some examples should make this clear. To run nbdkit captive under qemu: nbdkit file disk.img --run 'qemu -drive file="$uri",if=virtio' On the qemu command line, C<$uri> is substituted automatically with the right NBD path so it can connect to nbdkit. When qemu exits, nbdkit is killed and cleaned up automatically. Running nbdkit captive under guestfish: nbdkit file disk.img --run 'guestfish --format=raw -a "$uri" -i' When guestfish exits, nbdkit is killed. Running nbdkit captive under nbdsh for unit testing: nbdkit memory 1 --run 'nbdsh -u "$uri" -c "print(h.pread(1, 0))"' Running an fio benchmark: nbdkit -f null 1G --run 'export uri; fio fio.git/examples/nbd.fio' The following shell variables are available in the I<--run> argument (local to the run script unless you use C): =over 4 =item C<$uri> =item C<$nbd> A URI that refers to the nbdkit port or socket in the preferred form documented by the NBD project. As this variable may contain a bare C for Unix sockets, it is safest to use $uri within double quotes to avoid unintentional globbing. For plugins that support distinct data based on export names, the I<-e> option to nbdkit controls which export name will be set in the URI. In nbdkit E 1.22 C<$nbd> tried to guess if you were using qemu or guestfish and expanded differently. Since NBD URIs are now widely supported this magic is no longer necessary. In nbdkit E 1.24 both variables expand to the same URI. See also L. =item C<$port> If E "", the port number that nbdkit is listening on. =item C<$unixsocket> If E "", the Unix domain socket that nbdkit is listening on. =item C<$exportname> The export name (which may be "") that the process should use when connecting to nbdkit, as set by the I<-e> (I<--exportname>) command line option of nbdkit. This only matters to plugins that differentiate what they serve based on the export name requested by the client. =item C<$tls> Corresponds to the I<--tls> option passed to nbdkit. If I<--tls=off> this is not set. If I<--tls=on> this is set to C<"1">. If I<--tls=require> this is set to C<"2">. =item C<$tls_certificates> If I<--tls-certificates> was passed to nbdkit, the value is copied here. It is usually the directory containing PKI certificates. Note that the path might not be an absolute path, or even valid. =item C<$tls_psk> If I<--tls-psk> was passed to nbdkit, the value is copied here. It is usually the filename of a TLS Pre-Shared Keys (PSK) file. Note that the filename might not be an absolute path, or even valid. =back I<--run> implies I<--foreground>. It is not possible, and probably not desirable, to have nbdkit fork into the background when using I<--run>. =head2 Copying data in and out of plugins with captive nbdkit Captive nbdkit + L can be used to copy data into and out of nbdkit plugins. For example L contains an embedded disk image. To copy it out: nbdkit example1 --run 'qemu-img convert "$uri" disk.img' If the source suffers from temporary network failures L or L may help. To overwrite a file inside an uncompressed tar file (the file being overwritten must be the same size), use L like this: nbdkit file data.tar --filter=tar tar-entry=disk.img \ --run 'qemu-img convert -n disk.img "$uri"' =head1 EXIT WITH PARENT The I<--exit-with-parent> option is almost the opposite of L described in the previous section. Running nbdkit with this option, for example from a script: nbdkit --exit-with-parent plugin ... & means that nbdkit will exit automatically if the parent program exits for any reason. This can be used to avoid complicated cleanups or orphaned nbdkit processes. I<--exit-with-parent> is incompatible with forking into the background (because when we fork into the background we lose track of the parent process). Therefore I<-f> / I<--foreground> is implied. If the parent application is multithreaded, then (in the Linux implementation) if the parent I exits, that will cause nbdkit to exit. Thus in multithreaded applications you usually want to run C only from the main thread (unless you actually want nbdkit to exit with the thread, but that may not work reliably on all operating systems). To exit when an unrelated process exits, use L C feature. =head2 Support for --exit-with-parent This is currently implemented using a non-POSIX feature available in S, S and macOS. It won't work on other operating systems (patches welcome to make it work). To test if the current binary supports this feature the most backwards compatible way is: nbdkit --exit-with-parent --version && echo "supported" In nbdkit E 1.34, S> prints either C or C but earlier versions did not have this. =head1 SEE ALSO L, L, L, L (on Linux), L (on FreeBSD). =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-client.pod0000644000175000017500000000444614534316443012736 =head1 NAME nbdkit-client - how to mount NBD filesystems on a client machine =head1 DESCRIPTION For NBD exports that contain filesystems there are several approaches to mounting them on a client machine. To ensure the nbd kernel module is loaded you may need to do: # echo nbd > /etc/modules-load.d/nbd.conf This will not take effect until you reboot, so also do: # modprobe nbd =head2 Easy mounting at boot time For simple setups the following method is the easiest way to get an NBD filesystem to mount at boot. Create or edit F or F: #!/bin/sh - nm-online modprobe nbd nbd-client server /dev/nbd0 mount /dev/nbd0 /mnt =head2 Mounting using systemd mount points You can use systemd mount points to mount NBD filesystems at boot and/or on demand. Set up an L mapping. If F doesn't exist, then create it first. Add this line: nbd0 server / bs=512,persist As a workaround for L you must currently modify the F file: # cp /usr/lib/systemd/system/nbd@.service /etc/systemd/system/ # vi /etc/systemd/system/nbd@.service and edit or create these settings in the C<[Service]> section: [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/sbin/nbd-client %i ExecStop=/usr/sbin/nbd-client -d /dev/%i Finally create a systemd mount file called F: [Unit] Requires=nbd@nbd0.service [Mount] What=/dev/nbd0 Where=/mnt Type=ext4 You can either reboot now or do: # systemctl start mnt.mount Other systemd services which need this mount point can depend on this mount unit. =head1 LIMITATIONS Red Hat Enterprise Linux 8 enabled the C Linux kernel module but only for Unix domain sockets (ie. local connections). This means you cannot connect to an NBD server over a TCP network. This also affects Linux distributions derived from RHEL like CentOS, Alma and others. This does not affect use of nbdkit as an NBD server, only the Linux kernel as an NBD client. Userspace Linux clients such as L tools will work. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_debug.pod0000644000175000017500000000257114771235500012622 =head1 NAME nbdkit_debug, nbdkit_vdebug - print debugging messages for nbdkit =head1 SYNOPSIS #include void nbdkit_debug (const char *fs, ...); void nbdkit_vdebug (const char *fs, va_list args); =head1 DESCRIPTION Use C or C to print debug messages from your plugin or filter. These functions send the debug message to stderr. Debug messages are only emitted when the server is in verbose mode (nbdkit I<-v> option) C works like L. C works like L. For convenience both these functions preserve the value of C, and also support the glibc extension of a single C<%m> in a format string expanding to C, even on platforms that don't support that natively. =head1 LANGUAGE BINDINGS In L: import "libguestfs.org/nbdkit" nbdkit.Debug(msg) In L: NBDKit.debug : ('a, unit, string, unit) format4 -> 'a In L: Nbdkit::debug ($msg); In L: import nbdkit nbdkit.debug(str) In L: use nbdkit::*; debug!(fs, ...); =head1 HISTORY C was present in nbdkit 0.1.0. =head1 SEE ALSO L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_error.pod0000644000175000017500000000477714771235500012677 =head1 NAME nbdkit_error, nbdkit_verror, nbdkit_set_error - return an error from nbdkit plugins =head1 SYNOPSIS #include void nbdkit_error (const char *fs, ...); void nbdkit_verror (const char *fs, va_list args); void nbdkit_set_error (int err); =head1 DESCRIPTION If there is an error in your plugin, the plugin should call C to report an error message. Then the callback should return the appropriate error indication, eg. C or C<-1>. C works like L. C works like L. For convenience, C preserves the value of C, and also supports the glibc extension of a single C<%m> in a format string expanding to C, even on platforms that don't support that natively. =head2 Example int my_pread (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { char *bounce_buffer = malloc (SECTOR_SIZE); if (bounce_buffer == NULL) { nbdkit_error ("malloc: %m"); return -1; } //... } =head2 Setting errno For callbacks which serve data to the client, the plugin may call C to influence the errno that will be sent back to the client. If the call to C is omitted while serving data, then the global variable C may be used. For plugins which have C<.errno_is_preserved != 0> the server will use C. In plugins written in non-C languages, we usually cannot trust that C will be preserved when returning from that language to C. In that case, either the plugin must call C or hard-coded C is used. =head2 Interaction with I<--log> option The nbdkit I<--log> option controls where error messages are sent. The default is to send error messages to stderr, unless nbdkit forks into the background in which case they are sent to syslog. For more information read the description in L. =head1 LANGUAGE BINDINGS Most language bindings do not expose these functions explicitly. Instead you are expected to throw an exception on error which is implicitly turned into a call to C. Read the documentation for the language binding to find out how errors are handled. =head1 HISTORY C and C were present in nbdkit 0.1.0. C was added in nbdkit 1.2. =head1 SEE ALSO L, L, L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_export_name.pod0000644000175000017500000000312514623341243014047 =head1 NAME nbdkit_export_name - get the NBD export name for nbdkit =head1 SYNOPSIS #include const char *nbdkit_export_name (void); =head1 DESCRIPTION Return the optional NBD export name if one was negotiated with the current client (this uses thread-local magic so no parameter is required). The export name is a free-form text string, it is not necessarily a path or filename and it does not need to begin with a C<'/'> character. The NBD protocol describes the empty string (C<"">) as a representing a "default export" or to be used in cases where the export name does not make sense. B =head1 RETURN VALUE The function returns a string. The returned string is valid at least through the C<.close> of the current connection, but if you need to store it in the plugin for use by more than one client you must copy it. If there is an error it calls L and returns C. =head1 LANGUAGE BINDINGS In L: NBDKit.export_name : unit -> string In L: import nbdkit name = nbdkit.export_name() In L: use nbdkit::*; pub fn export_name() -> std::result::Result> In L the export name is available as parameter C<$3> of the C method. =head1 HISTORY C was added in nbdkit 1.16. =head1 SEE ALSO L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-filter.pod0000644000175000017500000013177214623341243012743 =head1 NAME nbdkit-filter - how to write nbdkit filters =head1 SYNOPSIS #include static int myfilter_config (nbdkit_next_config *next, void *nxdata, const char *key, const char *value) { if (strcmp (key, "myparameter") == 0) { // ... return 0; } else { // pass through to next filter or plugin return next (nxdata, key, value); } } static struct nbdkit_filter filter = { .name = "filter", .config = myfilter_config, /* etc */ }; NBDKIT_REGISTER_FILTER(filter) When this has been compiled to a shared library, do: nbdkit [--args ...] --filter=./myfilter.so plugin [key=value ...] When debugging, use the I<-fv> options: nbdkit -fv --filter=./myfilter.so plugin [key=value ...] =head1 DESCRIPTION One or more nbdkit filters can be placed in front of an nbdkit plugin to modify the behaviour of the plugin. This manual page describes how to create an nbdkit filter. Filters can be used for example to limit requests to an offset/limit, add copy-on-write support, or inject delays or errors (for testing). Different filters can be stacked: NBD ┌─────────┠┌─────────┠┌────────┠client ───▶│ filter1 │───▶│ filter2 │── ─ ─ ──▶│ plugin │ request └─────────┘ └─────────┘ └────────┘ Each filter intercepts plugin functions (see L) and can call the next filter or plugin in the chain, modifying parameters, calling before the filter function, in the middle or after. Filters may even short-cut the chain. As an example, to process its own parameters the filter can intercept the C<.config> method: static int myfilter_config (nbdkit_next_config *next, void *nxdata, const char *key, const char *value) { if (strcmp (key, "myparameter") == 0) { // ... // here you would handle this key, value // ... return 0; } else { // pass through to next filter or plugin return next (nxdata, key, value); } } static struct nbdkit_filter filter = { // ... .config = myfilter_config, // ... }; The call to C calls the C<.config> method of the next filter or plugin in the chain. In the example above any instances of C on the command line would not be seen by the plugin. To see example filters: L Filters must be written in C. Unlike plugins, where we provide a stable ABI guarantee that permits operation across version differences, filters can only be run with the same version of nbdkit that they were compiled with. The reason for this is two-fold: the filter API includes access to struct nbdkit_next_ops that is likely to change if new callbacks are added (old nbdkit cannot safely run new filters that access new methods); and if we added new methods then an old filter would not see them and so they would be passed unmodified through the filter, and in some cases that leads to data corruption (new nbdkit cannot safely run old filters unaware of new methods). Therefore, unlike plugins, you should not expect to distribute filters separately from nbdkit. =head1 C<#include Enbdkit-filter.hE> All filters should start by including this header file. =head1 C All filters must define and register one C, which contains the name of the filter and pointers to plugin methods that the filter wants to intercept. static struct nbdkit_filter filter = { .name = "filter", .longname = "My Filter", .description = "This is my great filter for nbdkit", .config = myfilter_config, /* etc */ }; NBDKIT_REGISTER_FILTER(filter) The C<.name> field is the name of the filter. This is the only field which is required. =head1 NEXT PLUGIN F defines some function types (C, C, C, C, C, C) and a structure called C. These abstract the next plugin or filter in the chain. There is also an opaque pointer C, C or C which must be passed along when calling these functions. The value of C is stable between C<.after_fork>, C<.preconnect>, C<.list_exports>, and C<.default_export>, and can also be obtained by using C on the C parameter to C<.open>. Meanwhile, if the filter does not use C, the value of C passed to C<.prepare> has a stable lifetime that lasts to the corresponding C<.finalize>, with all intermediate functions (such as C<.pread>) receiving the same value for convenience. Functions where C is not reused are C<.config>, C<.config_complete>, and C<.get_ready>, which are all called during initialization outside any connections. The value of C passed to C<.after_fork> also occurs without connections, but is shared with C<.preconnect>, C<.list_exports>, and C<.default_export>, and can also be obtained from the C passed to C<.open>, and has a lifetime that lasts to C<.cleanup> for use by C. In turn, the value of C passed to C<.open> has a lifetime that lasts until the matching C<.close> for use by C and C. =head2 Next config, open and close The filter’s C<.config>, C<.config_complete>, C<.get_ready>, C<.after_fork>, C<.preconnect>, C<.list_exports>, C<.default_export> and C<.open> methods may only call the next C<.config>, C<.config_complete>, C<.get_ready>, C<.after_fork>, C<.preconnect>, C<.list_exports>, C<.default_export> and C<.open> method in the chain (optionally for C<.config> and C<.open>). The filter’s C<.close> method is called when an old connection closed, and this has no C parameter because it cannot be short-circuited. =head2 C The filter generally needs to call into the underlying plugin, which is done via a pointer to C, also available as the typedef C. The most common behavior is to create a next context per connection by calling the C parameter during C<.open>, at which point the next context will be automatically provided to the filter’s other methods like C<.prepare>, C<.get_size>, C<.pread> etc. The C struct contains a comparable set of accessors to plugin methods that can be called during a connection. When using automatic registration, the C parameter is stable between C<.prepare> and C<.finalize>, and nbdkit automatically prepares, finalizes, and closes the next context at the right point in the filter connection lifecycle. Alternatively, the filter can manage plugin contexts manually, whether to multiplex multiple client connections through a single context into the plugin, or to open multiple plugin contexts to perform retries or otherwise service a single client connection more efficiently. In this mode of operation, the filter uses C to open a plugin context using the C parameter passed to C<.after_fork>, C<.preconnect>, C<.list_exports>, C<.default_export>, or obtained from using C on the C parameter to C<.open>. The resulting next context has a lifecycle under manual control, where the filter must use Cprepare (next)> before using any other function pointers within the next context, and must reclaim the memory using Cfinalize (next)> and C when done. A filter using manual lifecycle management may use C to associate the next context into the current connection, which lets nbdkit then pass that context as the C parameter to future connection-related functions like C<.pread> and take over lifecycle responsibility. =head3 C =head3 C =head3 C =head3 C nbdkit_backend *nbdkit_context_get_backend (nbdkit_context *context); Obtains the backend pointer from the C parameter to C<.open>, matching the backend pointer available to C<.after_fork>, C<.preconnect>, C<.list_exports>, and C<.default_export>. This backend pointer has a stable lifetime from the time of C<.after_fork> until C<.cleanup>. nbdkit_next *nbdkit_next_context_open (nbdkit_backend *backend, int readonly, const char *exportname, int shared); This function attempts to open a new context into the plugin in relation to the filter's current C. The C and C parameters behave the same as documented in C<.open>. The resulting context will be under the filter's manual lifecycle control unless the filter associates it into the connection with C. The filter should be careful to not violate any threading model restrictions of the plugin if it opens more than one context. If C is false, this function must be called while servicing an existing client connection, and the new context will share the same connection details (export name, tls status, and shorter interned string lifetimes) as the current connection, and thus should not be used after the client connection ends. Conversely, if C is true, this function may be called outside of a current client connection (such as during C<.after_fork>), and the resulting context may be freely shared among multiple client connections. In shared mode, it will not be possible for the plugin to differentiate content based on the client export name, the result of the plugin calling L will depend solely whether I<--tls=require> was on the command line, the lifetime of interned strings (via L and friends) lasts for the life of the filter, and the filter must take care to not expose potentially-secure information from the backend to an insecure client. void nbdkit_next_context_close (nbdkit_next *next); This function closes a context into the plugin. If the context has previously been prepared, it should first be finalized before using this function. This function does not need to be called for a plugin context that has been associated with the filter connection via C prior to the C<.close> callback. nbdkit_next *nbdkit_context_set_next (nbdkit_context *context, nbdkit_next *next); This function associates a plugin context with the filter's current connection context, given by the C parameter to C<.open>. Once associated, this plugin context will be given as the C parameter to all other connection-specific callbacks. If associated during C<.open>, nbdkit will take care of preparing the context prior to C<.prepare>; if still associated before C<.finalize>, nbdkit will take care of finalizing the context, and also for closing it. A filter may also pass C for C, to remove any association; if no plugin context is associated with the connection, then filter callbacks such as C<.pread> will receive C for their C parameter. This function returns the previous context that had been associated with the connection prior to switching the association to C; this result will be C if there was no previous association. The filter assumes manual responsibility for any remaining lifecycle functions that must be called on the returned context. =head2 Using C Regardless of whether the plugin context is managed automatically or manually, it is possible for a filter to issue (for example) extra Cpread> calls in response to a single C<.pwrite> call. The C parameter serves two purposes: it serves as the struct to access the pointers to all the plugin connection functions, and it serves as the opaque data that must be passed as the first parameter to those functions. For example, calling the plugin's can_flush functionality would be done via next->can_flush (next) Note that the semantics of the functions in C are slightly different from what a plugin implements: for example, when a plugin's C<.pread> returns -1 on error, the error value to advertise to the client is implicit (via the plugin calling L or setting C), whereas Cpread> exposes this via an explicit parameter, allowing a filter to learn or modify this error if desired. Use of Cprepare> and Cfinalize> is only needed when manually managing the plugin context lifetime. =head2 Other considerations You can modify parameters when you call the C function. However be careful when modifying strings because for some methods (eg. C<.config>) the plugin may save the string pointer that you pass along. So you may have to ensure that the string is not freed for the lifetime of the server; you may find L helpful for avoiding a memory leak while still obeying lifecycle constraints. Note that if your filter registers a callback but in that callback it doesn't call the C function then the corresponding method in the plugin will never be called. In particular, your C<.open> method, if you have one, B call the C method if you want the underlying plugin to be available to all further C use. =head1 CALLBACKS C has some static fields describing the filter and optional callback functions which can be used to intercept plugin methods. =head2 C<.name> const char *name; This field (a string) is required, and B contain only ASCII alphanumeric characters or non-leading dashes, and be unique amongst all filters. =head2 C<.longname> const char *longname; An optional free text name of the filter. This field is used in error messages. =head2 C<.description> const char *description; An optional multi-line description of the filter. =head2 C<.load> void load (void); This is called once just after the filter is loaded into memory. You can use this to perform any global initialization needed by the filter. =head2 C<.unload> void unload (void); This may be called once just before the filter is unloaded from memory. Note that it's not guaranteed that C<.unload> will always be called (eg. the server might be killed or segfault), so you should try to make the filter as robust as possible by not requiring cleanup. See also L. =head2 C<.config> int (*config) (nbdkit_next_config *next, void *nxdata, const char *key, const char *value); This intercepts the plugin C<.config> method and can be used by the filter to parse its own command line parameters. You should try to make sure that command line parameter keys that the filter uses do not conflict with ones that could be used by a plugin. If there is an error, C<.config> should call L with an error message and return C<-1>. =head2 C<.config_complete> int (*config_complete) (nbdkit_next_config_complete *next, void *nxdata); This intercepts the plugin C<.config_complete> method and can be used to ensure that all parameters needed by the filter were supplied on the command line. If there is an error, C<.config_complete> should call L with an error message and return C<-1>. =head2 C<.config_help> const char *config_help; This optional multi-line help message should summarize any C parameters that it takes. It does I need to repeat what already appears in C<.description>. If the filter doesn't take any config parameters you should probably omit this. =head2 C<.thread_model> int (*thread_model) (void); Filters may tighten (but not relax) the thread model of the plugin, by defining this callback. Note that while plugins use a compile-time definition of C, filters do not need to declare a model at compile time; instead, this callback is called after C<.config_complete> and before any connections are created. See L for a discussion of thread models. The final thread model used by nbdkit is the smallest (ie. most serialized) out of all the filters and the plugin, and applies for all connections. Requests for a model larger than permitted by the plugin are silently ignored. It is acceptable for decisions made during C<.config> and C<.config_complete> to determine which model to request. This callback is optional; if it is not present, the filter must be written to handle fully parallel requests, including when multiple requests are issued in parallel on the same connection, similar to a plugin requesting C. This ensures the filter doesn't slow down other filters or plugins. If there is an error, C<.thread_model> should call L with an error message and return C<-1>. =head2 C<.dump_plugin> void (*dump_plugin) (void); This optional callback is called when the S> command is used. It should print any additional informative C fields to stdout as needed. Prefixing the keys with the name of the filter will avoid conflicts. =head2 C<.get_ready> int (*get_ready) (int thread_model); This optional callback is reached if the plugin C<.get_ready> method succeeded (if the plugin failed, nbdkit has already exited), and can be used by the filter to get ready to serve requests. The C parameter informs the filter about the final thread model chosen by nbdkit after considering the results of C<.thread_model> of all filters in the chain after C<.config_complete>. If there is an error, C<.get_ready> should call L with an error message and return C<-1>. =head2 C<.after_fork> int (*after_fork) (nbdkit_backend *backend); This optional callback is reached after the plugin C<.after_fork> method has succeeded (if the plugin failed, nbdkit has already exited), and can be used by the filter to start background threads. The C parameter is valid until C<.cleanup>, for creating manual contexts into the backend with C. If there is an error, C<.after_fork> should call L with an error message and return C<-1>. =head2 C<.cleanup> int (cleanup) (nbdkit_backend *backend); This optional callback is reached once after all client connections have been closed, but before the underlying plugin C<.cleanup> or any C<.unload> callbacks. It can be used by the filter to gracefully close any background threads created during C<.after_fork>, as well as close any manual contexts into C previously opened with C. Note that it's not guaranteed that C<.cleanup> will always be called (eg. the server might be killed or segfault), so you should try to make the filter as robust as possible by not requiring cleanup. See also L. =head2 C<.preconnect> int (*preconnect) (nbdkit_next_preconnect *next, nbdkit_backend *nxdata, int readonly); This intercepts the plugin C<.preconnect> method and can be used to filter access to the server. If there is an error, C<.preconnect> should call L with an error message and return C<-1>. =head2 C<.list_exports> int (*list_exports) (nbdkit_next_list_exports *next, nbdkit_backend *nxdata, int readonly, int is_tls, struct nbdkit_exports *exports); This intercepts the plugin C<.list_exports> method and can be used to filter which exports are advertised. The C parameter matches what is passed to <.preconnect> and C<.open>, and may be changed by the filter when calling into the plugin. The C parameter informs the filter whether TLS negotiation has been completed by the client, but is not passed on to C because it cannot be altered. It is possible for filters to transform the exports list received back from the layer below. Without error checking it would look like this: myfilter_list_exports (...) { size_t i; struct nbdkit_exports *exports2; struct nbdkit_export e; char *name, *desc; exports2 = nbdkit_exports_new (); next_list_exports (nxdata, readonly, exports); for (i = 0; i < nbdkit_exports_count (exports2); ++i) { e = nbdkit_get_export (exports2, i); name = adjust (e.name); desc = adjust (e.desc); nbdkit_add_export (exports, name, desc); free (name); free (desc); } nbdkit_exports_free (exports2); } If there is an error, C<.list_exports> should call L with an error message and return C<-1>. =head3 Allocating and freeing nbdkit_exports list Two functions are provided to filters only for allocating and freeing the list: struct nbdkit_exports *nbdkit_exports_new (void); Allocates and returns a new, empty exports list. On error this function can return C. In this case it calls L as required. C will be set to a suitable value. void nbdkit_exports_free (struct nbdkit_exports *); Frees an existing exports list. =head3 Iterating over nbdkit_exports list Two functions are provided to filters only to iterate over the exports in order: size_t nbdkit_exports_count (const struct nbdkit_exports *); Returns the number of exports in the list. struct nbdkit_export { char *name; char *description; }; const struct nbdkit_export nbdkit_get_export (const struct nbdkit_exports *, size_t i); Returns a copy of the C'th export. =head2 C<.default_export> const char *default_export (nbdkit_next_default_export *next, nbdkit_backend *nxdata, int readonly, int is_tls) This intercepts the plugin C<.default_export> method and can be used to alter the canonical export name used in place of the default C<"">. The C parameter matches what is passed to <.preconnect> and C<.open>, and may be changed by the filter when calling into the plugin. The C parameter informs the filter whether TLS negotiation has been completed by the client, but is not passed on to C because it cannot be altered. =head2 C<.open> void * (*open) (nbdkit_next_open *next, nbdkit_context *context, int readonly, const char *exportname, int is_tls); This is called when a new client connection is opened and can be used to allocate any per-connection data structures needed by the filter. The handle (which is not the same as the plugin handle) is passed back to other filter callbacks and could be freed in the C<.close> callback. Note that the handle is completely opaque to nbdkit, but it must not be NULL. If you don't need to use a handle, return C which is a static non-NULL pointer. If there is an error, C<.open> should call L with an error message and return C. This callback is optional, but if provided, it should call C, passing C and C possibly modified according to how the filter plans to use the plugin (C is not passed, because a filter cannot modify it). Typically, the filter passes the same values as it received, or passes readonly=true to provide a writable layer on top of a read-only backend. However, it is also acceptable to attempt write access to the plugin even if this filter is readonly, such as when a file system mounted read-only still requires write access to the underlying device in case a journal needs to be replayed for consistency as part of the mounting process. The C string is only guaranteed to be available during the call (different than the lifetime for the return of L used by plugins). If the filter needs to use it (other than immediately passing it down to the next layer) it must take a copy, although L is useful for this task. The C and C parameters are provided so that filters do not need to use the plugin-only interfaces of L and L. The filter should generally call C as its first step, to allocate from the plugin outwards, so that C<.close> running from the outer filter to the plugin will be in reverse. Skipping a call to C is acceptable if the filter will not access C during any of the remaining callbacks reached on the same connection. The C function is provided for convenience; the same functionality can be obtained manually (other than error checking) by using the following: nbdkit_context_set_next (context, nbdkit_next_context_open (nbdkit_context_get_backend (context), readonly, exportname, false)); The value of C in this call has a lifetime that lasts until the counterpart C<.close>, and it is this value that may be passed to C to obtain the C parameter used to open a plugin context with C, as well as the C parameter used to associate a plugin context into the current connection with C. =head2 C<.close> void (*close) (void *handle); This is called when the client closes the connection. It should clean up any per-connection resources used by the filter. It is called beginning with the outermost filter and ending with the plugin (the opposite order of C<.open> if all filters call C first), although this order technically does not matter since the callback cannot report failures or access the underlying plugin. =head2 C<.prepare> =head2 C<.finalize> int (*prepare) (nbdkit_next *next, void *handle, int readonly); int (*finalize) (nbdkit_next *next, void *handle); These two methods can be used to perform any necessary operations just after opening the connection (C<.prepare>) or just before closing the connection (C<.finalize>). For example if you need to scan the underlying disk to check for a partition table, you could do it in your C<.prepare> method (calling the plugin's C<.get_size> and C<.pread> methods via C). Or if you need to cleanly update superblock data in the image on close you can do it in your C<.finalize> method (calling the plugin's C<.pwrite> method). Doing these things in the filter's C<.open> or C<.close> method is not possible without using manual context lifecycle management. For C<.prepare>, the value of C is the same as was passed to C<.open>, declaring how this filter will be used. Note that nbdkit performs sanity checking on requests made to the underlying plugin; for example, Cpread> cannot be called on a given connection unless Cget_size> has first been called at least once in the same connection (to ensure the read requests are in bounds), and Cpwrite> further requires an earlier successful call to Ccan_write>. In many filters, these prerequisites will be automatically called during the client negotiation phase, but there are cases where a filter overrides query functions or makes I/O calls into the plugin before handshaking is complete, where the filter needs to make those prerequisite calls manually during C<.prepare>. While there are Cprepare> and Cfinalize> functions, these are different from other filter methods, in that any plugin context associated with the current connection (via the C parameter to C<.open>, or via C, is prepared and finalized automatically by nbdkit, so they are only used during manual lifecycle management. Prepare methods are called starting with the filter closest to the plugin and proceeding outwards (matching the order of C<.open> if all filters call C before doing anything locally), and only when an outer filter did not skip the C call during C<.open>. Finalize methods are called in the reverse order of prepare methods, with the outermost filter first (and matching the order of C<.close>), and only if the prepare method succeeded. If there is an error, both callbacks should call L with an error message and return C<-1>. An error in C<.prepare> is reported to the client, but leaves the connection open (a client may try again with a different export name, for example); while an error in C<.finalize> forces the client to disconnect. =head2 C<.get_size> int64_t (*get_size) (nbdkit_next *next, void *handle); This intercepts the plugin C<.get_size> method and can be used to read or modify the apparent size of the block device that the NBD client will see. The returned size must be E 0. If there is an error, C<.get_size> should call L with an error message and return C<-1>. This function is only called once per connection and cached by nbdkit. Similarly, repeated calls to Cget_size> will return a cached value. =head2 C<.export_description> const char *export_description (nbdkit_next *next, void *handle); This intercepts the plugin C<.export_description> method and can be used to read or modify the export description that the NBD client will see. =head2 C<.block_size> int block_size (nbdkit_next *next, void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); This intercepts the plugin C<.block_size> method and can be used to read or modify the block size constraints that the NBD client will see. =head2 C<.can_write> =head2 C<.can_flush> =head2 C<.is_rotational> =head2 C<.can_trim> =head2 C<.can_zero> =head2 C<.can_fast_zero> =head2 C<.can_extents> =head2 C<.can_fua> =head2 C<.can_multi_conn> =head2 C<.can_cache> int (*can_write) (nbdkit_next *next, void *handle); int (*can_flush) (nbdkit_next *next, void *handle); int (*is_rotational) (nbdkit_next *next, void *handle); int (*can_trim) (nbdkit_next *next, void *handle); int (*can_zero) (nbdkit_next *next, void *handle); int (*can_fast_zero) (nbdkit_next *next, void *handle); int (*can_extents) (nbdkit_next *next, void *handle); int (*can_fua) (nbdkit_next *next, void *handle); int (*can_multi_conn) (nbdkit_next *next, void *handle); int (*can_cache) (nbdkit_next *next, void *handle); These intercept the corresponding plugin methods, and control feature bits advertised to the client. Of note, the semantics of C<.can_zero> callback in the filter are slightly different from the plugin, and must be one of three success values visible only to filters: =over 4 =item C Completely suppress advertisement of write zero support (this can only be done from filters, not plugins). =item C Inform nbdkit that write zeroes should immediately fall back to C<.pwrite> emulation without trying C<.zero> (this value is returned by Ccan_zero> if the plugin returned false in its C<.can_zero>). =item C Inform nbdkit that write zeroes should attempt to use C<.zero>, although it may still fall back to C<.pwrite> emulation for C or C failures (this value is returned by Ccan_zero> if the plugin returned true in its C<.can_zero>). =back Remember that most of the feature check functions return merely a boolean success value, while C<.can_zero>, C<.can_fua> and C<.can_cache> have three success values. The difference between C<.can_fua> values may affect choices made in the filter: when splitting a write request that requested FUA from the client, if Ccan_fua> returns C, then the filter should pass the FUA flag on to each sub-request; while if it is known that FUA is emulated by a flush because of a return of C, it is more efficient to only flush once after all sub-requests have completed (often by passing C on to only the final sub-request, or by dropping the flag and ending with a direct call to Cflush>). If there is an error, the callback should call L with an error message and return C<-1>. These functions are called at most once per connection and cached by nbdkit. Similarly, repeated calls to any of the C counterparts will return a cached value; by calling into the plugin during C<.prepare>, you can ensure that later use of the cached values during data commands like <.pwrite> will not fail. =head2 C<.pread> int (*pread) (nbdkit_next *next, void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); This intercepts the plugin C<.pread> method and can be used to read or modify data read by the plugin. The parameter C exists in case of future NBD protocol extensions; at this time, it will be 0 on input, and the filter should not pass any flags to Cpread>. If there is an error (including a short read which couldn't be recovered from), C<.pread> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head2 C<.pwrite> int (*pwrite) (nbdkit_next *next, void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); This intercepts the plugin C<.pwrite> method and can be used to modify data written by the plugin. This function will not be called if C<.can_write> returned false; in turn, the filter should not call Cpwrite> if Ccan_write> did not return true. The parameter C may include C on input based on the result of C<.can_fua>. In turn, the filter should only pass C on to Cpwrite> if Ccan_fua> returned a positive value. If there is an error (including a short write which couldn't be recovered from), C<.pwrite> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head2 C<.flush> int (*flush) (nbdkit_next *next, void *handle, uint32_t flags, int *err); This intercepts the plugin C<.flush> method and can be used to modify flush requests. This function will not be called if C<.can_flush> returned false; in turn, the filter should not call Cflush> if Ccan_flush> did not return true. The parameter C exists in case of future NBD protocol extensions; at this time, it will be 0 on input, and the filter should not pass any flags to Cflush>. If there is an error, C<.flush> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head2 C<.trim> int (*trim) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); This intercepts the plugin C<.trim> method and can be used to modify trim requests. This function will not be called if C<.can_trim> returned false; in turn, the filter should not call Ctrim> if Ccan_trim> did not return true. The parameter C may include C on input based on the result of C<.can_fua>. In turn, the filter should only pass C on to Ctrim> if Ccan_fua> returned a positive value. If there is an error, C<.trim> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head2 C<.zero> int (*zero) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); This intercepts the plugin C<.zero> method and can be used to modify zero requests. This function will not be called if C<.can_zero> returned C or C; in turn, the filter should not call Czero> if Ccan_zero> returned C. On input, the parameter C may include C unconditionally, C based on the result of C<.can_fua>, and C based on the result of C<.can_fast_zero>. In turn, the filter may pass C unconditionally, but should only pass C or C on to Czero> if the corresponding Ccan_fua> or Ccan_fast_zero> returned a positive value. Note that unlike the plugin C<.zero> which is permitted to fail with C or C to force a fallback to C<.pwrite>, the function Czero> will not fail with C set to C or C unless C was used, because otherwise the fallback has already taken place. If there is an error, C<.zero> should call L with an error message B return -1 with C set to the positive errno value to return to the client. The filter should not fail with C or C unless C includes C (while plugins have automatic fallback to C<.pwrite>, filters do not). =head2 C<.extents> int (*extents) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err); This intercepts the plugin C<.extents> method and can be used to modify extent requests. This function will not be called if C<.can_extents> returned false; in turn, the filter should not call Cextents> if Ccan_extents> did not return true. It is possible for filters to transform the extents list received back from the layer below. Without error checking it would look like this: myfilter_extents (..., uint32_t count, uint64_t offset, ...) { size_t i; struct nbdkit_extents *extents2; struct nbdkit_extent e; int64_t size; size = next->get_size (next); extents2 = nbdkit_extents_new (offset + shift, size); next->extents (next, count, offset + shift, flags, extents2, err); for (i = 0; i < nbdkit_extents_count (extents2); ++i) { e = nbdkit_get_extent (extents2, i); e.offset -= shift; nbdkit_add_extent (extents, e.offset, e.length, e.type); } nbdkit_extents_free (extents2); } If there is an error, C<.extents> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head3 Allocating and freeing nbdkit_extents list Two functions are provided to filters only for allocating and freeing the map: struct nbdkit_extents *nbdkit_extents_new (uint64_t start, uint64_t end); Allocates and returns a new, empty extents list. The C parameter is the start of the range described in the list, and the C parameter is the offset of the byte beyond the end. Normally you would pass in C as the start and the size of the plugin as the end, but for filters which adjust offsets, they should pass in the adjusted offset. On error this function can return C. In this case it calls L and/or L as required. C will be set to a suitable value. void nbdkit_extents_free (struct nbdkit_extents *); Frees an existing extents list. =head3 Iterating over nbdkit_extents list Two functions are provided to filters only to iterate over the extents in order: size_t nbdkit_extents_count (const struct nbdkit_extents *); Returns the number of extents in the list. struct nbdkit_extent { uint64_t offset; uint64_t length; uint32_t type; }; struct nbdkit_extent nbdkit_get_extent (const struct nbdkit_extents *, size_t i); Returns a copy of the C'th extent. =head3 Reading the full extents from the plugin A convenience function is provided to filters only which makes one or more requests to the underlying plugin until we have a full set of extents covering the region C<[offset..offset+count-1]>. struct nbdkit_extents *nbdkit_extents_full ( nbdkit_next *next, uint32_t count, uint64_t offset, uint32_t flags, int *err); Note this allocates a new C which the caller must free. C is passed through to the underlying plugin, but C is removed from the set of flags so that the plugin returns as much information as possible (this is usually what you want). On error this function can return C. In this case it calls L and/or L as required. C<*err> will be set to a suitable value. =head3 Enforcing alignment of an nbdkit_extents list A convenience function is provided to filters only which makes it easier to ensure that the client only encounters aligned extents. int nbdkit_extents_aligned (nbdkit_next *next, uint32_t count, uint64_t offset, uint32_t flags, uint32_t align, struct nbdkit_extents *extents, int *err); Calls Cextents> as needed until at least C bytes are obtained, where C is a power of 2. Anywhere the underlying plugin returns differing extents within C bytes, this function treats that portion of the disk as a single extent with zero and sparse status bits determined by the intersection of all underlying extents. It is an error to call this function with C or C that is not already aligned. =head2 C<.cache> int (*cache) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); This intercepts the plugin C<.cache> method and can be used to modify cache requests. This function will not be called if C<.can_cache> returned C or C; in turn, the filter should not call Ccache> if Ccan_cache> returned C. The parameter C exists in case of future NBD protocol extensions; at this time, it will be 0 on input, and the filter should not pass any flags to Ccache>. If there is an error, C<.cache> should call L with an error message B return -1 with C set to the positive errno value to return to the client. =head1 ERROR HANDLING If there is an error in the filter itself, the filter should call L to report an error message. If the callback is involved in serving data, the explicit C parameter determines the error code that will be sent to the client; other callbacks should return the appropriate error indication, eg. C or C<-1>. =head1 DEBUGGING Run the server with I<-f> and I<-v> options so it doesn't fork and you can see debugging information: nbdkit -fv --filter=./myfilter.so plugin [key=value [key=value [...]]] To print debugging information from within the filter, call L. Note that C only prints things when the server is in verbose mode (I<-v> option). =head2 Debug Flags Debug Flags in filters work exactly the same way as plugins. See L. =head1 INSTALLING THE FILTER The filter is a C<*.so> file and possibly a manual page. You can of course install the filter C<*.so> file wherever you want, and users will be able to use it by running: nbdkit --filter=/path/to/filter.so plugin [args] However B the shared library has a name of the form C-filter.so> B the library is installed in the C<$filterdir> directory, then users can be run it by only typing: nbdkit --filter=name plugin [args] The location of the C<$filterdir> directory is set when nbdkit is compiled and can be found by doing: nbdkit --dump-config If using the pkg-config/pkgconf system then you can also find the filter directory at compile time by doing: pkg-config nbdkit --variable=filterdir =head1 PKG-CONFIG/PKGCONF nbdkit provides a pkg-config/pkgconf file called C which should be installed on the correct path when the nbdkit development environment is installed. You can use this in autoconf F scripts to test for the development environment: PKG_CHECK_MODULES([NBDKIT], [nbdkit >= 1.2.3]) The above will fail unless nbdkit E 1.2.3 and the header file is installed, and will set C and C appropriately for compiling filters. You can also run pkg-config/pkgconf directly, for example: if ! pkg-config nbdkit --exists; then echo "you must install the nbdkit development environment" exit 1 fi You can also substitute the filterdir variable by doing: PKG_CHECK_VAR([NBDKIT_FILTERDIR], [nbdkit], [filterdir]) which defines C<$(NBDKIT_FILTERDIR)> in automake-generated Makefiles. =head1 WRITING FILTERS IN C++ Instead of using C, it is possible to write filters in C++. However for inclusion in upstream nbdkit we would generally prefer filters written in C. Filters in C++ work almost exactly like those in C, but the way you define the C struct is slightly different: namespace { nbdkit_filter create_filter() { nbdkit_filter filter = nbdkit_filter (); filter.name = "myfilter"; filter.config = myfilter_config; return filter; } } static struct nbdkit_filter filter = create_filter (); NBDKIT_REGISTER_FILTER(filter) =head1 SEE ALSO L, L. Standard filters provided by nbdkit: __FILTER_LINKS__. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_is_tls.pod0000644000175000017500000000252514623341243013026 =head1 NAME nbdkit_is_tls - get TLS status of the connection for nbdkit =head1 SYNOPSIS #include int nbdkit_is_tls (void); =head1 DESCRIPTION C returns true if and only if TLS negotiation has been completed on the current connection. An L plugin may use C to limit connections according to whether the client connection is protected by TLS. This function uses thread-local magic so no parameter is required L and the nbdkit I<--tls=require> option are other alternatives. =head1 RETURN VALUE The function returns 1 (true) if TLS negotiation has been completed, or 0 (false) if not. If there is an error it calls L and returns C<-1>. =head1 LANGUAGE BINDINGS In L: NBDKit.is_tls : unit -> bool In L: import nbdkit tls = nbdkit.is_tls() In L: use nbdkit::*; pub fn is_tls() -> Result In L the TLS flag is available as parameter C<$4> of the C method. =head1 HISTORY C was added in nbdkit 1.22. =head1 SEE ALSO L, L, L, L, L, L. =head1 AUTHORS Eric Blake =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-loop.pod0000644000175000017500000000741014534316443012423 =head1 NAME nbdkit-loop - use nbdkit with the Linux kernel client to create loop devices and loop mounts =head1 DESCRIPTION nbdkit (server) can be used with the Linux kernel nbd (client) in a loop mode allowing any of the plugins supported by nbdkit to be turned into Linux block devices. In addition to L itself, the main commands you will use are: =over 4 =item nbd-client localhost /dev/nbd0 Attaches a locally running nbdkit instance to the kernel device F. =item nbd-client -unix /tmp/socket /dev/nbd0 Alternative method using a Unix domain socket instead of a public TCP/IP socket. Use C to serve. =item nbd-client -d /dev/nbd0 Detaches F. =item nbd-client -c /dev/nbd0 Queries whether F is attached or not. =item modprobe nbd You may be need to run this command once to load the nbd client kernel module. =back The L and L commands must be run as root. =head2 Warning: Do not loop mount untrusted filesystems Untrusted filesystems and untrusted disk images should not be loop mounted because they could contain exploits that attack your host kernel. Use the tools from L instead since it safely isolates untrusted filesystems from the host. =head2 Loop mount a filesystem from a compressed file If you have a filesystem or disk image in xz-compressed format then you can use L and L to loop mount it as follows: nbdkit --filter=xz file disk.xz nbd-client localhost /dev/nbd0 mount /dev/nbd0p1 /mnt =head2 Loop mount a filesystem from a web server You can use L to loop mount a filesystem from a disk image on a web server: nbdkit [--filter=xz] curl https://example.com/disk.img nbd-client localhost /dev/nbd0 mount /dev/nbd0p1 /mnt Use I<--filter=xz> if the remote image is XZ-compressed. =head2 Create a giant btrfs filesystem nbdkit is useful for testing the limits of Linux filesystems. Using L you can create virtual disks stored in RAM with a virtual size up to S<2â¶Â³-1 bytes>, and then create filesystems on these: nbdkit memory $(( 2**63 - 1 )) nbd-client localhost /dev/nbd0 Partition the device using GPT, creating a single partition with all default settings: gdisk /dev/nbd0 Make a btrfs filesystem on the disk and mount it: mkfs.btrfs -K /dev/nbd0p1 mount /dev/nbd0p1 /mnt =head2 Inject errors into Linux devices Using L you can see how Linux devices react to errors: nbdkit --filter=error \ memory 64M \ error-rate=100% error-file=/tmp/inject nbd-client localhost /dev/nbd0 mkfs -t ext4 /dev/nbd0 mount /dev/nbd0 /mnt Inject errors by touching F, and stop injecting errors by removing this file. =head2 Write Linux block devices in shell script Using L you can write custom Linux block devices in shell script for testing. For example the following shell script creates a disk which contains a bad sector: #!/bin/bash - case "$1" in thread_model) echo parallel ;; get_size) echo 64M ;; pread) if [ $4 -le 100000 ] && [ $(( $4+$3 )) -gt 100000 ]; then echo EIO Bad block >&2 exit 1 else dd if=/dev/zero count=$3 iflag=count_bytes fi ;; *) exit 2 ;; esac Create a loop from this shell script using: nbdkit sh ./bad-sector.sh nbd-client localhost /dev/nbd0 You can then try running tests such as: badblocks /dev/nbd0 =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_nanosleep.pod0000644000175000017500000000271314623341243013514 =head1 NAME nbdkit_nanosleep - suspend the current thread for nbdkit =head1 SYNOPSIS #include int nbdkit_nanosleep (unsigned sec, unsigned nsec); =head1 DESCRIPTION The utility function C suspends the current L thread for C seconds plus C nanoseconds. Plugins or filters that need to sleep may call L, L and similar. However that can cause nbdkit to delay excessively when shutting down (since the server must wait for any plugin or filter which is sleeping). The purpose of this function is to provide a way for sleeps to be interrupted when nbdkit is shutting down. Use L to parse delays and sleeps from configuration parameters for use by this function. =head1 RETURN VALUE This function returns C<0> if it slept at least as many seconds and nanoseconds as requested. If there is an error it calls L and returns C<-1>. Attempts to sleep more than C seconds are treated as an error. =head1 LANGUAGE BINDINGS In L: NBDKit.nanosleep : int -> int -> unit In L: import nbdkit nbdkit.nanosleep(sec, nsec) =head1 HISTORY C was added in nbdkit 1.16. =head1 SEE ALSO L, L, L, L, L, L. =head1 AUTHORS Eric Blake =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_parse_bool.pod0000644000175000017500000000173714623341243013662 =head1 NAME nbdkit_parse_bool - parse human-readable boolean strings for nbdkit =head1 SYNOPSIS #include int nbdkit_parse_bool (const char *str); =head1 DESCRIPTION Use the C utility function to parse human-readable strings such as C<"on">, C<"off">, C<"true">, C<"no"> etc into a boolean value. =head1 RETURN VALUE The function returns 0 or 1 if the parse was successful. If there is an error it calls L and returns C<-1>. =head1 LANGUAGE BINDINGS In L: NBDKit.parse_bool : string -> bool In L: use nbdkit::*; pub fn parse_bool(s: &str) -> Result =head1 HISTORY C was added in nbdkit 1.8. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_parse_delay.pod0000644000175000017500000000327014623341243014017 =head1 NAME nbdkit_parse_delay - parse human-readable delays and sleeps for nbdkit =head1 SYNOPSIS #include int nbdkit_parse_delay (const char *what, const char *str, unsigned *sec, unsigned *nsec); =head1 DESCRIPTION The utility function C can be used to parse configuration parameters on the L command line specifying delays and sleeps. The C parameter is a string in one of the following formats: =over 4 =item C<1> =item C<1.2> =item C<1.2s> Seconds =item C<1.2ms> =item C<120ms> Milliseconds =item C<1.2us> =item C<1.2μs> =item C<120μs> Microseconds =item C<1ns> Nanoseconds, the smallest possible time division for this function. =back The C parameter is printed in error messages to provide context. The output (C, C) can be passed straight to L. =head1 RETURN VALUE On success the function returns C<0> and sets C<*sec> and C<*nsec> to the seconds and nanoseconds parsed. If there is an error it calls L and returns C<-1>. In this case, C<*sec> and C<*nsec> are not touched. =head1 LANGUAGE BINDINGS In L: NBDKit.parse_delay : string -> string -> int * int In L: import nbdkit (sec, nsec) = nbdkit.parse_delay(what, str) =head1 HISTORY C was added in nbdkit 1.40. =head1 SEE ALSO L, L, L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_parse_int.pod0000644000175000017500000000474614623341243013524 =head1 NAME nbdkit_parse_int, nbdkit_parse_unsigned, nbdkit_parse_int8_t, nbdkit_parse_int16_t, nbdkit_parse_int32_t, nbdkit_parse_int64_t, nbdkit_parse_uint8_t, nbdkit_parse_uint16_t, nbdkit_parse_uint32_t, nbdkit_parse_uint64_t - parse numbers for nbdkit =head1 SYNOPSIS #include int nbdkit_parse_int (const char *what, const char *str, int *r); int nbdkit_parse_unsigned (const char *what, const char *str, unsigned *r); int nbdkit_parse_int8_t (const char *what, const char *str, int8_t *r); int nbdkit_parse_uint8_t (const char *what, const char *str, uint8_t *r); int nbdkit_parse_int16_t (const char *what, const char *str, int16_t *r); int nbdkit_parse_uint16_t (const char *what, const char *str, uint16_t *r); int nbdkit_parse_int32_t (const char *what, const char *str, int32_t *r); int nbdkit_parse_uint32_t (const char *what, const char *str, uint32_t *r); int nbdkit_parse_int64_t (const char *what, const char *str, int64_t *r); int nbdkit_parse_uint64_t (const char *what, const char *str, uint64_t *r); =head1 DESCRIPTION Parse string C into an integer of various types. These functions parse a decimal, hexadecimal (C<"0x...">) or octal (C<"0...">) number. These functions deal correctly with overflow, out of range and parse errors, and you should use them instead of unsafe functions like L, L and similar. The C parameter is printed in error messages to provide context. It should usually be a short descriptive string of what you are trying to parse, eg: if (nbdkit_parse_int ("random seed", value, &seed) == -1) return -1; might print an error: random seed: could not parse number: "lalala" =head1 RETURN VALUE On success the functions return C<0> and set C<*r> to the parsed value (unless C<*r == NULL> in which case the result is discarded). On error, L is called and the functions return C<-1>. On error C<*r> is always unchanged. =head1 HISTORY C and the others were added in nbdkit 1.16. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_parse_probability.pod0000644000175000017500000000316014623341243015237 =head1 NAME nbdkit_parse_probability - parse probabilities for nbdkit =head1 SYNOPSIS #include int nbdkit_parse_probability (const char *what, const char *str, double *ret); =head1 DESCRIPTION Use the C utility function to parse probabilities. Common formats understood include: C<"0.1">, C<"1e-1">, C<"10%">, C<"1:10"> or C<"1/10">, which all mean a probability of 1 in 10. The C parameter is printed in error messages to provide context. The C parameter is the probability string. =head1 RETURN VALUE On success the function returns C<0> and sets C<*ret>. The probability is always a finite number E 0.0, but B (for example if S> then the function will set S>). If you want to clamp the upper bound the caller must do that. On error, L is called and C<-1> is returned. =head1 LANGUAGE BINDINGS In L: NBDKit.parse_probability : string -> string -> float In L: import nbdkit size = nbdkit.parse_probability(what, str) In L: use nbdkit::*; pub fn parse_probability(what: &str, s: &str) -> Result =head1 HISTORY C was added in nbdkit 1.36. =head1 SEE ALSO L, L, L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_parse_size.pod0000644000175000017500000000230614623341243013672 =head1 NAME nbdkit_parse_size - parse human-readable size strings for nbdkit =head1 SYNOPSIS #include int64_t nbdkit_parse_size (const char *str); =head1 DESCRIPTION Use the C utility function to parse human-readable size strings such as C<"100M"> into the size in bytes. The C parameter is a string in a number of common formats. =head1 RETURN VALUE The function returns the size in bytes. If there is an error it calls L and returns C<-1>. =head1 LANGUAGE BINDINGS In L: NBDKit.parse_size : string -> int64 In L: import nbdkit size = nbdkit.parse_size(str) In L: use nbdkit::*; pub fn parse_size(s: &str) -> Result In L, C is called implicitly to parse the output of C and other methods. =head1 HISTORY C was present in nbdkit 0.1.0. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_peer_name.pod0000644000175000017500000000577514623341243013476 =head1 NAME nbdkit_peer_name, nbdkit_peer_pid, nbdkit_peer_uid, nbdkit_peer_gid, nbdkit_peer_security_context - get client address and information for nbdkit =head1 SYNOPSIS #include int nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen); int64_t nbdkit_peer_pid (void); int64_t nbdkit_peer_uid (void); int64_t nbdkit_peer_gid (void); char *nbdkit_peer_security_context (void); =head1 DESCRIPTION =head2 nbdkit_peer_name Return the peer (client) address, if available. The C and C parameters behave like L. In particular you must initialize C with the size of the buffer pointed to by C, and if C is not large enough then the address will be truncated. In some cases this is not available or the address returned will be meaningless (eg. if there is a proxy between the client and nbdkit). This call uses thread-local magic so no parameter is required to specify the current connection. =head2 nbdkit_peer_pid (nbdkit E 1.24, Linux only) Return the peer process ID. This is only available when the client connected over a Unix domain socket. =head2 nbdkit_peer_uid (nbdkit E 1.24) Return the peer user ID. This is only available when the client connected over a Unix domain socket. =head2 nbdkit_peer_gid (nbdkit E 1.24) Return the peer group ID. This is only available when the client connected over a Unix domain socket. =head2 nbdkit_peer_security_context (nbdkit E 1.36, not Windows) Return the peer security context (usually the SELinux label, IPSEC label or NetLabel). See the description of C in L and L. =head1 RETURN VALUE All functions except C return C<0> on success. If there is an error they call L and return C<-1>. C returns a security context as a string on success. The caller must free this string. On error (which can include missing label or unsupported protocol), L is called and this call returns C. =head1 LANGUAGE BINDINGS In L: NBDKit.peer_name : unit -> Unix.sockaddr NBDKit.peer_pid : unit -> int64 NBDKit.peer_uid : unit -> int64 NBDKit.peer_gid : unit -> int64 NBDKit.peer_security_context : unit -> string In L: import nbdkit pid = nbdkit.peer_pid() uid = nbdkit.peer_uid() gid = nbdkit.peer_gid() security_context = nbdkit.peer_security_context() In L: use nbdkit::*; pub fn peername() -> std::result::Result> =head1 HISTORY C was added in nbdkit 1.16. C, C and C were added in nbdkit 1.24. C was added in nbdkit 1.36. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_peer_tls_dn.pod0000644000175000017500000000454114676465664014055 =head1 NAME nbdkit_peer_tls_dn, nbdkit_peer_tls_issuer_dn - read the client TLS X.509 Distinguished Name =head1 SYNOPSIS #include char *nbdkit_peer_tls_dn (void); char *nbdkit_peer_tls_issuer_dn (void); =head1 DESCRIPTION If all of these conditions are met: =over 4 =item * the client connects over TLS (see L) =item * the TLS connection is using X.509 certificates =item * the client presents a client certificate =item * the nbdkit I<--tls-verify-peer> option is used =back then these APIs can be used to get the Distinguished Name (DN) of the certificate or the certificate's issuer. The issuer is the Certificate Authority (CA) that issued the client certificate. The DN is returned as a string of the form C<"CN=xx,O=yy,[...]C=zz"> (see S for the exact format). If the DN is not available, C<""> is returned (this is not an error). L can be used to filter client connections by the DN. =head2 EXAMPLE CERTIFICATE AND DISTINGUISHED NAME Please see L for details of how to generate client certificates. Following those instructions, if you were to generate a client certificate from this F input: country = US state = New York locality = New York organization = BigCo cn = client.example.com tls_www_client encryption_key signing_key and sign it with this Certificate Authority F: cn = BigCo ca cert_signing_key then the client certificate DN would be: CN=client.example.com,O=BigCo,L=New York,ST=New York,C=US and the issuer DN would be: CN=BigCo =head1 RETURN VALUE On success both of these functions return a TLS Distinguished Name as a string, or C<"">. The caller must free this string. If there is an error they call L and return C. =head1 LANGUAGE BINDINGS In L: NBDKit.peer_tls_dn : unit -> string NBDKit.peer_tls_issuer_dn : unit -> string In L: import nbdkit dn = nbdkit.peer_tls_dn() dn = nbdkit.peer_tls_issuer_dn() =head1 HISTORY C and C were added in S. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-plugin.pod0000644000175000017500000017221314676465664012775 =head1 NAME nbdkit-plugin - how to write nbdkit plugins =head1 SYNOPSIS #define NBDKIT_API_VERSION 2 #include #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS static void * myplugin_open (void) { /* create a handle ... */ return handle; } static struct nbdkit_plugin plugin = { .name = "myplugin", .open = myplugin_open, .get_size = myplugin_get_size, .pread = myplugin_pread, .pwrite = myplugin_pwrite, /* etc */ }; NBDKIT_REGISTER_PLUGIN(plugin) Compile the plugin as a shared library: gcc -fPIC -shared myplugin.c -o myplugin.so and load it into nbdkit: nbdkit [--args ...] ./myplugin.so [key=value ...] When debugging, use the I<-fv> options: nbdkit -fv ./myplugin.so [key=value ...] =head1 DESCRIPTION An nbdkit plugin is a new source device which can be served using the Network Block Device (NBD) protocol. This manual page describes how to create an nbdkit plugin in C. To see example plugins: L To write plugins in other languages, see: __LANG_PLUGIN_LINKS__. =head2 API and ABI guarantee for C plugins Plugins written in C have an ABI guarantee: a plugin compiled against an older version of nbdkit will still work correctly when loaded with a newer nbdkit. We also try (but cannot guarantee) to support plugins compiled against a newer version of nbdkit when loaded with an older nbdkit, although the plugin may have reduced functionality if it depends on features only provided by newer nbdkit. For plugins written in C, we also provide an API guarantee: a plugin written against an older header will still compile unmodified with a newer nbdkit. The API guarantee does not always apply to plugins written in other (non-C) languages which may have to adapt to changes when recompiled against a newer nbdkit. =head1 WRITING AN NBDKIT PLUGIN =head2 C<#define NBDKIT_API_VERSION 2> Plugins must choose which API version they want to use, by defining NBDKIT_API_VERSION before including Cnbdkit-plugin.hE> (or any other nbdkit header). If omitted, the default version is 1 for backwards-compatibility with nbdkit v1.1.26 and earlier; however, it is recommended that new plugins be written to the maximum version (currently 2) as it enables more features and better interaction with nbdkit filters. The rest of this document only covers the version 2 interface. A newer nbdkit will always support plugins written in C which use any prior API version. =head2 C<#include Enbdkit-plugin.hE> All plugins should start by including this header file (after optionally choosing an API version). =head2 C<#define THREAD_MODEL ...> All plugins must define a thread model. See L below for details. It is generally safe to use: #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS =head2 C All plugins must define and register one C, which contains the name of the plugin and pointers to callback functions, and use the C macro: static struct nbdkit_plugin plugin = { .name = "myplugin", .longname = "My Plugin", .description = "This is my great plugin for nbdkit", .open = myplugin_open, .get_size = myplugin_get_size, .pread = myplugin_pread, .pwrite = myplugin_pwrite, /* etc */ }; NBDKIT_REGISTER_PLUGIN(plugin) The C<.name> field is the name of the plugin. The callbacks are described below (see L). Only C<.name>, C<.open>, C<.get_size> and C<.pread> are required. All other callbacks can be omitted, although typical plugins need to use more. =head2 Callback lifecycle Callbacks are called in the following order over the lifecycle of the plugin: ┌──────────────────┠│ load │ └─────────┬────────┘ │ configuration phase starts ─┠┌─────────┴────────┠┆ │ config │ config is called once per ┆ └─────────┬────────┘↺ key=value on the command line ┆ ┌─────────┴────────┠┆ │ config_complete │ ┆ └─────────┬────────┘ ┆ ┌─────────┴────────┠┆ │ thread_model │ ┆ └─────────┬────────┘ configuration phase ends ─┘ ┌─────────┴────────┠│ get_ready │ └─────────┬────────┘ │ nbdkit forks into the background ┌─────────┴────────┠│ after_fork │ └─────────┬────────┘ │ nbdkit starts serving clients │ ┌──────────┴─────────────┬─ ─ ─ ─ ─ ─ ─ ─ ─ ┌──────┴─────┠client #1 │ │ preconnect │ │ └──────┬─────┘ │ ┌──────┴─────┠│ │list_exports│ │ └──────┬─────┘ │ ┌──────┴─────┠│ │ open │ │ └──────┬─────┘ │ ┌──────┴─────┠NBD option │ │ can_write │ negotiation │ └──────┬─────┘ │ ┌──────┴─────┠┌──────┴─────┠client #2 │ get_size │ │ preconnect │ └──────┬─────┘ └──────┬─────┘ ┌──────┴─────┠data │ pread │ serving └──────┬─────┘↺ ... ┌──────┴─────┠│ pwrite │ └──────┬─────┘↺ ┌──────┴─────┠┌──────┴─────┠│ close │ │ close │ └────────────┘ └────────────┘ │ before nbdkit exits │ ┌─────────┴────────┠│ cleanup │ └─────────┬────────┘ ┌─────────┴────────┠│ unload │ └──────────────────┘ =head3 Notes =over 4 =item C The order of calls when the user queries the plugin is slightly different: C<.config> is called once for each parameter. C<.config_complete> is I called. C<.thread_model> is called after C<.config>. =item C<.get_ready> This is the last chance to do any global preparation that is needed to serve connections. In particular, error messages here will be visible to the user, but they might not be in C<.after_fork> (see below). Plugins should not create background threads here. Use C<.after_fork> instead. =item C<.after_fork> C<.after_fork> is called after the server has forked into the background and changed UID and directory. If a plugin needs to create background threads (or uses an external library that creates threads) it should do so here, because background threads are invalidated by fork. Because the server may have forked into the background, error messages and failures from C<.after_fork> cannot be seen by the user unless they look through syslog. An error in C<.after_fork> can appear to the user as if nbdkit “just diedâ€. So in almost all cases it is better to use C<.get_ready> instead of this callback, or to do as much preparation work as possible in C<.get_ready> and only start background threads here. The server doesn't always fork (eg. if the I<-f> flag is used), but even so this callback will be called. If you want to find out if the server forked between C<.get_ready> and C<.after_fork> use L. =item C<.preconnect> and C<.open> C<.preconnect> is called when a TCP connection has been made to the server. This happens early, before NBD or TLS negotiation. C<.open> is called when a new client has connected and finished the NBD handshake. TLS negotiation (if used) has been completed successfully. =item C<.can_write>, C<.get_size> and other option negotiation callbacks These are called during option negotiation with the client, but before any data is served. These callbacks may return different values across different C<.open> calls, but within a single connection, they are called at most once and cached by nbdkit for that connection. =item C<.pread>, C<.pwrite> and other data serving callbacks After option negotiation has finished, these may be called to serve data. Depending on the thread model chosen, they might be called in parallel from multiple threads. The data serving callbacks include a flags argument; the results of the negotiation callbacks influence whether particular flags will ever be passed to a data callback. =item C<.cleanup> and C<.unload> The difference between these two methods is that C<.cleanup> is called before any filter has been removed from memory with L. When C<.unload> is called, nbdkit is in the middle of calling L. Most plugins do not need to worry about this difference. =back =head2 Flags The following flags are defined by nbdkit, and used in various data serving callbacks as follows: =over 4 =item C This flag is used by the C<.zero> callback; there is no way to disable this flag, although a plugin that does not support trims as a way to write zeroes may ignore the flag without violating expected semantics. =item C This flag represents Forced Unit Access semantics. It is used by the C<.pwrite>, C<.zero>, and C<.trim> callbacks to indicate that the plugin must not return a result until the action has landed in persistent storage. This flag will not be sent to the plugin unless C<.can_fua> is provided and returns C. =back The following defines are valid as successful return values for C<.can_fua>: =over 4 =item C Forced Unit Access is not supported; the client must manually request a flush after writes have completed. The C flag will not be passed to the plugin's write callbacks. =item C The client may request Forced Unit Access, but it is implemented by emulation, where nbdkit calls C<.flush> after a write operation; this is semantically correct, but may hurt performance as it tends to flush more data than just what the client requested. The C flag will not be passed to the plugin's write callbacks. =item C The client may request Forced Unit Access, which results in the C flag being passed to the plugin's write callbacks (C<.pwrite>, C<.trim>, and C<.zero>). When the flag is set, these callbacks must not return success until the client's request has landed in persistent storage. =back The following defines are valid as successful return values for C<.can_cache>: =over 4 =item C The server does not advertise caching support, and rejects any client-requested caching. Any C<.cache> callback is ignored. =item C The nbdkit server advertises cache support to the client, where the client may request that the server cache a region of the export to potentially speed up future read and/or write operations on that region. The nbdkit server implements the caching by calling C<.pread> and ignoring the results. This option exists to ease the implementation of a common form of caching; any C<.cache> callback is ignored. =item C The nbdkit server advertises cache support to the client, where the client may request that the server cache a region of the export to potentially speed up future read and/or write operations on that region. The nbdkit server calls the C<.cache> callback to perform the caching; if that callback is missing, the client's cache request succeeds without doing anything. =back =head2 Threads Each nbdkit plugin must declare its maximum thread safety model by defining the C macro. (This macro is used by C). Additionally, a plugin may implement the C<.thread_model> callback, called right after C<.config_complete> to make a runtime decision on which thread model to use. The nbdkit server chooses the most restrictive model between the plugin's C, the C<.thread_model> if present, any restrictions requested by filters, and any limitations imposed by the operating system. In C output, the C line matches the C macro, and the C line matches what the system finally settled on after applying all restrictions. The possible settings for C are defined below. =over 4 =item C<#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS> Only a single handle can be open at any time, and all requests happen from one thread. Note this means only one client can connect to the server at any time. If a second client tries to connect it will block waiting for the first client to close the connection. =item C<#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS> I. Multiple handles can be open at the same time, but requests are serialized so that for the plugin as a whole only one open/read/write/close (etc) request will be in progress at any time. This is a useful setting if the library you are using is not thread-safe. However performance may not be good. =item C<#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS> Multiple handles can be open and multiple data requests can happen in parallel. However only one request will happen per handle at a time (but requests on different handles might happen concurrently). =item C<#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL> Multiple handles can be open and multiple data requests can happen in parallel (even on the same handle). The server may reorder replies, answering a later request before an earlier one. All the libraries you use must be thread-safe and reentrant, and any code that creates a file descriptor should atomically set C if you do not want it accidentally leaked to another thread's child process. You may also need to provide mutexes for fields in your connection handle. =back If none of the above thread models are suitable, use C and implement your own locking using C etc. =head2 Error handling If there is an error in the plugin, the plugin should call L to report an error message. Then, the callback should return the appropriate error indication, eg. C or C<-1>. More information about these functions and L can be found in the separate manual page about them. =head1 CALLBACKS =head2 C<.name> const char *name; This field (a string) is required, and B contain only ASCII alphanumeric characters or non-leading dashes, and be unique amongst all plugins. =head2 C<.version> const char *version; Plugins may optionally set a version string which is displayed in help and debugging output. (See also L below) =head2 C<.longname> const char *longname; An optional free text name of the plugin. This field is used in error messages. =head2 C<.description> const char *description; An optional multi-line description of the plugin. =head2 C<.load> void load (void); This is called once just after the plugin is loaded into memory. You can use this to perform any global initialization needed by the plugin. =head2 C<.unload> void unload (void); This may be called once just before the plugin is unloaded from memory. Note that it's not guaranteed that C<.unload> will always be called (eg. the server might be killed or segfault), so you should try to make the plugin as robust as possible by not requiring cleanup. See also L below. =head2 C<.dump_plugin> void dump_plugin (void); This optional callback is called when the S> command is used. It should print any additional informative C fields to stdout as needed. Prefixing the keys with the name of the plugin will avoid conflicts. =head2 C<.config> int config (const char *key, const char *value); On the nbdkit command line, after the plugin filename, come an optional list of C arguments. These are passed to the plugin through this callback when the plugin is first loaded and before any connections are accepted. This callback may be called zero or more times. Both C and C parameters will be non-NULL. The strings are owned by nbdkit but will remain valid for the lifetime of the plugin, so the plugin does not need to copy them. The key will be a non-empty string beginning with an ASCII alphabetic character (C C). The rest of the key must contain only ASCII alphanumeric plus period, underscore or dash characters (C C C<0-9> C<.> C<_> C<->). The value may be an arbitrary string, including an empty string. The names of Cs accepted by plugins is up to the plugin, but you should probably look at other plugins and follow the same conventions. If the value is a relative path, then note that the server changes directory when it starts up. See L. If L returns 1, the value of the configuration parameter may be used to trigger reading additional data through stdin (such as a password or inline script). If the C<.config> callback is not provided by the plugin, and the user tries to specify any C arguments, then nbdkit will exit with an error. If there is an error, C<.config> should call L with an error message and return C<-1>. =head2 C<.magic_config_key> const char *magic_config_key; This optional string can be used to set a "magic" key used when parsing plugin parameters. It affects how "bare parameters" (those which do not contain an C<=> character) are parsed on the command line. If C then any bare parameters are passed to the C<.config> method as: S>. If C is not set then we behave as in nbdkit E 1.7: If the first parameter on the command line is bare then it is passed to the C<.config> method as: S>. Any other bare parameters give errors. =head2 C<.config_complete> int config_complete (void); This optional callback is called after all the configuration has been passed to the plugin. It is a good place to do checks, for example that the user has passed the required parameters to the plugin. If there is an error, C<.config_complete> should call L with an error message and return C<-1>. =head2 C<.config_help> const char *config_help; This optional multi-line help message should summarize any C parameters that it takes. It does I need to repeat what already appears in C<.description>. If the plugin doesn't take any config parameters you should probably omit this. =head2 C<.thread_model> int thread_model (void) This optional callback is called after all the configuration has been passed to the plugin. It can be used to force a stricter thread model based on configuration, compared to C. See L above for details. Attempts to request a looser (more parallel) model are silently ignored. If there is an error, C<.thread_model> should call L with an error message and return C<-1>. =head2 C<.get_ready> int get_ready (void); This optional callback is called before the server starts serving. It is called before the server forks or changes directory. It is ordinarily the last chance to do any global preparation that is needed to serve connections. If there is an error, C<.get_ready> should call L with an error message and return C<-1>. =head2 C<.after_fork> int after_fork (void); This optional callback is called before the server starts serving. It is called after the server forks and changes directory. If a plugin needs to create background threads (or uses an external library that creates threads) it should do so here, because background threads are killed by fork. However you should try to do as little as possible here because error reporting is difficult. See L above. If there is an error, C<.after_fork> should call L with an error message and return C<-1>. =head2 C<.cleanup> void cleanup (void); This optional callback is called after the server has closed all connections and is preparing to unload. It is only reached in the same cases that the C<.after_fork> callback was used, making it a good place to clean up any background threads. However, it is not guaranteed that this callback will be reached, so you should try to make the plugin as robust as possible by not requiring cleanup. See also L below. =head2 C<.preconnect> int preconnect (int readonly); This optional callback is called when a TCP connection has been made to the server. This happens early, before NBD or TLS negotiation. If TLS authentication is required to access the server, then it has B been negotiated at this point. For security reasons (to avoid denial of service attacks) this callback should be written to be as fast and take as few resources as possible. If you use this callback, only use it to do basic access control, such as checking L, L, L, L against a list of permitted source addresses (see L and L). It may be better to do access control outside the server, for example using TCP wrappers or a firewall. The C flag informs the plugin that the server was started with the I<-r> flag on the command line. Returning C<0> will allow the connection to continue. If there is an error or you want to deny the connection, call L with an error message and return C<-1>. =head2 C<.list_exports> int list_exports (int readonly, int is_tls, struct nbdkit_exports *exports); This optional callback is called if the client tries to list the exports served by the plugin (using C). If the plugin does not supply this callback then the result of C<.default_export> is advertised as the lone export. The NBD protocol defines C<""> as the default export, so this is suitable for plugins which ignore the export name and always serve the same content. See also L below. The C flag informs the plugin that the server was started with the I<-r> flag on the command line, which is the same value passed to C<.preconnect> and C<.open>. However, the NBD protocol does not yet have a way to let the client advertise an intent to be read-only even when the server allows writes, so this parameter may not be as useful as it appears. The C flag informs the plugin whether this listing was requested after the client has completed TLS negotiation. When running the server in a mode that permits but does not require TLS, be careful that any exports listed when C is C do not leak unintended information. The C parameter is an opaque object for collecting the list of exports. Call C as needed to add specific exports to the list. int nbdkit_add_export (struct nbdkit_export *exports, const char *name, const char *description); The C must be a non-NULL, UTF-8 string between 0 and 4096 bytes in length. Export names must be unique. C is an optional description of the export which some clients can display but which is otherwise unused (if you don't want a description, you can pass this parameter as C). The string(s) are copied into the exports list so you may free them immediately after calling this function. C returns C<0> on success or C<-1> on failure; on failure L has already been called, with C set to a suitable value. There are also situations where a plugin may wish to duplicate the nbdkit default behavior of supplying an export list containing only the result of C<.default_export> when C<.list_exports> is missing; this is most common in a language binding where it is not known at compile time whether the language script will be providing an implementation for C<.list_exports>, and is done by calling C. int nbdkit_use_default_export (struct nbdkit_export *exports); C returns C<0> on success or C<-1> on failure; on failure L has already been called, with C set to a suitable value. The plugin may also leave the export list empty, by not calling either helper. Once the plugin is happy with the list contents, returning C<0> will send the list of exports back to the client. If there is an error, C<.list_exports> should call L with an error message and return C<-1>. =head2 C<.default_export> const char *default_export (int readonly, int is_tls); This optional callback is called if the client tries to connect to the default export C<"">, where the plugin provides a UTF-8 string between 0 and 4096 bytes. If the plugin does not supply this callback, the connection continues with the empty name; if the plugin returns a valid string, nbdkit behaves as if the client had passed that string instead of an empty name, and returns that name to clients that support it (see the C response to C). Similarly, if the plugin does not supply a C<.list_exports> callback, the result of this callback determines what export name to advertise to a client requesting an export list. The C flag informs the plugin that the server was started with the I<-r> flag on the command line, which is the same value passed to C<.preconnect> and C<.open>. However, the NBD protocol does not yet have a way to let the client advertise an intent to be read-only even when the server allows writes, so this parameter may not be as useful as it appears. The C flag informs the plugin whether the canonical name for the default export is being requested after the client has completed TLS negotiation. When running the server in a mode that permits but does not require TLS, be careful that a default export name does not leak unintended information. If the plugin returns C or an invalid string (such as longer than 4096 bytes), the client is not permitted to connect to the default export. However, this is not an error in the protocol, so it is not necessary to call L. =head2 C<.open> void *open (int readonly); This is called when a new client connects to the nbdkit server. The callback should allocate a handle and return it. This handle is passed back to other callbacks and could be freed in the C<.close> callback. Note that the handle is completely opaque to nbdkit, but it must not be NULL. If you don't need to use a handle, return C which is a static non-NULL pointer. The C flag informs the plugin that the server was started with the I<-r> flag on the command line which forces connections to be read-only. Note that the plugin may I force the connection to be readonly (even if this flag is false) by returning false from the C<.can_write> callback. So if your plugin can only serve read-only, you can ignore this parameter. If the plugin wants to differentiate the content it serves based on client input, then this is the spot to use L to determine which export the client requested. See also L below. This callback is called after the NBD handshake has completed; if the server requires TLS authentication, then that has occurred as well. But if the server is set up to have optional TLS authentication, you may check L to learn whether the client has completed TLS authentication. When running the server in a mode that permits but does not require TLS, be careful that you do not allow unauthenticated clients to cause a denial of service against authentication. If there is an error, C<.open> should call L with an error message and return C. =head2 C<.close> void close (void *handle); This is called when the client closes the connection. It should clean up any per-connection resources. Note there is no way in the NBD protocol to communicate close errors back to the client, for example if your plugin calls L and you are checking for errors (as you should do). Therefore the best you can do is to log the error on the server. Well-behaved NBD clients I try to flush the connection before it is closed and check for errors, but obviously this is outside the scope of nbdkit. =head2 C<.get_size> int64_t get_size (void *handle); This is called during the option negotiation phase of the protocol to get the size (in bytes) of the block device being exported. The returned size must be E 0. If there is an error, C<.get_size> should call L with an error message and return C<-1>. =head2 C<.export_description> const char *export_description (void *handle); This is called during the option negotiation phase only if the client specifically requested an export description (see the C response to C). Any description provided must be human-readable UTF-8, no longer than 4096 bytes. Ideally, this description should match any description set during C<.list_exports>, but that is not enforced. If the plugin returns C or an invalid string (such as longer than 4096 bytes), or if this callback is omitted, no description is offered to the client. As this is not an error in the protocol, it is not necessary to call L. If the callback will not be returning a compile-time constant string, you may find L helpful for returning a value that avoids a memory leak. =head2 C<.block_size> int block_size (void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); This is called during the option negotiation phase of the protocol to get the minimum, preferred and maximum block size (all in bytes) of the block device. The client should obey these constraints by not making requests which are smaller than the minimum size or larger than the maximum size, and usually making requests of a multiple of the preferred size. Furthermore requests should be aligned to at least the minimum block size, and usually the preferred block size. "Preferred" block size in the NBD specification can be misinterpreted. It means the I/O size which does not have a penalty for read-modify-write. Even if the plugin implements this callback, this does B mean that all client requests will obey the constraints. A client could still ignore the constraints. nbdkit passes all requests through to the plugin, because what the plugin does depends on the plugin's policy. It might decide to serve the requests correctly anyway, or reject them with an error. Plugins can avoid this complexity by using L which allows both setting/adjusting the constraints, and selecting an error policy. The minimum block size must be E 1. The maximum block size must be E 0xffff_ffff. minimum E preferred E maximum. As a special case, the plugin may return minimum == preferred == maximum == 0, meaning no information. If this callback is not used, then the NBD protocol assumes by default minimum = 1, preferred = 4096. (Maximum block size depends on various factors, see the NBD protocol specification, section "Block size constraints"). =head2 C<.can_write> int can_write (void *handle); This is called during the option negotiation phase to find out if the handle supports writes. If there is an error, C<.can_write> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return true iff a C<.pwrite> callback has been defined. =head2 C<.can_flush> int can_flush (void *handle); This is called during the option negotiation phase to find out if the handle supports the flush-to-disk operation. If there is an error, C<.can_flush> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return true iff a C<.flush> callback has been defined. =head2 C<.is_rotational> int is_rotational (void *handle); This is called during the option negotiation phase to find out if the backing disk is a rotational medium (like a traditional hard disk) or not (like an SSD). If true, this may cause the client to reorder requests to make them more efficient for a slow rotating disk. If there is an error, C<.is_rotational> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return false. =head2 C<.can_trim> int can_trim (void *handle); This is called during the option negotiation phase to find out if the plugin supports the trim/discard operation for punching holes in the backing storage. If there is an error, C<.can_trim> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return true iff a C<.trim> callback has been defined. =head2 C<.can_zero> int can_zero (void *handle); This is called during the option negotiation phase to find out if the plugin wants the C<.zero> callback to be utilized. Support for writing zeroes is still advertised to the client (unless the L is also used), so returning false merely serves as a way to avoid complicating the C<.zero> callback to have to fail with C or C on the connections where it will never be more efficient than using C<.pwrite> up front. If there is an error, C<.can_zero> should call L with an error message and return C<-1>. This callback is not required. If omitted, then for a normal zero request, nbdkit always tries C<.zero> first if it is present, and gracefully falls back to C<.pwrite> if C<.zero> was absent or failed with C or C. =head2 C<.can_fast_zero> int can_fast_zero (void *handle); This is called during the option negotiation phase to find out if the plugin wants to advertise support for fast zero requests. If this support is not advertised, a client cannot attempt fast zero requests, and has no way to tell if writing zeroes offers any speedups compared to using C<.pwrite> (other than compressed network traffic). If support is advertised, then C<.zero> will have C set when the client has requested a fast zero, in which case the plugin must fail with C or C up front if the request would not offer any benefits over C<.pwrite>. Advertising support for fast zero requests does not require that writing zeroes be fast, only that the result (whether success or failure) is fast, so this should be advertised when feasible. If there is an error, C<.can_fast_zero> should call L with an error message and return C<-1>. This callback is not required. If omitted, then nbdkit returns true if C<.zero> is absent or C<.can_zero> returns false (in those cases, nbdkit fails all fast zero requests, as its fallback to C<.pwrite> is not inherently faster), otherwise false (since it cannot be determined in advance if the plugin's C<.zero> will properly honor the semantics of C). =head2 C<.can_extents> int can_extents (void *handle); This is called during the option negotiation phase to find out if the plugin supports detecting allocated (non-sparse) regions of the disk with the C<.extents> callback. If there is an error, C<.can_extents> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return true iff a C<.extents> callback has been defined. =head2 C<.can_fua> int can_fua (void *handle); This is called during the option negotiation phase to find out if the plugin supports the Forced Unit Access (FUA) flag on write, zero, and trim requests. If this returns C, FUA support is not advertised to the client; if this returns C, the C<.flush> callback must work (even if C<.can_flush> returns false), and FUA support is emulated by calling C<.flush> after any write operation; if this returns C, then the C<.pwrite>, C<.zero>, and C<.trim> callbacks (if implemented) must handle the flag C, by not returning until that action has landed in persistent storage. If there is an error, C<.can_fua> should call L with an error message and return C<-1>. This callback is not required unless a plugin wants to specifically handle FUA requests. If omitted, nbdkit checks whether C<.flush> exists, and behaves as if this function returns C or C as appropriate. =head2 C<.can_multi_conn> int can_multi_conn (void *handle); This is called during the option negotiation phase to find out if the plugin is prepared to handle multiple connections from a single client. If the plugin sets this to true then a client may try to open multiple connections to the nbdkit server and spread requests across all connections to maximize parallelism. If the plugin sets it to false (which is the default) then well-behaved clients should only open a single connection, although we cannot control what clients do in practice. Specifically it means that either the plugin does not cache requests at all. Or if it does cache them then the effects of a C<.flush> request or setting C on a request must be visible across all connections to the plugin before the plugin replies to that request. Properly working clients should send the same export name for each of these connections. If you use Linux L option S> with S 1> then Linux checks this flag and will refuse to connect if C<.can_multi_conn> is false. If there is an error, C<.can_multi_conn> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return false. =head2 C<.can_cache> int can_cache (void *handle); This is called during the option negotiation phase to find out if the plugin supports a cache or prefetch operation. This can return: =over 4 =item C Cache support is not advertised to the client. =item C Caching is emulated by the server calling C<.pread> and discarding the result. =item C Cache support is advertised to the client. The C<.cache> callback will be called if it exists, otherwise all cache requests instantly succeed. =back If there is an error, C<.can_cache> should call L with an error message and return C<-1>. This callback is not required. If omitted, then we return C if the C<.cache> callback is missing, or C if it is defined. =head2 C<.pread> int pread (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags); During the data serving phase, nbdkit calls this callback to read data from the backing store. C bytes starting at C in the backing store should be read and copied into C. nbdkit takes care of all bounds- and sanity-checking, so the plugin does not need to worry about that. The parameter C exists in case of future NBD protocol extensions; at this time, it will be 0 on input. The callback must read the whole C bytes if it can. The NBD protocol doesn't allow partial reads (instead, these would be errors). If the whole C bytes was read, the callback should return C<0> to indicate there was I error. If there is an error (including a short read which couldn't be recovered from), C<.pread> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head2 C<.pwrite> int pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags); During the data serving phase, nbdkit calls this callback to write data to the backing store. C bytes starting at C in the backing store should be written using the data in C. nbdkit takes care of all bounds- and sanity-checking, so the plugin does not need to worry about that. This function will not be called if C<.can_write> returned false. The parameter C may include C on input based on the result of C<.can_fua>. The callback must write the whole C bytes if it can. The NBD protocol doesn't allow partial writes (instead, these would be errors). If the whole C bytes was written successfully, the callback should return C<0> to indicate there was I error. If there is an error (including a short write which couldn't be recovered from), C<.pwrite> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head2 C<.flush> int flush (void *handle, uint32_t flags); During the data serving phase, this callback is used to L the backing store, ie. to ensure it has been completely written to a permanent medium. If that is not possible then you can omit this callback. This function will not be called directly by the client if C<.can_flush> returned false; however, it may still be called by nbdkit if C<.can_fua> returned C. The parameter C exists in case of future NBD protocol extensions; at this time, it will be 0 on input. If there is an error, C<.flush> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head2 C<.trim> int trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags); During the data serving phase, this callback is used to "punch holes" in the backing store. If that is not possible then you can omit this callback. This function will not be called if C<.can_trim> returned false. The parameter C may include C on input based on the result of C<.can_fua>. If there is an error, C<.trim> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head2 C<.zero> int zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags); During the data serving phase, this callback is used to write C bytes of zeroes at C in the backing store. This function will not be called if C<.can_zero> returned false. On input, the parameter C may include C unconditionally, C based on the result of C<.can_fua>, and C based on the result of C<.can_fast_zero>. If C is requested, the operation can punch a hole instead of writing actual zero bytes, but only if subsequent reads from the hole read as zeroes. If C is requested, the plugin must decide up front if the implementation is likely to be faster than a corresponding C<.pwrite>; if not, then it must immediately fail with C or C (whether by L or C) and preferably without modifying the exported image. It is acceptable to always fail a fast zero request (as a fast failure is better than attempting the write only to find out after the fact that it was not fast after all). Note that on Linux, support for C is insufficient for determining whether a zero request to a block device will be fast (because the kernel will perform a slow fallback when needed). The callback must write the whole C bytes if it can. The NBD protocol doesn't allow partial writes (instead, these would be errors). If the whole C bytes was written successfully, the callback should return C<0> to indicate there was I error. If there is an error, C<.zero> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. If this callback is omitted, or if it fails with C or C (whether by L or C), then C<.pwrite> will be used as an automatic fallback except when the client requested a fast zero. =head2 C<.extents> int extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents); During the data serving phase, this callback is used to detect allocated, sparse and zeroed regions of the disk. This function will not be called if C<.can_extents> returned false. nbdkit's default behaviour in this case is to treat the whole virtual disk as if it was allocated. Also, this function will not be called by a client that does not request structured replies (the I<--no-sr> option of nbdkit can be used to test behavior when C<.extents> is unavailable to the client). The callback should detect and return the list of extents overlapping the range C<[offset...offset+count-1]>. The C parameter points to an opaque object which the callback should fill in by calling C. See L below. If there is an error, C<.extents> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head3 Extents list The plugin C callback is passed an opaque pointer C. This structure represents a list of L describing which areas of the disk are allocated, which are sparse (“holesâ€), and, if supported, which are zeroes. The C callback should scan the disk starting at C and call C for each extent found. Extents overlapping the range C<[offset...offset+count-1]> should be returned if possible. However nbdkit ignores extents E offset so the plugin may, if it is easier to implement, return all extent information for the whole disk. The plugin may return extents beyond the end of the range. It may also return extent information for less than the whole range, but it must return at least one extent overlapping C. The extents B be added in ascending order, and B be contiguous. The C parameter of the C<.extents> callback may contain the flag C. This means that the client is only requesting information about the extent overlapping C. The plugin may ignore this flag, or as an optimization it may return just a single extent for C. int nbdkit_add_extent (struct nbdkit_extents *extents, uint64_t offset, uint64_t length, uint32_t type); Add an extent covering C<[offset...offset+length-1]> of one of the following four types: =over 4 =item C A normal, allocated data extent. =item C An unallocated extent, a.k.a. a “holeâ€, which reads back as zeroes. This is the normal type of hole applicable to most disks. =item C An allocated extent which is known to contain only zeroes. =item C An unallocated extent (hole) which does not read back as zeroes. Note this should only be used in specialized circumstances such as when writing a plugin for (or to emulate) certain SCSI drives which do not guarantee that trimmed blocks read back as zeroes. =back C returns C<0> on success or C<-1> on failure. On failure L and/or L has already been called. C will be set to a suitable value. =head2 C<.cache> int cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags); During the data serving phase, this callback is used to give the plugin a hint that the client intends to make further accesses to the given region of the export. The nature of caching/prefetching is not specified further by the NBD specification. For example, a server may place limits on how much may be cached at once, and there is no way to control if writes to a cached area have write-through or write-back semantics. In fact, the cache command can always fail and still be compliant, and success might not guarantee a performance gain. If this callback is omitted, then the results of C<.can_cache> determine whether nbdkit will reject cache requests, treat them as instant success, or emulate caching by calling C<.pread> over the same region and ignoring the results. This function will not be called if C<.can_cache> did not return C. The C parameter exists in case of future NBD protocol extensions; at this time, it will be 0 on input. A plugin must fail this function if C includes an unrecognized flag, as that may indicate a requirement that the plugin must comply with to provide a specific caching semantic. If there is an error, C<.cache> should call L with an error message, and L to record an appropriate error (unless C is sufficient), then return C<-1>. =head2 C<.errno_is_preserved> This field defaults to 0; if non-zero, nbdkit can reliably use the value of C when a callback reports failure, rather than the plugin having to call L. =head1 UMASK All plugins will see a L of C<0022>. =head1 PARSING COMMAND LINE PARAMETERS nbdkit provides several functions to help plugins and filters to parse command line parameters. These are documented in separate man pages: =over 4 =item Parse disk sizes (eg. C) L =item Parse numbers L L L L L L L L L L =item Parse booleans (eg. C) L =item Parse probabilities (eg. C) L =item Parse delays and sleeps (eg. C) L =item Reading passwords and other secrets L =item Safely interacting with stdin and stdout L =item Filenames and paths L L =back =head1 SLEEPING A plugin or filter that needs to sleep may call L, L and similar. However that can cause nbdkit to delay excessively when shutting down (since it must wait for any plugin or filter which is sleeping). To avoid this plugins and filters should call L instead. =head1 EXPORT NAME AND TLS If the client negotiated an NBD export name with nbdkit then plugins may read this from any connected callback. Nbdkit's normal behaviour is to accept any export name passed by the client, log it in debug output, but otherwise ignore it. By calling L plugins may choose to filter by export name or serve different content. L can be used to find the status of TLS negotiation on the current connection. =head1 STRING LIFETIME Some callbacks are specified to return C, even when a plugin may not have a suitable compile-time constant to return. Returning dynamically-allocated memory for such a callback would induce a memory leak or otherwise complicate the plugin to perform additional bookkeeping. For these cases, nbdkit provides several convenience functions for creating a copy of a string for better lifetime management: L, L, L, L. =head1 PEER NAME In any connected callback you can get the source address of the client using L. If the client is connected over a Unix domain socket, you may also be able to get the client process ID, user ID, group ID and security context using: L, L, L and L. If the client is connected using TLS and presented a client certificate then the Distinguished Name (DN) may be read using L and the issuer's DN by L. =head1 SHUTDOWN When nbdkit receives certain signals it will shut down (see L). The server will wait for any currently running plugin callbacks to finish, call C<.close> on those connections, then call the C<.cleanup> and C<.unload> callbacks before unloading the plugin. Note that it's not guaranteed this can always happen (eg. the server might be killed by C or segfault). See L and L for how to request server shutdown or client disconnection from within plugins. =head1 VERSION =head2 Compile-time version of nbdkit The macros C, C and C expand to integers containing the version of the nbdkit headers that you are compiling against. C is always 1. C is even for stable releases of nbdkit and odd for development releases. The macro C expands to the same version as a string. =head2 Run-time version of nbdkit When the plugin is loaded into nbdkit, it may not be the same version that it was compiled against. nbdkit guarantees backwards compatibility of the API and ABI, so provided that nbdkit is the same version or newer, the plugin will still work. There is no way to get the version of nbdkit from the plugin. =head2 Version of the plugin The plugin itself can use any versioning scheme you want, and put any string into the C<.version> field of the plugin struct (or leave the field NULL). =head2 API version See L above. =head1 DEBUGGING Run the server with I<-f> and I<-v> options so it doesn't fork and you can see debugging information: nbdkit -fv ./myplugin.so [key=value [key=value [...]]] To print debugging information from within the plugin, call L. Note that L only prints things when the server is in verbose mode (I<-v> option). =head2 Debug Flags The I<-v> option switches general debugging on or off, and this debugging should be used for messages which are useful for all users of your plugin. In cases where you want to enable specific extra debugging to track down bugs in plugins or filters — mainly for use by the plugin/filter developers themselves — you can define Debug Flags. These are global ints called C: int myplugin_debug_foo; int myplugin_debug_bar; ... if (myplugin_debug_foo) { nbdkit_debug ("lots of extra debugging about foo: ..."); } Debug Flags can be controlled on the command line using the I<-D> (or I<--debug>) option: nbdkit -f -v -D myplugin.foo=1 -D myplugin.bar=2 myplugin [...] Note C is the name passed to C<.name> in the C. You should only use this feature for debug settings. For general settings use ordinary plugin parameters. Debug Flags can only be C ints. They are not supported by non-C language plugins. For convenience C<'.'> characters are replaced with C<'_'> characters in the variable name, so both of these parameters: -D myplugin.foo_bar=1 -D myplugin.foo.bar=1 correspond to the plugin variable C. =head1 COMPILING THE PLUGIN Plugins should be compiled as shared libraries. There are various ways to achieve this, but most Linux compilers support a I<-shared> option to create the shared library directly, for example: gcc -fPIC -shared myplugin.c -o myplugin.so Note that the shared library will have undefined symbols for functions that you call like L or L. These will be resolved by the server binary when nbdkit dlopens the plugin. =head2 PKG-CONFIG/PKGCONF nbdkit provides a pkg-config/pkgconf file called C which should be installed on the correct path when the nbdkit plugin development environment is installed. You can use this in autoconf F scripts to test for the development environment: PKG_CHECK_MODULES([NBDKIT], [nbdkit >= 1.2.3]) The above will fail unless nbdkit E 1.2.3 and the header file is installed, and will set C and C appropriately for compiling plugins. You can also run pkg-config/pkgconf directly, for example: if ! pkg-config nbdkit --exists; then echo "you must install the nbdkit plugin development environment" exit 1 fi You can also substitute the plugindir variable by doing: PKG_CHECK_VAR([NBDKIT_PLUGINDIR], [nbdkit], [plugindir]) which defines C<$(NBDKIT_PLUGINDIR)> in automake-generated Makefiles. If nbdkit development headers are installed in a non-standard location then you may need to compile plugins using: gcc -fPIC -shared myplugin.c -o myplugin.so \ `pkg-config nbdkit --cflags --libs` =head1 INSTALLING THE PLUGIN The plugin is a C<*.so> file and possibly a manual page. You can of course install the plugin C<*.so> file wherever you want, and users will be able to use it by running: nbdkit /path/to/plugin.so [args] However B the shared library has a name of the form C-plugin.so> B the library is installed in the C<$plugindir> directory, then users can be run it by only typing: nbdkit name [args] The location of the C<$plugindir> directory is set when nbdkit is compiled and can be found by doing: nbdkit --dump-config If using the pkg-config/pkgconf system then you can also find the plugin directory at compile time by doing: pkg-config nbdkit --variable=plugindir =head1 WRITING PLUGINS IN C++ Plugins in C++ work almost exactly like those in C, but the way you define the C struct is slightly different: namespace { nbdkit_plugin create_plugin() { nbdkit_plugin plugin = nbdkit_plugin (); plugin.name = "myplugin"; plugin.open = myplugin_open; plugin.get_size = myplugin_get_size; plugin.pread = myplugin_pread; plugin.pwrite = myplugin_pwrite; return plugin; } } static struct nbdkit_plugin plugin = create_plugin (); NBDKIT_REGISTER_PLUGIN(plugin) =head1 WRITING PLUGINS IN OTHER PROGRAMMING LANGUAGES You can also write nbdkit plugins in Go, Lua, OCaml, Perl, Python, Rust, shell script or Tcl. Other programming languages may be offered in future. Ruby plugin support was removed in nbdkit 1.40. For more information see: __LANG_PLUGIN_LINKS__. Plugins written in scripting languages may also be installed in C<$plugindir>. These must be called C-plugin> without any extension. They must be executable, and they must use the shebang header (see L). For example a plugin written in Perl called C might be installed like this: $ head -1 foo.pl #!/usr/sbin/nbdkit perl =for paragraph $ sudo install -m 0755 foo.pl $plugindir/nbdkit-foo-plugin and then users will be able to run it like this: $ nbdkit foo [args ...] =head1 SEE ALSO L, L, L, L. Utility functions provided by nbdkit for plugins and filters to use: L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L. L. L, L, L, L, L, L, L, L, L, L, L, L. Standard plugins provided by nbdkit: __PLUGIN_LINKS__. =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-probing.pod0000644000175000017500000001124414771245250013112 =head1 NAME nbdkit-probing - how to probe for nbdkit configuration and plugins =head1 SYNOPSIS nbdkit --dump-config =for paragraph nbdkit PLUGIN --dump-plugin =for paragraph nbdkit --version =for paragraph nbdkit PLUGIN --version =for paragraph nbdkit --filter=FILTER null --version =for paragraph nbdkit --filter=FILTER null --dump-plugin =head1 DESCRIPTION You can query information about nbdkit and available plugins and filters using the nbdkit binary. This can include whether nbdkit is installed, and whether plugins or filters are installed. =head2 Query if nbdkit is installed Use this command to see if the nbdkit program is installed: nbdkit --version This will fail with an error and non-zero exit code if nbdkit is not installed or not working. =head2 Query basic configuration nbdkit --dump-config lists information about how nbdkit was configured. The most important fields in the output are the name of the directory where nbdkit looks for plugins and the version of nbdkit, eg: plugindir=/usr/lib64/nbdkit/plugins version=1.20.1 version_major=1 version_minor=20 =head2 Test nbdkit E version To test if nbdkit E a particular version is installed, use the I<--dump-config> option and look for the C and C fields: $ nbdkit --dump-config | grep ^version_minor version_minor=20 $ major=$( nbdkit --dump-config | grep ^version_major | cut -d= -f2 ) $ minor=$( nbdkit --dump-config | grep ^version_minor | cut -d= -f2 ) $ if [ $major -eq 1 ] && [ $minor -lt 12 ] then echo 'nbdkit >= 1.12 is required'; exit 1; fi These fields were first added in nbdkit 1.16.5 and were not present in earlier versions. You can also probe the minimum version using L. See L. =head2 Query information about a particular plugin nbdkit pluginname --dump-plugin (where I is the name or full path of a plugin) will dump information about that plugin, eg: $ nbdkit file --dump-plugin path=/usr/lib64/nbdkit/plugins/nbdkit-file-plugin.so name=file version=1.20.1 api_version=1 struct_size=176 thread_model=serialize_requests [etc] Plugins which ship with nbdkit usually have the same version as the corresponding nbdkit binary. The nbdkit binary will always be able to utilize plugins compiled against an older version of the header; however, newer plugins may not be fully supported by an older nbdkit binary (for example, a plugin compiled with C of 2 fails to load with an older nbdkit that only knows C 1). =head2 Query information about a particular filter You can use the I<--dump-plugin> option to dump information about a filter, by using the null plugin with the I<--filter> parameter: $ nbdkit null --filter=qcow2dec --dump-plugin [...] qcow2dec_path=/usr/lib64/nbdkit/filters/nbdkit-qcow2dec-filter.so qcow2dec_name=qcow2dec qcow2dec_deflate=yes qcow2dec_zstd=yes =head2 Detect if a plugin is installed To find out if a plugin is installed (and working) in the plugin directory, use: $ nbdkit foo --version nbdkit: error: cannot open plugin 'foo': /usr/lib64/nbdkit/plugins/nbdkit-foo-plugin.so: cannot open shared object file: No such file or directory Use 'nbdkit --help' or read the nbdkit(1) manual page for documentation. This will fail with an error and non-zero exit code if the C plugin cannot be loaded. Note it is better to test for the existence of plugins this way rather than just seeing if the F<.so> file exists, because nbdkit will load the plugin and check that all its dependencies can be satisfied, and also that plugin registration works. =head2 List all plugins in the plugin directory You could simply get the plugin directory (from I<--dump-config>) and list all files in this directory called F. However a better test is to run I<--dump-plugin> (see above) on each one to check that it is working and all of its dependencies are installed. A complete shell script which does this is: #!/bin/sh - plugindir=`nbdkit --dump-config | grep ^plugindir= | sed 's/[^=]*=//'` for f in $plugindir/nbdkit-*-plugin.so; do if nbdkit "$f" --version >/dev/null 2>&1; then b=`echo "$f" | sed 's,.*/nbdkit-\(.*\)-plugin.so$,\1,'` echo "$b ($f)" fi done =head2 Detect if a filter is installed To find out if a filter is installed (and working) use I<--version> with the C plugin and the name of the filter to test: nbdkit --version --filter=foo null This will fail with an error and non-zero exit code if the C filter cannot be loaded. =head1 SEE ALSO L. =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-protocol.pod0000644000175000017500000002146014623341243013307 =head1 NAME nbdkit-protocol - which parts of the NBD protocol nbdkit supports =head1 SYNOPSIS nbdkit [-n|--newstyle] [--mask-handshake MASK] [--no-mc|--no-meta-contexts] [--no-sr|--no-structured-replies] [-o|--oldstyle] [...] =head1 DESCRIPTION This page documents the level of support in nbdkit for various parts of the NBD protocol. =head1 NEW STYLE VS OLD STYLE PROTOCOL The NBD protocol comes in two incompatible forms that we call "oldstyle" and "newstyle". Unfortunately which protocol you should use depends on the client and cannot be known in advance, nor can it be negotiated from the server side. nbdkit defaults to the newstyle protocol since nbdkit E 1.3 (the command line flag I<-n> or I<--newstyle> is ignored for backwards compatibility with older versions). The newstyle protocol is better in every respect than the oldstyle protocol and you should prefer it if possible. The newstyle protocol also includes extensions where a client may request structured replies for even more capabilities, such as sparse reads or meta contexts for obtaining block status. By default, nbdkit advertises as many features as it can support (in some cases, this can be limited by what callbacks the plugin handles), even if the client does not negotiate to use all advertised features. Nbdkit also includes some options that are useful mainly when performing integration tests, for proving whether clients have sane fallback behavior when dealing various older servers permitted by the NBD protocol. The following options intentionally disable optional parts of the NBD protocol, with successively larger impacts: =over 4 =item B<--no-mc> =item B<--no-meta-contexts> Force the newstyle protocol to treat all requests for meta context negotiation from the client as unsupported; the client will be unable to query block status. By default, nbdkit gracefully handles all meta context requests, even though it currently supports only the C context (possibly by synthesizing a context that represents an all-data disk when the plugin lacks support for extents); but treating meta contexts as unsupported is useful for emulating nbd-server 3.25. =item B<--no-sr> =item B<--no-structured-replies> Force the newstyle protocol to decline any client request for structured replies; this is stronger than I<--no-meta-contexts> in that it also disables the opportunity for sparse reads. This is useful for emulating nbd-server 3.24. =item B<--mask-handshake=>MASK Alter the mask of which particular global features are advertised during new-style handshake (defaulting to all supported bits set). Clearing bit 0 (the low order bit) limits a client to using just C (incompatible with TLS, and includes all effects of I<--no-sr>); clearing bit 1 causes the handshake to send more padding bytes in response to C. Other bits in the mask will only have an effect if the NBD protocol is extended in the future to define other global bits. =item B<-o> =item B<--oldstyle> Force the oldstyle protocol. In this mode, I<--no-meta-contexts>, I<--no-sr> and I<--mask-handshake> have no effect. =back =head2 Common clients and the protocol they require Client Protocol ------------------------------------------------------------ qemu <= 2.5 without exportname oldstyle qemu <= 2.5 with exportname newstyle qemu >= 2.6 client can talk either protocol qemu >= 2.11 client tries structured replies nbd-client < 3.10 client can talk either protocol nbd-client >= 3.10 newstyle, no structured replies any TLS (encrypted) client newstyle nbdkit nbd plugin client can talk either protocol nbdkit >= 1.13.3 nbd plugin tries structured replies libnbd either protocol, tries structured replies =head2 Errors seen if using the wrong protocol If you use qemu E 2.5 without the exportname field against a newstyle server, it will give the error: Server requires an export name If you use qemu E 2.5 with the exportname field against an oldstyle server, it will give the error: Server does not support export names If you use the oldstyle protocol with nbd-client E 3.10, it will give the error: Error: It looks like you're trying to connect to an oldstyle server. =head2 NBD protocol and port number Port 10809/tcp is reserved by IANA for the NBD protocol, but you can use nbdkit on any port or on Unix domain sockets. The NBD protocol specification claims that you should always use newstyle when using port 10809, and use oldstyle on all other ports, but this claim is not based on the reality of what NBD servers do, and nbdkit does not require or encourage this. =head1 NBD PROTOCOL FEATURES SUPPORTED BY NBDKIT =over 4 =item newstyle protocol Supported in nbdkit E 1.1.12, and the default in nbdkit E 1.3. =item export names Partially supported in nbdkit E 1.1.12. Support for plugins to read the client export name added in nbdkit E 1.15.2. Versions of nbdkit before 1.16 could advertise a single export name to clients, via a now deprecated side effect of the I<-e> option. In nbdkit 1.15.2, plugins could read the client requested export name using L and serve different content. In nbdkit 1.21.22, plugins could implement C<.list_exports> to answer C queries. =item C Supported in nbdkit E 1.1.13. This protocol optimization avoids sending a useless block of zero bytes during protocol negotiation. =item C Supported in nbdkit E 1.1.13. =item TLS with X.509 certificates Supported in nbdkit E 1.1.15. =item TLS with Pre-Shared Keys (PSK) Supported in nbdkit E 1.4.0. =item C Supported in nbdkit E 1.5.3. This protocol enhancement allows the server to return errors when negotiating the export name. =item C Supported in nbdkit E 1.9.3. This protocol enhancement allows a client to inspect details about the export without actually connecting. =item C Supported in nbdkit E 1.9.9. =item Structured Replies Supported in nbdkit E 1.11.8. However we don’t expose the capability to send structured replies to plugins yet, nor do we send human-readable error messages using this facility. In nbdkit E 1.13.9, the command-line option I<--no-sr> can be used to disable server support for structured replies, for testing client fallbacks; disabling structured replies also disables features like block status queries that depend on structured replies. =item Metadata Querying Supported in nbdkit E 1.11.8. In nbdkit E 1.37.9, the command-line option I<--no-meta-contexts> can be used to disable server support for meta contexts, for testing client fallbacks. =item Block Status Supported in nbdkit E 1.11.10. Only C (ie. querying which parts of an image are sparse) is supported. Sparse reads (using C are not directly supported, but a client can use block status to infer which portions of the export do not need to be read. =item C Supported in nbdkit E 1.11.11. This protocol extension allows a client to force an all-or-none read when structured replies are in effect. However, the flag is a no-op until we extend the plugin API to allow a fragmented read in the first place. =item C Supported in nbdkit E 1.13.4. This protocol extension allows a client to inform the server about intent to access a portion of the export, to allow the server an opportunity to cache things appropriately. =item C Supported in nbdkit E 1.15.0. This protocol extension allows a server to advertise that it can rank all zero requests as fast or slow, at which point the client can make fast zero requests which fail immediately with C if the request is no faster than a counterpart write would be, while normal zero requests still benefit from compressed network traffic regardless of the time taken. =item C, C Supported in nbdkit E 1.23.6. These protocol extensions allow a client to learn more information about an export during C. The C<.default_export> callback can inform a client of a canonical non-empty name in place of the default export C<"">, and the C<.export_description> callback can give a client more details about the export. =item C Supported in nbdkit E 1.30. =item Resize Extension I. =item Extended Headers Extension I. =back =head1 SEE ALSO L, L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_read_password.pod0000644000175000017500000000376214623341243014372 =head1 NAME nbdkit_read_password - read passwords and other secrets for nbdkit =head1 SYNOPSIS #include int nbdkit_read_password (const char *value, char **password); =head1 DESCRIPTION The C utility function can be used to read passwords from config parameters. The C result string is allocated by malloc, and so you may need to free it. =head2 Example char *password = NULL; static int myplugin_config (const char *key, const char *value) { .. if (strcmp (key, "password") == 0) { free (password); if (nbdkit_read_password (value, &password) == -1) return -1; } .. } =head2 Password formats This function recognizes several password formats. A password may be used directly on the command line, eg: nbdkit myplugin password=mostsecret But more securely this function can also read a password interactively: nbdkit myplugin password=- or from a file: nbdkit myplugin password=+/tmp/secret or from a file descriptor inherited by nbdkit: nbdkit myplugin password=-99 =head2 Notes on reading passwords If the password begins with a C<-> or C<+> character then it must be passed in a file. C can only be used when stdin is a terminal. C cannot be used with stdin, stdout or stderr (ie. C<-0>, C<-1> or C<-2>). The reason is that after reading the password the file descriptor is closed, which causes bad stuff to happen. =head1 RETURN VALUE The function returns 0 on success. If there is an error it calls L and returns C<-1>. =head1 LANGUAGE BINDINGS In L: NBDKit.read_password : string -> string In L: import nbdkit password = nbdkit.parse_size(value) =head1 HISTORY C was added in nbdkit 1.12. =head1 SEE ALSO L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_realpath.pod0000644000175000017500000000426214623341243013331 =head1 NAME nbdkit_realpath, nbdkit_absolute_path - convert relative to absolute paths for nbdkit =head1 SYNOPSIS #include char *nbdkit_realpath (const char *filename); char *nbdkit_absolute_path (const char *filename); =head1 DESCRIPTION L usually (not always) changes directory to F before it starts serving connections. This means that any relative paths passed during configuration will not work when the server is running. In a naive implementation of a plugin, a configuration like nbdkit plugin file=disk.img might attempt to open F instead of the file in the user's current directory. To avoid this problem, you can: =over 4 =item * convert relative paths to absolute paths using one of the functions described here, or =item * open the file at configure time and store the file descriptor. =back =head2 nbdkit_realpath The utility function C converts any path to an absolute path, resolving symlinks. Under the hood it uses the L function, and thus it fails if the path does not exist, or it is not possible to access components of the path. This function works I when used in the C<.config>, C<.config_complete> and C<.get_ready> callbacks. =head2 nbdkit_absolute_path The utility function C converts any path to an absolute path: if it is relative, then all this function does is prepend the current working directory to the path, with no extra checks. Unlike C, this function does not check that the file exists. This function works I when used in the C<.config>, C<.config_complete> and C<.get_ready> callbacks. =head1 RETURN VALUE On success these functions return a newly allocated string. The returned string must be freed by the caller. On error these call L and return C. =head1 LANGUAGE BINDINGS In L: NBDKit.realpath : string -> string =head1 HISTORY C was present in nbdkit 0.1.0. C was added in nbdkit 1.4. =head1 SEE ALSO L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.4.pod0000644000175000017500000000301114534316443014511 =head1 NAME nbdkit-release-notes-1.4 - release notes for nbdkit 1.4 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.4. This describes the major changes since 1.2. nbdkit 1.4.0 was released on 6th July 2018. =head2 New features =over 4 =item * You can write plugins in Tcl, see L. =item * Other new plugins: nbdkit-ext2-plugin, L, L. =item * New filters: L, L, L, L. =item * Bash tab completion of nbdkit commands. =item * TLS Pre-Shared Keys (PSK) authentication. =item * We now default to the newstyle protocol, use -o to select oldstyle. =item * On-demand ramping of thread pool. =item * TRIM support in the file plugin. =item * Reworked error handling. =item * New C, C methods and better handling of FUA. =item * New C function. =item * C rewritten. =item * Better handling of shutdown path to ensure plugins can do long cleanups. =item * New C variables. =item * Regression test for IPv6 connections. =item * Of course numerous smaller bug fixes and improvements. =back =head2 Acknowledgements Thanks in particular to Eric Blake and Pino Toscano. =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.6.pod0000644000175000017500000000460614534316443014526 =head1 NAME nbdkit-release-notes-1.6 - release notes for nbdkit 1.6 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.6. This describes the major changes since 1.4. nbdkit 1.6.0 was released on 28th August 2018. =head2 New features =over 4 =item * You can now write plugins in the Lua scripting language, see L. =item * nbdkit and common plugins are now "63 bit clean": the maximum disk size supported is 2â¶Â³-1 bytes, and the core server and plugins now have additional tests to check this works, even on 32 bit machines. =item * Multiple improvements to the L to make zeroing and trimming perform better, work correctly with block devices, and work on older Linux kernels [Nir Soffer, Eric Blake]. =item * New L generates a simple, fixed test pattern for testing nbdkit filters and NBD clients. =item * New L can: truncate or extend the size of plugins, or round up or down the size to next multiple of a power of 2. Useful for NBD clients like qemu which can only handle NBD sizes which are a multiple of 512 bytes. =item * New L which can be used to inject errors into the protocol for testing how clients can handle and recover from errors. =item * New L allows you to specify (small) disk images directly on the command line. =item * Enhanced error reporting in the Python plugin so full tracebacks from errors are now displayed instead of being lost as before. =item * C now supported, so we can return errors when negotiating the export name. =item * Support for logging error messages to syslog. =item * nbdkit can now be compiled with Clang (as well as GCC). =item * nbdkit can now be compiled on FreeBSD. =item * L is compiled unconditionally. You no longer need to install the proprietary VDDK to compile it. =item * Debug messages now include the name of the filter when invoked from a filter context. =item * Debug flags (I<-D> option) provides lightweight debugging for plugin authors. =back =head2 Acknowledgements Thanks to all who contributed, especially Nir Soffer and Eric Blake. =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.8.pod0000644000175000017500000000431214623341243014515 =head1 NAME nbdkit-release-notes-1.8 - release notes for nbdkit 1.8 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.8. This describes the major changes since 1.6. nbdkit 1.8.0 was released on 12th November 2018. =head2 New features =over 4 =item * New plugin: L for running shell scripts and other external programs. See: L =item * New plugin: L which creates a partitioned disk from a list of partitions in files. =item * New plugin: L which creates an ISO (CD-ROM) image on the fly from a directory of files. See: L =item * New plugin: L which creates a virtual FAT-formatted floppy disk from a directory of files. L =item * Magic config key allows simpler invocation of many plugins, eg: nbdkit file file=foo becomes: nbdkit file foo =item * L: Add F script to generate data parameters. =item * L Use C<<< >> to inline a file. =item * L: Use S> to enable extra debug information. =item * tests: Use a helper function to refactor and simplify most tests. =item * L: Can handle E 128 GPT partitions. =item * nbdkit can be compiled on the Haiku operating system (François Revol). =item * New C API for parsing boolean parameters (Eric Blake). =item * L: Add C (Eric Blake). =item * L: New C and C calls. =item * Analyze code under AddressSanitizer and ThreadSanitizer and fix bugs (Eric Blake). =item * Analyze code under Coverity and fix bugs. =item * Tests now run more quickly. =back =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.10.pod0000644000175000017500000000536614623341243014600 =head1 NAME nbdkit-release-notes-1.10 - release notes for nbdkit 1.10 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.10. This describes the major changes since 1.8. nbdkit 1.10.0 was released on 18th January 2019. =head2 New features =over 4 =item * Implemented C which greatly improves performance for clients that support it. =item * Implemented C (Eric Blake). =item * L and L: By adding fine-grained locking, these plugins now use the fully parallel thread model. =item * L: The size of the cache can now be limited, and the cache reclaims space using an LRU algorithm. It has also been enhanced to support cache-on-read mode. The filter now uses a fully parallel thread model. =item * L: Use a fully parallel thread model. =item * L: Inline scripts: L =item * L: Full API version 2 is now supported. =item * L: Full API version 2 is now supported. =item * L allows you to specify the read, write, zero and trim delays individually. =item * L: Add support for connecting to servers over Unix domain sockets. =item * Bash tab completion has been improved: Partial plugin names are expanded correctly, and plugin parameters containing C<-> work. =item * Public header files can now be consumed by ISO C90 compilers (but GCC or Clang is still required to compile nbdkit itself). =item * A better non-cryptographically secure pseudo-random number generator (xoshiro256** 1.0) is now used on all platforms, replacing previous uses of L. =item * Fuzzing using American Fuzzy Lop is now supported, and was carried out, resulting in one error being found in the server (not security related). =item * New L: This replaces nbdkit-xz-plugin which will be removed in nbdkit 1.12. =item * New L man page documenting how to use nbdkit for loop mounts. See also: L =item * New L: Returns C on every request. =item * C, C and C are used in internal header files to improve code quality. =item * Logging using C<%m> now works on all platforms, not just on Linux with glibc (Eric Blake). =item * VPATH builds partially supported (Eric Blake). =back =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.12.pod0000644000175000017500000000675114534316443014606 =head1 NAME nbdkit-release-notes-1.12 - release notes for nbdkit 1.12 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.12. This describes the major changes since 1.10. nbdkit 1.12.0 was released on 10th April 2019. =head2 New features New L which lets you turn any disk image on a remote Unix server accessible by ssh into an NBD source. New L for bandwidth-limiting connections. Either single connections or the whole server can be bandwidth-limited, and the limit can be dynamically changed at runtime. New L improves performance when reading sequentially from plugins with a high request overhead like curl. New L lets you create complete ext2, ext3 or ext4 filesystems in a GPT partitioned disk image, from a local directory. This can be attached to existing Linux VMs or used to create new ones from scratch. New L can make sparse disks appear fully allocated. Plugins can now be written in the Rust programming language, see L. The old nbdkit-xz-plugin has been removed. Use nbdkit --filter=xz file file.xz as a replacement. This filter can be placed on top of other plugins such as curl (for decompressing a remote web URL). C has been implemented allowing clients to query which parts of the disk are allocated, holes or zeroes. Plugins and filters have been extended to supply this information in many cases. This required adding minimal support for NBD protocol Structured Replies, C and C. (Thanks to Eric Blake for extensive help with this one.) L has been updated to VDDK 6.7, but now also works back as far as VDDK 5.1.1. It supports extents, flush and FUA. Also added: new flags C and C. (Thanks to Martin Kletzander). The line "All rights reserved." was removed from the license, with the agreement of all nbdkit contributors. Note this does not change the license. C errors are printed in red when writing to the terminal, making them much easier to see. C rejects negative values, eg. S> (Nikolay Ivanets). L now supports cookies, password auth and proxies. It can also limit URLs to whitelisted protocols. This makes it broadly feature equivalent to and a replacement for the qemu curl block driver. L can now create MBR logical partitions. Previously it only supported 4 MBR primary partitions and if you wanted more than that you had to use GPT. L also supports MBR logical partitions. L creates plugins which are compatible with Python >= 3.7. Tests are now run under C and C>. This causes some tests to crash (silently) because of a shutdown race which needs to be fixed. Test shell scripts now have a generic C function to skip tests if features are not present. C99 type C is now used in most places where appropriate. The protocol and connections code in the server has been split up because the single file had grown very large. (Thanks to Eric Blake for helping with protocol issues). =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.14.pod0000644000175000017500000000723214534316443014603 =head1 NAME nbdkit-release-notes-1.14 - release notes for nbdkit 1.14 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.14. This describes the major changes since 1.12. nbdkit 1.14.0 was released on 28th August 2019. =head2 New features Server performance improvements: Nagle’s algorithm is disabled; instead C is used to control when outgoing packets are sent. Ramdisk plugins now support more efficient zeroing. (Eric Blake). Plugins can now select their thread model at run time. Thread model selection is not finalized until after the config stage (Eric Blake). The server supports C for prefetching. Plugins and filters have been updated to implement this where it makes sense (Eric Blake). Low level pthread lock failures now call L. This should never happen in real situations (Eric Blake). The server will not advertize multi-conn support if the internal thread model is serialized, avoiding a possible deadlock in some clients (Eric Blake). New server option I<--no-sr> can be used to disable structured replies (Eric Blake). The server will now refuse to start if stdin/stdout/stderr are closed, to avoid potential issues with file descriptor handling in plugins (Eric Blake). C<$uri> can be used to specify an NBD URI in I<--run> parameters (Eric Blake). New L displays elapsed statistics about NBD operations, such as the number of bytes read and written. New L which disables cache requests, used to determine how effective they are (Eric Blake). New L which can be used to override the plugin’s own choice of thread model. Used to determine how the thread model affects performance, or to serialize plugins if required (Eric Blake). New L to cache extents requests, especially useful with VDDK which has a slow implementation of extents (Martin Kletzander). In L, L, L, L and L, the C prefix can be omitted, ie: S> (instead of C). L has multiple enhancements (all added by Eric Blake): =over 4 =item * It may be built using libnbd instead of constructing raw NBD packets. =item * C is supported. =item * Add structured reads. =item * Implement C. =item * Supports TCP sockets. =item * Forwards C. =item * Retry connections. =item * Shared connections. =item * Magic C parameter. =item * TLS support. =back L now reports hole extents correctly when using the C flag (Martin Kletzander). L and L now avoid copying data through a bounce buffer when it is already sufficiently aligned (Eric Blake). Filters (such as L and L) which sleep no longer cause long delays when the server is shut down (Eric Blake). Multiple fixes to L (Martin Kletzander). Multiple enhancements and clean ups to the test suite which should make tests better and more reliable. OCaml plugins can now use C, C, C calls, and there is also a new example plugin. On platforms which lack atomic C support the most serialized thread model is always selected to avoid leaking file descriptors (Eric Blake). =head1 SEE ALSO L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.16.pod0000644000175000017500000001207414623341243014600 =head1 NAME nbdkit-release-notes-1.16 - release notes for nbdkit 1.16 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.16. This describes the major changes since 1.14. nbdkit 1.16.0 was released on 14th November 2019. =head2 Security Two security issues were found during development of nbdkit 1.16. Fixes for these were backported to older stable branches. Upgrading to the fixed versions is highly recommended. The new L man page contains an up to date list of past security issues. =head3 CVE-2019-14850 denial of service due to premature opening of back-end connection See the full announcement and links to mitigation, tests and fixes here: L =head3 CVE-2019-14851 assertion failure by issuing commands in the wrong order This CVE was caused by the fix to the previous issue. See the full announcement and links to mitigation, tests and fixes here: L =head2 New features Add support for fast zeroing. Plugins can expose this using the new C<.can_fast_zero> method (Eric Blake). L allows use of C or C to go back to the default MBR byte or partition type GUID. New I<--mask-handshake> server flag can be used for testing client feature negotiation (Eric Blake). The client export name is passed to L I<--run> parameter as C<$exportname> (Eric Blake). Captive I<--run> commands which fail (eg. aborting) now cause nbdkit to exit with an error instead of errors being silently ignored (Eric Blake). File descriptors can be passed to password parameters, eg: C which means that the password should be read from file descriptor 3. nbdkit can now serve over the C protocol (thanks Stefan Hajnoczi). New I<--log=null> option discards error messages. =head2 Plugins Python 2 support has been B from L in line with Python 2 end of life at the beginning of 2020. Python E 3.3 is required by this plugin. If you wish to continue to use Python 2 then you will need to use nbdkit 1.14. New L which returns various server information back to the client. It can be used for testing server latency amongst other things. L now allows you to write C to get repeated bytes (eg. S>). L new parameter C to control transport compression. L is no longer compiled on non-x86 platforms since VMware has only ever shipped VDDK on x86. L scripts can now see the client exportname and can use the C feature. =head2 Filters New L which can reopen the plugin transparently on certain types of failures (lots of help from Eric Blake). =head2 API Macros C, C, C expose the compile-time version of nbdkit to plugins and filters (Eric Blake). Filters (which unlike plugins do I have a public stable API) must now exactly match the version of nbdkit when loaded (Eric Blake). New C<.can_fast_zero> method (Eric Blake). New C server function for reading the export name passed by the client. New C server function to return the client address (like L). New server functions for safely parsing integers: C, C, C, C, C, C, C, C, C, C. =head2 Bug fixes C<.trim> with FUA flag set now works (Eric Blake). =head2 Documentation The previous release notes have been turned into man pages. =head2 Tests Several tests now optionally use L instead of qemu-io. You can now fuzz nbdkit using either American Fuzzy Lop or clang’s libFuzzer. Several tests have had sleep times increased to make them more stable when run on slow or heavily loaded machines. =head2 Internals Reproducible builds (Chris Lamb). Compile code with I<-Wshadow> warning (Eric Blake). The internal backend system has been extensively overhauled. In particular this means that we now validate request ranges as requests are passed between filters and down to the plugin, making it easier to find bugs in filters early (Eric Blake). Plugin size and C flags are cached more aggressively by the server (Eric Blake). Variable Length Arrays (VLAs) on stack are now banned throughout the code. The F header describing the NBD protocol is now shared with L. Plugin C<.unload> method is now called after all worker threads have exited, avoiding races at server shutdown. Code was audited using Coverity and various problems were fixed. =head1 SEE ALSO L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.18.pod0000644000175000017500000001520314534316443014604 =head1 NAME nbdkit-release-notes-1.18 - release notes for nbdkit 1.18 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.18. This describes the major changes since 1.16. nbdkit 1.18.0 was released on 27th February 2020. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L lets you write a plugin entirely on a single command line. It is similar to L. nbdkit-ext2-plugin is deprecated and will be removed in the next release after this one (S). As a replacement use L like this: nbdkit --filter=ext2 file fs.img ext2file=/disks/disk.raw L now offers a version 2 API which avoids copying the data buffer, improving performance. The original protocol (now retrospectively called version 1) is still supported for backwards compatibility. The version 1 protocol was also enhanced to support the buffer protocol for the pread method, and memoryview for pwrite, improving performance by reducing copies (Nir Soffer). The Python plugin now prints readable stack traces when an exception is thrown (Nir Soffer). New methods implemented in the Python plugin: cache, can_cache, can_zero, can_fast_zero, can_multi_conn, can_fua. In L, new options C and C (Wiktor GoÅ‚gowski). L now supports extents (Eric Blake). In L, C is now a magic config key, meaning it can be omitted in most circumstances (Eric Blake). The VDDK plugin now no longer needs C<$LD_LIBRARY_PATH> to be set. The correct library load path is automatically inferred from the C parameter (Eric Blake). Verbose messages about calls to VDDK functions Read and Write can now be suppressed by setting S>. =head2 Filters New L, which replaces the deprecated nbdkit-ext2-plugin. This filter allows you to read and write files inside ext2, ext3 or ext4 filesystems. The new filter has the same features as the plugin, and one enhancement: optionally the name of the file to serve can be picked from the client-supplied exportname. The old plugin will be removed in S (Eric Blake). New L lets you specify a static list of extents from a file which can be placed on top of plugins which don't export extent information. New L lets you allow and deny incoming connections by client IP address, similar to TCP wrappers or a firewall. New L is a null filter, used for testing. The stats filter now collects time elapsed per operation, per operation and total rates, and adds stats for the flush method. The output is shown in human sizes making it easier to understand. (Nir Soffer). =head2 Server New I<--swap> option which allows nbdkit to be safely used to serve swap space to the same machine. Debug flags (I<-D>) can now be applied to the server core (using S>). Underscores in debug flags can now be replaced by dots, allowing a kind of namespacing. Debug flags which are not consumed now no longer give an error, so you can use them without needing to detect if the plugin supports them. New server debug flags S> and S> were added to suppress some very verbose messages when verbose mode is enabled. =head2 API There is a new C<.get_ready> method which is called after C<.config_complete> and before the server forks or changes directory. It is the last chance to do any global preparation that is needed to serve connections. Plugins have previously done this work in C<.config_complete>, but by splitting this into a new method it makes the API clearer. (Note that existing plugins may continue to use C<.config_complete> for this work if they prefer.) There is a new C<.preconnect> method available which is called just after the client makes a connection but before any NBD negotiation or TLS authentication is done. It can be used for early whitelisting or rate limiting of connections, and in particular is used by the new L. =head2 Bug fixes In L, C is used (if available) so that file sizes up to 63 bits should now work on all platforms (Pino Toscano and Adrian Ambrożewicz). nbdkit is now compatible with OCaml 4.10. L now supports C (Eric Blake). =head2 Documentation Plugins which were actually added in S are now documented as such properly. Improved methods for probing plugins and filters are documented in L. =head2 Tests Old plugins from nbdkit 1.0, 1.2, 1.8 and 1.12 are now bundled with the nbdkit sources and tested to try to ensure that they do not accidentally regress. Note these are included as binary blobs. See F for more information about this, including how to delete these tests. Various tests, especially ones which rely on timeouts, have been made more stable so they should not fail on slow or overloaded machines. Many tests now use libnbd and nbdsh (instead of libguestfs and guestfish) as the test client. This should improve the performance of the tests for most people. The I<--vsock> option (added in nbdkit 1.16) can now be tested if the host is running Linux E 5.6 (Stefano Garzarella). =head2 Build You can use C<./configure --disable-nbd-plugin> to completely disable the NBD plugin. The automake feature C is no longer used, which may improve compatibility on platforms with ancient and buggy automake (S being one such platform). =head2 Internals The explicit connection parameter passed around many functions in the server is now fetched from thread-local storage. The server no longer calls the finalize method if prepare fails. Also failing to reopen the plugin from L no longer hangs (Eric Blake). C was enhanced to make patches easier to read (Eric Blake). Internal calls to methods like get_size, can_write will now no longer produce debug messages I the data is simply being returned from the internal cache (but calls into the plugin are still logged). =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.18: =over 4 =item Adrian Ambrożewicz (1 commit) =item Eric Blake (30 commits) =item Wiktor GoÅ‚gowski (1 commit) =item Richard W.M. Jones (130 commits) =item Nir Soffer (11 commits) =item Pino Toscano (1 commit) =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.20.pod0000644000175000017500000001254114623341243014572 =head1 NAME nbdkit-release-notes-1.20 - release notes for nbdkit 1.20 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.20. This describes the major changes since 1.18. nbdkit 1.20.0 was released on B<2nd May 2020>. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L is a scriptable “remote tmpfs†for creating temporary filesystems (eg. for thin clients), and also for blank or prepopulated temporary disks. L now has support for prepopulating disks with more complex test patterns such as repeated sequences of bytes. L now supports setting a proxy, enabling TCP keepalives, and disabling Nagle’s algorithm. L now supports API version 2. In particular the full NBD client flags are visible to plugins, along with support for the C<.get_ready> callback. Also there is a new function C which is a wrapper around the C API. L drops support for VDDK 5.1.1. This version was last updated in 2014 and is no longer supported by VMware. Since this was the last version of VDDK to support i686, 32-bit support is also dropped (Eric Blake). =head2 Language bindings Plugins may now be written in Golang, see L (thanks Dan Berrangé, James Shubin). OCaml plugins can now access C, C, C and C. Python plugins now transparently support fail-fast zero (Eric Blake). =head2 Filters New L causes nbdkit to exit after the last client connection. New L allows you to limit the number of clients which can simultaneously connect to any plugin. =head2 Server The I<--run> option now waits for the nbdkit plugin and nbdkit to exit before returning to the caller. This allows for more predictable clean up in shell scripts using this feature. nbdkit I<--dump-config> output now includes separate lines for C and C, making it easier to find out from shell scripts which version of nbdkit is installed. nbdkit I<-s> option (which connects to the client over stdin/stdout) now rejects various options that would also try to read from or write to stdin/stdout, for example I<--dump-plugin> or C (Eric Blake). =head2 API New C call which allows plugins to ask for nbdkit to exit. This is used to implement the new C filter. New C call allows plugins to check if reading from stdin or writing to stdout is safe, eg. if it is safe to read passwords interactively (Eric Blake). C callbacks which return booleans can return any value E 1 to mean true. Previous versions of nbdkit had inconsistent behaviour if plugins returned anything other than 1 for true (Eric Blake). =head2 Bug fixes nbdkit-tar-plugin now works and there is a regression test for it. L S> option now works. Fixed a rare hang when closing a connection in L (Eric Blake). Fix compilation on certain platforms with clang (Khem Raj). Don’t leak C<$tmpdir> from L into the I<--run> subcommand. nbdkit now correctly sets C when using systemd socket activation (Eric Blake). =head2 Documentation The L man page has been overhauled completely to make it easier to follow. Also we now have documentation for how to compile plugins in various environments which was missing before. =head2 Tests All valgrind tests now pass. “Old plugin†tests were added for v1.18.2 on x86-64, and a variety of old plugins compiled on i686. The i686 plugins will allow us to test for regressions in 32 bit support. Tests of the nbd plugin should now be stable (Eric Blake). There is an additional test combining the offset and truncate filters, which tests several corner cases as well as providing tests of error handling between layers. =head2 Build L now requires libnbd. (If libnbd is not present at build time then this plugin is not built). The fallback code in this plugin which made NBD connections by constructing NBD command packets without using libnbd has been removed (Eric Blake). F has been improved so that commands like S> and S> display OCaml sources in a natural order with interface first followed by implementation. Various fixes for MinGW. Note MinGW / MSYS support is a work in progress and not finished yet (Frank Gu). Multiple fixes to Haiku build. L is no longer required to run the tests. It was a “hidden†required dependency, but all use of it has now been eliminated. =head2 Internals There is now an internal utility library for creating vectors/lists of objects, for example lists of strings (F). It is widely used by the server, plugins and filters. F discusses how to use L for code coverage reports. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.20: =over 4 =item Eric Blake (33 commits) =item Khem Raj (1 commit) =item Richard W.M. Jones (134 commits) =item Frank Gu (6 commits) =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.22.pod0000644000175000017500000002015014534316443014574 =head1 NAME nbdkit-release-notes-1.22 - release notes for nbdkit 1.22 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.22. This describes the major changes since 1.20. nbdkit 1.22.0 was released on B<27 August 2020>. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L (Containerized Data Importer) lets you export a single layer from a container image, allowing you to access disk images distributed using container registry infrastructure. New L creates filesystems for clients on demand. New L serves a BitTorrent file or magnet link over NBD. L and L have a new C parameter giving more fine-grained control over the allocation strategy. Currently implemented strategies are: sparse array, sparse array with zstd compression, malloc, and malloc with mlock. L data format now supports strings and alignment. The C script has been enhanced to detect repeated sequences and produce a more compact output. L adds support for arbitrary custom request headers. Also it now supports scripts for generating cookies and custom request headers. This is especially useful when accessing web servers that require authentication which has to be renewed periodically. L now supports HTTP/2 servers (David Edmondson, Pino Toscano, Zi Liu). L adds support for the C header. L can export multiple files in a directory as separate exports (Eric Blake). L supports new C and C parameters which can be used to optimize access patterns and avoid filling the page cache. L supports proxying to another NBD server over C (Eric Blake). L supports new C and C parameters which allow you to run a subordinate NBD server as a command directly from the plugin, or pass in an already connected NBD endpoint. nbdkit-streaming-plugin(1) supports streaming to and from local pipes. L now has support for VDDK 7.0. A new and useless "error" message printed by VDDK 7 has been suppressed (thanks Ming Xie, Pino Toscano). nbdkit-ext2-plugin has been removed. It was deprecated in S. All existing uses can be replaced with L. The C<-> character is now permitted within plugin and filter names (Eric Blake). =head2 Filters New L lets you test disk images recovered by L (François Revol). New L can decompress a plugin that contains gzip-compressed data. It replaces nbdkit-gzip-plugin which is deprecated and will be removed in S. New L can temporarily stop and later resume NBD requests. This can be used when taking snapshots. New L swaps bytes in the underlying plugin, which can be used to adjust images that have an incorrect byte order (François Revol). New L reads and writes files inside a tar file in the underlying plugin. It replaces nbdkit-tar-plugin which is deprecated and will be removed in S. New L provides alternate content when a client connects without using TLS to a server that permits but does not require TLS (Eric Blake). L has new option C to pass through FUA and flush requests unchanged (disabling the filter). A new, unsafe C mode was added which discards FUA and flush requests. =head2 Language bindings New L lets you write small nbdkit plugins as inline C, C++ or OCaml "scripts" (and potentially other ahead-of-time compiled programming languages). L bindings have been replaced by higher level and more idiomatic bindings. These also support a greater range of server features (Alan Somers). L now supports parallel plugins. These cannot run Python code in parallel (because of the Python GIL), but for Python code that blocks, eg. calling out to external services, requests can now be handled in parallel (thanks Nir Soffer). L has a greater range of examples (Nir Soffer). L adds support for getting the client export name, calling C, and also for extents. =head2 Server C has new fields: C and C to allow easier version parsing from scripts. C and C so you can find out if nbdkit was cross-compiled for another platform. C so you can find out if nbdkit was compiled with zstd compression support. The I<-e>/I<--exportname> option (which never did anything useful previously) is now used to pass the preferred exportname to the I<--run> option. In general you should never use this option except in very limited and exceptional circumstances (Eric Blake). =head2 API New C<.after_fork> callback which can be used for plugins which need to create background threads, since those threads would otherwise be stranded if the server forks into the background. The VDDK plugin now defers VDDK library initialization til C<.after_fork> because it is thought that the library creates background threads especially when accessing remote servers. New API C is a helper function for filters that retrieves extents as needed until at least a certain range is covered (Eric Blake). New C can be called to determine if TLS was negotiated on the connection. Plugins could use this to hide certain exports from non-authenticated/non-encrypted clients (Eric Blake). C with C will now return an error if the input is not a tty. Also C is disallowed if the file descriptor is 0, 1 or 2. =head2 Bug fixes The VDDK plugin was extensively refactored to fix many bugs: Reading passwords from a tty should work again. The plugin should now work properly when daemonized or using the I<--run> option. The threading model has been relaxed to C which should give small performance improvements when using multiple connections. The C option of L has been fixed so it sets the implicit size correctly. The CFILE> formatter of L now works if you use it more than once. =head2 Documentation New L manual page documents how to mount filesystems from NBD exports on client machines, either directly or using systemd mountpoints. Examples now use C so that the examples match the documentation. =head2 Tests The tests should now pass on OpenBSD E 6.4. F was refactored: There is now no longer a single massive C. Creation of test disks was refactored. Some tests will now use new libnbd 1.4 tools L and L if available, and skip the tests otherwise. New test functions C and C allows tests to be skipped if the corresponding plugin/filter was not compiled on a particular platform. So tests should now not fail when an optional external library needed by a plugin/filter is not available. =head2 Build Honggfuzz may now be used for fuzz testing. If L is enabled, Python E 3.6 must be used. =head2 Internals The export name is now passed down through filter C<.open> callbacks, allowing filters to modify the export name passed through to plugins. The final thread model is passed to filter C<.get_ready> callbacks. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.22: =over 4 =item Alan Somers (7 commits) =item Eric Blake (53 commits) =item François Revol (2 commits) =item Nir Soffer (2 commits) =item Richard W.M. Jones (285 commits) =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.24.pod0000644000175000017500000001074314534316443014605 =head1 NAME nbdkit-release-notes-1.24 - release notes for nbdkit 1.24 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.24. This describes the major changes since 1.22. nbdkit 1.24.0 was released on B<7 January 2021>. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Server The server and a subset of the plugins and filters have been ported to Windows using the Win32 API. Only the mingw-w64 toolchain is supported for building nbdkit (not MSVC). You can also cross-compile from Linux and test under Wine. Some features are missing although it is very usable. New S> and S> debug flags which enable additional debugging for TLS sessions. The server now responds to C (Eric Blake). Options I<--run> and I<--vsock> may now be used together. In I<--run>, C<$nbd> is now a synonym for C<$uri> instead of having confusing magical properties. =head2 Plugins New L to access disks stored on AWS S3 and Ceph. New L which generates large disks sparsely filled with random blocks of data. These look like virtual disk images and can be used to benchmark copying tools. L has been greatly enhanced. New features include: C<(...)[N:M]> (slice syntax), assignments, comments, variables, C(SCRIPT)> (inlined shell script). In addition a parse tree is built, allowing optimizations and other enhancements. The plugin is now 64 bit clean allowing patterns larger than 2^32 bytes to work correctly. L can now be used to test copying tools. L supports enabling compression between VDDK and the VMware server which in some situations can improve performance. =head2 Filters New L can be used to extend, mask and modify the exports exposed by a plugin (Eric Blake). New L allowing the server to gracefully exit on various events including external scripts. New L can be used to benchmark copying tools. L now supports filtering clients by PID, user ID or group ID, for clients connected over a Unix domain socket. Also you can filter clients using C and vsock port number. L now logs C, C and C methods, and there is a new C feature allowing scripts to be run on logging events. L new option C can be used to allow the client to select which file to see from the filesystem using the NBD export name (Eric Blake). =head2 Language bindings Python style cleanups (Eric Blake). The OCaml plugin now correctly acquires and releases the GC lock on all paths in and out. There is a new OCaml C function returning the version of nbdkit that the plugin was compiled against. Multiple enhancements to the Rust plugin (Alan Somers). =head2 API New C<.list_exports>, C<.default_export> and C<.export_description> plugin methods allowing plugins to be queried about what export names they support, and give additional descriptions of exports. New C helper function (Eric Blake). New C, C C and C functions which allow you to allocate a string in a plugin without worrying about freeing it (Eric Blake). New C, C and C allows plugins and filters to read the client’s credentials, for clients connected over a Unix domain socket. =begin comment =head2 Bug fixes =head2 Documentation =end comment =head2 Tests Many tests now use L, L, L and L as lighter weight replacements for qemu tools. Fix compatibility with qemu E 5.2.0. =head2 Build Downstream packagers can now use this to add extra downstream information which is printed in version strings etc: ./configure --with-extra=... If L is installed at build time, then it will be used to build the L manual page for OCaml documentation. =begin comment =head2 Internals =end comment =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.24: =over 4 =item * Alan Somers =item * Eric Blake =item * Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.26.pod0000644000175000017500000001263214534316443014606 =head1 NAME nbdkit-release-notes-1.26 - release notes for nbdkit 1.26 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.26. This describes the major changes since 1.24. nbdkit 1.26.0 was released on B<7 June 2021>. nbdkit is now hosted on gitlab: L =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =begin comment =head2 Server =end comment =head2 Plugins nbdkit-gzip-plugin and nbdkit-tar-plugin have been removed. They were deprecated in nbdkit 1.22. The functionality has been replaced by L and L respectively. nbdkit-streaming-plugin(1) has been deprecated and will be removed in S. You can use L instead. L adds these features: C to disable following redirects. C and C to control saving cookies. L now advertises multi-conn if the server is OpenSSH, improving performance (Eric Blake). L has a new C flag allowing you to choose between clients waiting for an export to become free or being immediately rejected. L now does not generate fully random data within each block. Using perf we observed that the plugin was spending 34% of the total time during benchmarks just doing this. You can enable the old behaviour using C. L now checks if the file is read-only and exports a read-only NBD connection in this case (Eric Blake). L has been tested with VDDK 7.0.2. =head2 Filters There is a new API for use by filters to manage "contexts". Instead of the previous 1-1 relationship between filter connections and plugin connections, filters can now open more than one context into the backend from a single connection, or share contexts between connections (Eric Blake). New L which allows you to add multi-conn support to plugins which don't support it (although the emulation is expensive), or change whether multi-conn is advertised to clients (Eric Blake). L now ignores flush/FUA requests (which are not useful for a temporary overlay). The filter now implements extents and efficient trimming. Fine-grained locking is used around shared structures, greatly improving parallel performance. Added support for multi-conn. L advertises multi-conn when possible (Eric Blake). nbdkit-cache-filter and nbdkit-cow-filter can now handle arbitrary sized disks, instead of rounding the disk size down. L supports parallel requests (Eric Blake). L supports multi-conn (Eric Blake). L no longer supports multi-conn. The filter is single-threaded so it does not matter, but it was not safe. Fix trim, zero and flush support (Eric Blake). L fixes multi-conn support (Eric Blake). L and L now both support multi-conn (Eric Blake). =head2 Language bindings L supports the following new features: C and C methods. C binding. L updated for newer Rust compiler versions (Alan Somers). L now uses and requires golang modules. Golang E 1.13 must be used. =head2 API New C<.cleanup> callback for plugins and filters. This is called shortly before C<.unload>, but unlike C<.unload> it is guaranteed that no plugin or filter code has been dlclosed (Eric Blake). New C is a helper function for filters which can be used to read all extents from a plugin covering a region. =begin comment =head2 Bug fixes =head2 Documentation =end comment =head2 Tests Old plugins that we use for testing were rebuilt so they no longer depend on libselinux (thanks Thomas Weißschuh). L can still be built even if ssh-keygen is unavailable for testing it (thanks Thomas Weißschuh). Improve F to avoid crashes during testing. Test coverage on FreeBSD has been improved, fewer tests should skip unnecessarily. =head2 Build nbdkit and plugins can now be built with I<-fvisibility=hidden>, which allows the compiler to make some optimizations. Add a dependency so nbdkit is relinked if the linker script (F) changes (Eric Blake). xorriso is now preferred over genisoimage or mkisofs (see L). It is now possible to compile nbdkit with clang with warnings enabled. Several warnings have been suppressed or fixed. C and C are only enabled when running the tests, not when running nbdkit from the build directory. This makes it easier to do benchmarks. C implemented on OpenBSD. =head2 Internals When fuzzing nbdkit we now recommend using the S> flag (which disables threads). This improves the fuzz-stability of nbdkit. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.26: =over 4 =item * Alan Somers =item * Eric Blake =item * Michael Ablassmeier =item * Richard W.M. Jones =item * Timm Bäder =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.28.pod0000644000175000017500000001117514534316443014611 =head1 NAME nbdkit-release-notes-1.28 - release notes for nbdkit 1.28 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.28. This describes the major changes since 1.26. nbdkit 1.28.0 was released on B<23 September 2021>. =head2 Security =head3 CVE-2021-3716 reset structured replies on starttls nbdkit was vulnerable to injected plaintext when upgrading to a secure connection. For the full announcement see L (Eric Blake). All past security issues and information about how to report new ones can be found in L. =head2 Plugins L has new CNNE:> and CNNE:> prefixes for little and big endian words. Also the plugin tries much harder to optimize expressions. The test suite has been greatly expanded to catch potential regressions. L now allows you to reserve free space (Nolan Leake). L no longer references SHA1 host keys as part of the effort to remove insecure algorithms (Daniel Berrangé). L reports C and C based on what the version of VDDK supports. New debug flag I<-D vddk.stats=1> prints the amount of time spent in VDDK calls on exit which can be useful for profiling performance. =head2 Filters L and L no longer break up large read requests into page-sized requests. In addition the default block size for both filters is now 64K. Both changes greatly improve performance. L has a new C parameter allowing callers to enable and disable the cache-on-read feature at runtime. Also there is a new C parameter letting you select the block size at runtime (thanks Martin Kletzander). L has a new C parameter which works similarly to the corresponding cache filter feature. The new C parameter lets you select the block size at runtime. L has less verbose debugging. To restore the old debug output use I<-D cow.verbose=1> L has new C and C parameters to inject delays when clients connect and disconnect. Delay filter parameters are now parsed more accurately (thanks Ming Xie). =head2 Language bindings The OCaml bindings now call C when unloading the plugin. This causes C handlers to run correctly, closes file descriptors, releases dependent shared libraries and frees memory. Valgrind on OCaml plugins should not show any false positives about leaked memory. OCaml and Python bindings may now use the C<.cleanup> method. References to Python 2 in L have been removed. =head2 Server Fix captive nbdkit C<$uri> variable so when TLS is used the URI is constructed with the C prefix. Additionally add a new variable C<$tls> which can be used by the subprocess to tell if TLS is enabled. Debug messages are now printed atomically. This means that debug messages are no longer broken up across multiple lines if there are other processes writing to stderr at the same time (which often happened when using captive nbdkit). Enhanced valgrind support (F<./configure --enable-valgrind>) can now be enabled safely and with no performance impact even in production builds (Eric Blake). =head2 API Plugins or filters using C now don't hang if the client closes the socket abruptly (thanks Ming Xie). =head2 Bug fixes L and L using allocator=malloc no longer crash because of memory corruption in some corner cases (only seen on s390x, but could happen on other architectures). Meanwhile C no longer crashes when zeroing unallocated space. =begin comment =head2 Documentation =end comment =head2 Tests Tests now use the new C feature, replacing C on glibc E 2.34 (thanks Eric Blake, Siddhesh Poyarekar). =head2 Build F now uses spaces consistently, and has been modernized to support the latest autotools (Eric Blake). F has been unified (almost) with the copy in libnbd. Continue fuzzing using AFL++. Updated the fuzzing documentation. =begin comment =head2 Internals =end comment =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.28: =begin comment git shortlog -s v1.26.0.. =end comment =over 4 =item Daniel P. Berrangé =item Eric Blake =item Martin Kletzander =item Nolan Leake =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.30.pod0000644000175000017500000001422514534316443014601 =head1 NAME nbdkit-release-notes-1.30 - release notes for nbdkit 1.30 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.30. This describes the major changes since 1.28. nbdkit 1.30.0 was released on B<24 February 2022>. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Plugins B has been removed. It was deprecated in 1.26 and scheduled for removal in this release. If you were using this plugin, use L instead. L has several changes: =over 4 =item * This plugin can now create (as well as reading and writing) local VMDK files. See the new C option and the various C options. =item * Read and write is now implemented using the VDDK Async functions, which improves performance. The full nbdkit parallel thread model is supported. =item * VDDK E 6.5 (released Nov 2016) is now the minimum required version. =item * Stats collected when using I<-D vddk.stats=1> have been extended to include number of calls and bytes transferred. =item * I<--dump-plugin> output now includes the VDDK major version and information about each VDDK API that is implemented by the library. =item * A new example F is provided to help with automating connections to remote ESXi virtual machines. =back L adds support for choosing TLS/SSL versions and ciphers and TLS 1.3 cipher versions (Przemyslaw Czarnowski). L now implements C for writes so that the Linux page cache is not destroyed when writing huge files. L now implements the C<.cleanup> callback. Also we document how to use this plugin to implement OCaml plugin scripts. L I<--dump-plugin> option now prints C when the platform supports C. =head2 Filters New L, which is similar to L but only retries a single failing request. New L lets you add write-protection over regions of a plugin. New L lets you adjust or set the block size constraints and policy of underlying plugins. See L below. L now permits the COW block size to be set as small as 4096 bytes. Debug messages in L are now easier to read because they no longer all have an C prefix (Eric Blake). =head2 Language bindings For L the minimum version of OCaml is now 4.03 (instead of 4.02.2 previously). Various source-level incompatible changes were made to OCaml plugins in this release. Please consult the new documentation and example if writing plugins in OCaml. OCaml plugins now support C. Several fixes to the handling of integers in Python plugins (Nir Soffer). New Python example which simulates request errors (Nir Soffer). =head2 Server The server no longer requests the C hint when opening a server socket. This improves handling of IPv6. In a related change, the I<-i> (I<--ipaddr>) option now works as intended, and new I<-4> and I<-6> options have been added to restrict the listening socket to IPv4 or IPv6 addresses (Laszlo Ersek). =head2 API There is a new C<.block_size> callback for plugins and filters. nbdkit uses this to export block size constraints to clients, specifically the minimum, preferred and maximum block size that clients should use. As well as regular C plugins, L, L, L, L and L support block size constraints. L reexports block size constraints from the proxied NBD server. L now advertises a minimum 512 byte block size. L, L, L and L adjust block size constraints from plugins (Eric Blake). L can also use the block size hints from the plugin instead of needing manual adjustment on the command line. L logs block size constraints (Eric Blake). L can be used to add block size constraints to plugins which don't support it, or adjust constraints, or set the error policy. =head2 Bug fixes L (and others), using C was broken. This was especially evident on non-Linux or on Linux with 64K pages (eg. POWER). It should now work correctly. =begin comment =head2 Documentation =end comment =head2 Tests C<./configure --disable-libguestfs-tests> can now be used to disable tests which need libguestfs, without disabling L. We now use L instead of L to create the ext4 test image. On armv7 this allows the test suite to run much more quickly. The time taken to run the test suite has been reduced significantly. =head2 Build Multiple fixes to the Windows (MinGW) build. The test suite should now pass fully if you have the version of Wine with the unofficial C patch. The top level F source directory has been renamed to F. This prevents problems when setting C<$PATH> to the source directory and trying to run bash. =head2 Internals The performance of the internal vector library has been improved greatly and overflow is now handled correctly (Nir Soffer, Laszlo Ersek and Eric Blake). New "nbdkit-string.h" header file which defines a common string type (based on vector). Existing places which defined a string based on vector have been updated to use it. C and C macros can be nested (thanks Eric Blake). =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.30: =begin comment git shortlog -s v1.28.0.. =end comment =over 4 =item Alan Somers =item Eric Blake =item Hilko Bengen =item Laszlo Ersek =item Nir Soffer =item Przemyslaw Czarnowski =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.32.pod0000644000175000017500000001207414534316443014603 =head1 NAME nbdkit-release-notes-1.32 - release notes for nbdkit 1.32 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.32. This describes the major changes since 1.30. nbdkit 1.32.0 was released on B<1 August 2022>. =head2 Security There were no security issues found. All past security issues and information about how to report new ones can be found in L. =head2 Plugins L has new C, C and C parameters to allow remote files to be created. L was largely rewritten and should have better performance and compatibility. It also supports splitting/concatenating multiple S3 objects into one virtual disk. (Nikolaus Rath) =head2 Filters New L allows you to open, read and write LUKSv1 disk images. It is compatible with qemu and dm-crypt. New L which simply scans across the disk issuing prefetches. L has been completely rewritten so now it uses prefetching from a parallel thread. The old readahead filter was deprecated, but if you are using it you should carefully read the new documentation because it may require changes. L now summarises block size and alignment of requests (Nikolaus Rath). L now handles parallel writes without losing writes because of overlapping read-modify-write cycles. If you are using the blocksize filter it is recommended to upgrade. (Eric Blake) L has a new C parameter allowing the bucket capacity to be adjusted, which helps with smoothing out large, lumpy client requests. =head2 Language bindings Add C binding for Python (Nikolaus Rath). Compatibility with OCaml 4.14. Compatibility with Perl 5.36. =head2 Server Add macOS (Darwin) support. See the relevant section in the top level F file. kTLS should now work (transparently) when available in the kernel and GnuTLS. Use of kTLS will be indicated in debug output. (Daiki Ueno, FrantiÅ¡ek Krenželok) =begin comment =head2 API =end comment =head2 Bug fixes L now handles inline scripts correctly on non-glibc platforms (Martin Kletzander). Catch the case where nbdkit ends up linked to OpenSSL (because of a transient dependency through GnuTLS) which broke L. For more details see L. Fix memory leak in L which would lead to large amounts of memory being leaked if your plugin implemented C or C callbacks (Eric Blake). The L cookie/header scripts feature now generates an error properly if the shell script fails. Fix further "phone home" messages in L (thanks Ming Xie). Improve error message from L when the thumbprint parameter is wrong (Laszlo Ersek). Fix C and C in filters. These could cause assertion failures before. (Eric Blake) Fix L test if dependencies are missing (thanks Jim Fehlig). Fix a bounds error in L. The server will now fail and exit early if the I<--tls-verify-peer> option is used on platforms which do not support it. Previously it would only fail when a client connected using TLS. Various bugs found by Coverity were analysed and fixed (Eric Blake). =head2 Documentation Document how to write plugins and filters in C++. This has always been possible, but was never documented before. Document how to run nbdkit from inetd or xinetd superservers. Fix how verbatim paragraphs in the documentation are rendered in HTML. Document how to use nbdkit + TLS with L. =head2 Tests Various enhancements to fuzzing including supporting AFL++, AFL++ clang-LTO. Add C<./configure --disable-linker-script> which is needed to use ASAN, and document how to use ASAN when fuzzing. Improve runtime of linuxdisk test (Eric Blake). Add interoperability tests with L, the Linux kernel client, including TLS support. =head2 Build Add GitLab continuous integration (CI) at L and many miscellaneous build fixes (Martin Kletzander). There are now C and C defined under F and used consistently throughout the code. Microsoft Visual Studio Code formatting settings are available (in F<.vscode/>) (Nikolaus Rath). Remove F. It is now available as a separate project: L C macro added to simplify static array sizing (thanks Laszlo Ersek). =begin comment =head2 Internals =end comment =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.32: =begin comment git shortlog -s v1.30.0.. =end comment =over 4 =item Alan Somers =item Eric Blake =item Laszlo Ersek =item Martin Kletzander =item Nikolaus Rath =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.34.pod0000644000175000017500000001057514534316443014611 =head1 NAME nbdkit-release-notes-1.34 - release notes for nbdkit 1.34 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.34. This describes the major changes since 1.32. nbdkit 1.34.0 was released on B<14 April 2023>. =head2 Security Various sanity checks were added to L so it can handle untrusted disk images. TLS support was hardened against a Man-in-the-Middle attacker injecting unknown NBD options before STARTTLS (Eric Blake). Fix rare assertion failure (denial of service) which can be triggered by clients hanging up early (Eric Blake). All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L allows you to easily consume and automate the L high performance storage library. This allows you to (amongst other things) access local vhost-user and VFIO devices (thanks Alberto Faria and Stefan Hajnoczi). L has new C and C parameters allowing a file or directory to be passed from a parent process through a file descriptor. Several enhancements were made to L, concentrating on improved performance and functionality: =over 4 =item * Multi-conn is now enabled for read-only connections (thanks Eric Blake). =item * Instead of using one libcurl handle per NBD client, we now use a common pool of handles, which improves performance. =item * Fix the C parameter (Michal Orzel). =item * We now use the new L feature of libcurl (if available) instead of hard-coding the list of protocols into the plugin. =item * Support was added for forcing C, S =back L now supports VDDK 8 (thanks Ming Xie, Alice Frosi). L was ported to macOS (Eric Blake). =head2 Filters L has a new C to force a disconnection if a client attempts a write larger than a certain threshold (Eric Blake). L can now retry plugin open (Eric Blake). =head2 Language bindings L now rejects extra parameters to C and C functions (Eric Blake). Tracebacks from Python plugins should now include the full method name (Eric Blake). L status codes have changed in this release, although in a way that will normally be backwards compatible with older plugins. Two new status codes are reserved for shutdown server and disconnect client. Check the manual page for details. (Eric Blake) =head2 Server C now reports C so you can tell if the optional L functionality is enabled on the platform. Debug messages from filters and plugins are now picked out in bold, making them easier to read amongst other nbdkit debug messages. =head2 API New C API which allows a plugin or filter to drop the connection to the current client (Eric Blake). =head2 Bug fixes Fix a deadlock in L (Piotr Dobrowolski). Fix the error message in L when the F file is not readable (thanks Jonathon Jongsma). =head2 Documentation The I<--help> output of plugins is now consistent with the manual pages, and extra tests were added to ensure it stays this way. =head2 Tests Multiple CI improvements, particularly for Alpine Linux and macOS (Eric Blake). =head2 Build Most C<./configure>-time features can now be both enabled and disabled using I<--with->feature and I<--without->feature (Arsen Arsenović). Multiple VPATH build problems fixed (Eric Blake). =head2 Internals Use I instead of I in test certificates and suggest its use in documentation (thanks Daniel Berrangé). Source files reformatted to use E 80 columns (Laszlo Ersek). =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.34: =begin comment git shortlog -s v1.32.0.. =end comment =over 4 =item Alan Somers =item Arsen Arsenović =item Daniel P. Berrangé =item Eric Blake =item Laszlo Ersek =item Michal Orzel =item Nikolaus Rath =item Nir Soffer =item Piotr Dobrowolski =item Richard W.M. Jones =item Thomas Weißschuh =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.36.pod0000644000175000017500000001215014534316443014602 =head1 NAME nbdkit-release-notes-1.36 - release notes for nbdkit 1.36 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.36. This describes the major changes since 1.34. nbdkit 1.36.0 was released on B<27 September 2023>. =head2 Security No security issues were identified in this release. All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L which creates a fully allocated disk containing all 0xff (all ones), or another byte of your choice. L now uses a curl "multi" interface. This enables much better performance, and also allows the curl plugin to handle requests in parallel. The curl plugin now falls back to making a C request to get the size of the remote file for certain servers which do not support C requests. This plugin adds new options: C (force IPv4 or IPv6), C (force a particular IP address), I<-D curl.times=1> (print detailed timing stats), and I<-D curl.verbose.ids=1> (display connection and transfer IDs). L now uses a read-write lock to protect internal structures, resulting in improved performance for mostly read workloads. L now has more optimizations. L now supports 4k sector sizes on Windows (Brian Carnes). =head2 Filters New L adds random but consistent data corruption to the underlying plugin. New L which can decode qcow2 files (but not write to them). L can now filter by client SELinux label. L now supports 4k sector sizes (Brian Carnes). L allows the C operation to be retried. L adds new C parameter which can be used to ensure the filter does not read indefinite amounts of input when opening the tar file. Filters can now append their own output to nbdkit I<--dump-plugin> output. =head2 Language bindings Rust bindings add support for C, C, C, C, C, C and C. The C method can now return an error; note this is not backwards compatible and requires a small source code change to Rust plugins. (Thanks Alan Somers) L now supports OCaml 5. OCaml bindings add support for C, C, C and C. L now supports Perl 5.38. Shell script plugins (L) may now ignore stdin in their C method, whereas previously it was required to read and discard stdin along error paths (thanks Eric Blake). =head2 Server When using the I<--run> option, the default is now to use a private Unix domain socket (as if I<-U -> was specified), whereas in nbdkit E 1.34 the default was to open a TCP port. The new default reflects the most common and safest way to use the I<--run> option. You can find out if nbdkit has the new behaviour by checking S> and looking for C in the output. Debug strings containing control codes and other non-printable characters are now escaped properly. New flag I<-D nbdkit.environ=1> can be used to dump the server environment in debug output. =head2 API New C function which can be used to parse probabilities in various formats, like C<"10%"> or C<"1:10">. New C function which returns the security context (usually SELinux label) of the client. =head2 Bug fixes Fix long-standing double-free in L when the client closes the connection during negotiation (thanks Eric Blake). nbdkit-file-plugin now has improved error messages when you try to open a file with an empty name (C<"">). =head2 Documentation Miscellaneous documentation improvements for Windows (Brian Carnes). Fuzzing instructions updated for Clang 17, AFL++ 4.08c. =head2 Tests Ongoing CI maintenance and fixes (Laszlo Ersek, Eric Blake). Many fixes in the test suite for MinGW and Wine. Several internal consistency checks were added to the test suite, to ensure, for example, that we always use C when the test uses the nbdkit I<--run> option. =head2 Build Optionally C can be used (instead of C) for faster decompression in various places. No longer link with msvcrt on Windows. C is a build requirement. It was implicitly required before (because it is needed by the C<./configure> script generated by autoconf), but now the dependency is explicit (Eric Blake). =head2 Internals C has a new I<--replace> parameter which makes it easier to use C-substitutions in documentation. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.36: =begin comment git shortlog -s v1.34.0.. =end comment =over 4 =item Alan Somers =item Brian Carnes =item Eric Blake =item Laszlo Ersek =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.38.pod0000644000175000017500000000724114623341243014604 =head1 NAME nbdkit-release-notes-1.38 - release notes for nbdkit 1.38 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.38. This describes the major changes since 1.36. nbdkit 1.38.0 was released on B<5 April 2024>. =head2 Security No security issues were found in this release. All past security issues and information about how to report new ones can be found in L. =head2 Plugins New L providing support for Google Cloud Storage (Mykola Ivanets). L, L, L, L, L and L all now advertise suitable minimum, preferred and maximum block sizes, which means clients should be able to access them more efficiently. L now supports VDDK up to version 8.0.2.1. L now reads sensitive tokens as passwords, allowing more flexibility on how to safely pass them to nbdkit. =head2 Filters New L which allows more fine-grained control over whether a plugin is read-only (and also to change it at runtime) compared to the normal nbdkit I<-r> command line option. =head2 Language bindings L adds bindings for C, C, C C, C, C, C, C. L implements zero-copy pread and pwrite calls. This change is not backwards compatible for OCaml plugin code. (Thanks Nicolas Ojeda Bar, Anil Madhavapeddy, Simon Cruanes). nbdkit-ocaml-plugin also adds extra OCaml version information to I<--dump-plugin> output; and adds an example of how to use debug flags. L minimum Rust version (MSRV) increased to 1.63.0. Various issues found by clippy have been fixed (Alan Somers). =head2 Server New I<--no-meta-contexts> (I<--no-mc>) option which stops the server from advertising metadata contexts, improving interoperability testing (Eric Blake). nbdkit I<--dump-plugin> outputs additional fields: The internal C, either C or C so you can tell what plugin/filter extension the server is looking for. The C is the maximum plugin API version supported. =begin comment =head2 API =end comment =head2 Bug fixes Fix compilation with GCC 14 (Florian Weimer). Fix the default block size exposed by L, fix the zero callback, and other bug fixes (Mykola Ivanets). L could enter an infinite loop in some error cases (Wilko Nienhaus). Several plugins would crash or behave strangely if no parameters were passed. These have been fixed and a regression test added. =head2 Documentation Update fio benchmarking documentation (Eric Blake). Add example of how to export a variable to I<--run> subcommands (Eric Blake). =head2 Tests Fix Cirros CI tests (Peter Krempa). =head2 Build bash E 4 is required. (This was always true, but now the F<./configure> script checks it.) You can now use both environment variables C together to run valgrind and gdbserver, in order to debug valgrinded nbdkit and plugins. =head2 Internals Important internal structs now contain magic values which are checked by optional assertions, improving type safety. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.38: =begin comment git shortlog -s v1.36.0.. =end comment =over 4 =item Alan Somers =item Eric Blake =item Mykola Ivanets =item Peter Krempa =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.40.pod0000644000175000017500000001071714676465664014625 =head1 NAME nbdkit-release-notes-1.40 - release notes for nbdkit 1.40 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.40. This describes the major changes since 1.38. nbdkit 1.40.0 was released on B<22 July 2024>. =head2 Security The server is now more careful about quoting user-provided filenames before printing them in error messages (thanks Mykola Ivanets). Short plugin and filter names (C<"file"> is the short name of L) are now more restrictive. This change should not be visible to users, but tightens up corner cases with possible security implications. See: L Previous documentation in L incorrectly asserted that when using X.509 certificates, nbdkit checks the client's CN. This is not true. nbdkit only checks that the client presents a certificate issued by the Certificate Authority specified by the I<--tls-certificates> directory. The documentation has been corrected. (Thanks Jon Szymaniak, Daniel P. Berrangé). L incorrectly parsed C rules, which might subtly change the semantics of access lists. This has been fixed in this release. L previously allowed unknown [not IPv4/v6, Unix or vsock] socket families implicitly, so having a C rule would not necessarily deny every connection. This has been changed in this release so all unknown socket families are denied. All past security issues and information about how to report new ones can be found in L. =head2 Plugins L now exposes minimum and preferred I/O size and the rotational property of block devices. L prints the version of libcurl and other useful information in I<--dump-plugin> output. L has been tested with VMware VDDK 8.0.3. =head2 Filters New L supporting bzip2-compressed images (Georg Pfuetzenreuter). New L which can be used to change the rotational property of a plugin (whether it advertises that it behaves like a spinning hard disk, or RAM / flash storage). New L can be used to add seek delays to simulate a spinning hard disk. L has new rule types for checking the client's X.509 Distinguished Name (DN) and Issuer's DN. =head2 Language bindings Ruby language support has been removed. This did not work because of a fundamental problem in Ruby's garbage collection. See: L =head2 Server New I<--print-uri> option which prints the URI of the server to help users find the NBD endpoint. Add a common function to find the size of a file or block device which should work properly across Linux and all the BSDs, and use this in several places where we need to know the size of a file or block device (thanks Eric Blake). When generating an NBD URI with TLS enabled, append C or C parameter. For libnbd-based NBD clients this allows the client to find the corresponding TLS credentials. =head2 API New L function which can be used to parse short delays and sleeps, like C<100ms> or C<1.2μs>. It is used by L, L, L and L. There are also bindings in OCaml and Python. New L and L to read the client's X.509 certificate Distinguished Name (DN) and Issuer's DN. =begin comment =head2 Bug fixes =end comment =head2 Documentation Each nbdkit API function now has a separate manual page, eg. L and L. Fix references to external L and L man pages (Vera Wu). Revise the main F file in the sources. =head2 Tests CI updates and fixes (Daniel Berrangé, Eric Blake). =head2 Build The minimum version of gnutls is now E 3.5.18. =head2 Internals Make error checking of L calls consistent by always checking if the return value C<== -1>. =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.40: =begin comment git shortlog -s v1.38.0.. =end comment =over 4 =item Daniel P. Berrangé =item Eric Blake =item Georg Pfuetzenreuter =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-release-notes-1.42.pod0000644000175000017500000000633114771235500014600 =head1 NAME nbdkit-release-notes-1.42 - release notes for nbdkit 1.42 =head1 DESCRIPTION These are the release notes for nbdkit stable release 1.42. This describes the major changes since 1.40. nbdkit 1.42.0 was released on B<11 February 2025>. =head2 Security L has been fixed to close an information leak. In an unusual configuration of the filter, it could leak the list of exports to clients that are supposed to be blocked. All past security issues and information about how to report new ones can be found in L. =head2 Plugins L now allows more characters to appear in filenames. Colons are now allowed, so filenames containing MAC addresses can be used, which is useful when using NBD in pre-boot environments. Also add the C option to allow sharing. (Thanks Markus Hartung) L now prints the default list of transports in I<--dump-plugin> output. Also this plugin now handles partial chunks correctly when reading extents for disks with a non-aligned size (thanks Ming Xie). =head2 Filters New L can be used to specify the maximum time limit for a connection. (See also the new I<--timeout> option below). New L implements random access to lzip-compressed files (Jan Felix Langenbach). =head2 Language bindings Multiple updates to L to keep up to date with latest changes in the Rust language (Alan Somers). Fix crash that happened in L plugins with OCaml E 5 (thanks Guillaume Munch-Maccagnoni, Gabriel Scherer). Also update the ocamldoc documentation. Fix more OCaml 5 deprecation warnings. Add support for Tcl 9.0 to L. =head2 Server nbdkit will now try to send the last plugin error message over the NBD protocol to the client, to provide additional information. This requires an NBD client which supports this, such as S 2.12> or S 1.22>. New nbdkit I<--timeout> flag can be used as a security measure to ensure that clients don't consume resources by opening lots of connections and then not negotiating (or negotiating slowly) the full NBD session. New nbdkit I<--keepalive> option which enables TCP-level keepalives. This is useful for detecting dead clients. nbdkit I<--dump-config> output now includes C and C reflecting whether the I<--timeout> and I<--vsock> options are available. =begin comment =head2 API =end comment =head2 Bug fixes Detect and warn about certain conditions which can cause the closed-source VDDK library to crash the server (Matthew Arnold, Nijin Ashok, Eric Blake). =begin comment =head2 Documentation =end comment =head2 Tests Plugins from nbdkit 1.38 have been added to the F directory. =head2 Build nbdkit should be buildable again on macOS. Add support for GCC 15. =begin comment =head2 Internals =end comment =head1 SEE ALSO L. =head1 AUTHORS Authors of nbdkit 1.42: =begin comment git shortlog -s v1.40.0.. =end comment =over 4 =item Alan Somers =item Eric Blake =item Jan Felix Langenbach =item Richard W.M. Jones =back =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-security.pod0000644000175000017500000000226714623341243013321 =head1 NAME nbdkit-security - information about past security issues in nbdkit =head1 DESCRIPTION This page details past security issues found in nbdkit. For how to report new security issues, see the C file in the top level source directory, also available online here: L =head2 CVE-2019-14850 denial of service due to premature opening of back-end connection See the full announcement and links to mitigation, tests and fixes here: L =head2 CVE-2019-14851 assertion failure by issuing commands in the wrong order This CVE was caused by the fix to the previous issue. See the full announcement and links to mitigation, tests and fixes here: L =head2 CVE-2021-3716 structured read denial of service attack against starttls See the full announcement and links to mitigation, tests and fixes here: L =head1 SEE ALSO L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-service.pod0000644000175000017500000001167314771235500013115 =head1 NAME nbdkit-service - running nbdkit as a service, and systemd socket activation =head1 DESCRIPTION Most people start nbdkit from the command line or run it from another program (see L. It is also possible to run nbdkit as a standalone service, which is what this page describes. =head1 SOCKET ACTIVATION nbdkit supports socket activation (sometimes called systemd socket activation). This is a simple protocol where instead of nbdkit itself opening the listening socket(s), the parent process (typically systemd or libnbd) passes in pre-opened file descriptors. One use for socket activation is to serve infrequent NBD requests using a superserver without needing nbdkit to be running the whole time. Another use is to run nbdkit from a controlling libnbd process. Socket activation is triggered when both the C and C environment variables are set. In this mode using I<-i>, I<-p>, I<--run>, I<-s> or I<-U> flags on the command line will cause an error. Also in this mode nbdkit does not fork into the background (ie. I<-f> is implied). =head2 Using socket activation with systemd To use nbdkit with socket activation from systemd, create a unit file ending in C<.socket> (eg. F) containing: [Unit] Description=NBDKit Network Block Device server [Socket] ListenStream=10809 # Optional settings to detect dead clients: #KeepAlive=true #KeepAliveTimeSec=60 #KeepAliveIntervalSec=10 #KeepAliveProbes=5 [Install] WantedBy=sockets.target There are various formats for the C key. See L for more information. Also create a service unit (eg. F) containing: [Service] ExecStart=/usr/sbin/nbdkit file /path/to/serve # Optional settings to run as non-root: #User=nbd #Group=nbd For more information on systemd and socket activation, see L =head2 Using socket activation with libnbd L L lets you run nbdkit from a program using libnbd. An example is: struct nbd_handle *nbd = nbd_create (); if (nbd == NULL) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } char *argv[] = { "nbdkit", "--exit-with-parent", "memory", "1G", NULL }; if (nbd_connect_systemd_socket_activation (nbd, args) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } =head1 INETD AND XINETD You can run nbdkit from L or L. For inetd use: nbd stream tcp nowait root /usr/sbin/nbdkit nbdkit -s file /tmp/disk.img For xinetd create a file F containing: service nbd { socket_type = stream wait = no user = root server = /usr/sbin/nbdkit server_args = -s file /tmp/disk.img } =head1 AF_VSOCK On Linux nbdkit supports the C address family / protocol. This allows you to serve NBD devices into virtual machines without using a regular network connection. B that this is different from the usual case where you present NBD as a virtual block device to a guest (which the guest sees as something like a SATA or virtio-scsi disk). With C the virtual machine sees a raw NBD socket which it can connect to by opening an C connection. For more about this protocol, see L =head2 AF_VSOCK example To set up an C server, use for example: nbdkit --vsock [--port PORT] memory 1G The optional I<-p>/I<--port> argument is used to change the C port number. These port numbers exist in a different namespace from TCP/IP port numbers. Also unlike TCP, the port numbers are 32 bit. The default port is 10809. The guest that wishes to access nbdkit must be configured for virtio-vsock. On the qemu command line use: qemu ... -device vhost-vsock-pci,id=vhost-vsock-pci0 For libvirt add this element to the C<<< >>> section: If you see the error C then you may have to unload the VMCI transport on the host: modprobe -r vmw_vsock_vmci_transport Once nbdkit and the guest are running, from inside the guest you can connect to nbdkit on the host using libnbd: nbdsh -c 'h.connect_vsock(2, 10809)' -c 'print(h.get_size())' =head1 ENVIRONMENT VARIABLES =over 4 =item C =item C If present in the environment when nbdkit starts up, these trigger L. =back =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_shutdown.pod0000644000175000017500000000507414676465664013434 =head1 NAME nbdkit_shutdown, nbdkit_disconnect - request shutdown or client disconnection =head1 SYNOPSIS #include void nbdkit_shutdown (void); void nbdkit_disconnect (int force); =head1 DESCRIPTION Plugins and filters can call L in the configuration phase (before and including C<.get_ready>, but not in connected callbacks). Once nbdkit has started serving connections, plugins and filters should not call L. However they may instruct nbdkit to shut down by calling C, or to disconnect a single client by calling C. =head2 nbdkit_shutdown C requests nbdkit to shut down asynchronously and returns (B that it does B exit the process immediately). It ensures that the plugin and all filters are unloaded cleanly which may take some time. Further callbacks from nbdkit into the plugin or filter may occur after you have called this. =head2 nbdkit_disconnect C requests that the current client connection be disconnected. It does not affect other connections, and it does not stop the same client from trying to reconnect. It is only useful from connected callbacks — that is, after (but not including) C<.open>, and before C<.close>. To reject a client in C<.preconnect>, C<.open> or C<.list_exports> you should return an error instead. If C is true, nbdkit will disconnect the client immediately, and the client will not receive any response to the current command or any other commands in flight in parallel threads. If C is false, nbdkit will not accept any new commands from the client (failing all commands other than C with C), but will allow existing commands to complete gracefully. Either way, the next callback for the current connection should be C<.close>. =head1 LANGUAGE BINDINGS In L: NBDKit.shutdown : unit -> unit NBDKit.disconnect : bool -> unit In L: import nbdkit nbdkit.shutdown() nbdkit.disconnect(force) In L: use nbdkit::*; pub fn shutdown() pub fn disconnect(force: bool) In L, there are various magic error codes that can be returned to indicate that shutdown or disconnection is needed. See that documentation for a full description. =head1 HISTORY C was added in nbdkit 1.20. C was added in nbdkit 1.34. =head1 SEE ALSO L, L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_stdio_safe.pod0000644000175000017500000000301314623341243013642 =head1 NAME nbdkit_stdio_safe - is it safe to interact with stdin and stdout =head1 SYNOPSIS #include int nbdkit_stdio_safe (void); =head1 DESCRIPTION The C utility function returns whether or not it is safe to interact with stdin and stdout during the configuration phase. This is needed because when the nbdkit I<-s> option is used the plugin must not directly interact with stdin, because that would interfere with network communication. The result of this function only matters in callbacks up to C<.config_complete>. Once nbdkit reaches C<.get_ready>, the plugin should assume that nbdkit may have closed the original stdin and stdout in order to become a daemon. L uses this function to determine whether it is safe to support C to read a script from stdin. Also constructs like C (see L) are disabled when reading from stdio is not safe. =head1 RETURN VALUE The function returns C<1> (safe) or C<0> (not safe). It cannot return an error. =head1 LANGUAGE BINDINGS In L: NBDKit.stdio_safe : unit -> bool In L: import nbdkit is_safe = nbdkit.stdio_safe() In L: use nbdkit::*; pub fn is_stdio_safe() -> bool =head1 HISTORY C was added in nbdkit 1.20. =head1 SEE ALSO L, L, L, L. =head1 AUTHORS Eric Blake =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit_strdup_intern.pod0000644000175000017500000000421214623341243014424 =head1 NAME nbdkit_strdup_intern, nbdkit_strndup_intern, nbdkit_printf_intern, nbdkit_vprintf_intern - create a string with limited lifetime for nbdkit =head1 SYNOPSIS #include const char *nbdkit_strdup_intern (const char *str); const char *nbdkit_strndup_intern (const char *str, size_t n); const char *nbdkit_printf_intern (const char *fmt, ...); const char *nbdkit_vprintf_intern (const char *fmt, va_list ap); =head1 DESCRIPTION Some callbacks are specified to return C, even when a plugin may not have a suitable compile-time constant to return. Returning dynamically-allocated memory for such a callback would induce a memory leak or otherwise complicate the plugin to perform additional bookkeeping. For these cases, nbdkit provides several convenience functions for creating a copy of a string for better lifetime management. =head2 nbdkit_strdup_intern =head2 nbdkit_strndup_intern Returns a copy of C, possibly limited to a maximum of C bytes. After calling this, the plugin may free C and use this copy in its place. If the copy is created outside the scope of a connection (such as during C<.load> or C<.config>), the lifetime of the copy will last at least through C<.unload>. If the copy is created after a client has triggered a connection (such as during C<.preconnect> or C<.open>), the lifetime will last at least through C<.close>, but the copy is not safe to share with other connections. =head2 C =head2 C Return a string created from a format template, with a lifetime longer than the current connection. These are shorthand for passing C to L on a temporary string, then passing that result to C. =head1 RETURN VALUE These functions return a string. This returned string I be freed by the caller. It will be freed by nbdkit. If there is an error they call L and return C<-1>. =head1 HISTORY The intern functions were added in nbdkit 1.24. =head1 SEE ALSO L, L, L. =head1 AUTHORS Eric Blake =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/nbdkit-tls.pod0000644000175000017500000003272614676465664012305 =head1 NAME nbdkit-tls - authentication and encryption of NBD connections (sometimes called "SSL") =head1 SYNOPSIS nbdkit [--tls=off|on|require] [--tls-certificates=/path/to/certificates] [--tls-psk=/path/to/pskfile] [--tls-verify-peer] PLUGIN [...] =head1 DESCRIPTION TLS (authentication and encryption, sometimes incorrectly called "SSL") is supported if nbdkit was compiled with GnuTLS. This allows the server to verify that the client is allowed access, and to encrypt the contents of the protocol in transit over the network. TLS can be disabled or enabled by specifying either I<--tls=off> or I<--tls=on>. With I<--tls=off>, if a client tries to use TLS to connect, it will be rejected by the server (in other words, as if the server doesn't support TLS). I<--tls=on> means that the client may choose to connect either with or without TLS. I<--tls=require> enables TLS B rejects all non-TLS connection attempts. This prevents downgrade attacks where a malicious proxy pretends not to support TLS in order to force either the client or server to communicate in plaintext. =head2 Example If certificates have been set up correctly then you should be able to start a TLS server by doing: nbdkit --tls=require memory 1G and connect to it by doing: nbdinfo nbds://localhost If certificates are in a non-standard directory and you have S 1.10>: nbdkit --tls=require --tls-certificates=/certs memory 1G nbdinfo nbds://localhost?tls-certificates=/certs =head2 TLS with X.509 certificates When nbdkit starts up, it loads TLS certificates from some built-in paths, or from the directory specified by the I<--tls-certificates> option. In this directory, nbdkit expects to find several files: =over 4 =item F The Certificate Authority certificate. =item F The server certificate. =item F The server private key. =item F (Optional) The certificate revocation list. =back =head3 Setting up the Certificate Authority This step only needs to be done once per organization. It may be that your organization already has a CA. $ certtool --generate-privkey > ca-key.pem $ chmod 0600 ca-key.pem The F file is the CA private key and is I sensitive data. With possession of this key, anyone can create certificates pretending to be your organization! To create the CA certificate file: $ cat > ca.info < server-key.pem $ chmod 0600 server-key.pem The server key file is sensitive. Setting the mode to C<0600> helps to prevent other users on the same machine from reading it. The common name (C below) field must be the fully qualified hostname that the client connects to. However most clients and servers including nbdkit support the Subject Alternative Name extension (S) which uses the C and C fields and deprecates C. $ cat > server.info < You don't need to create client certificates unless you want to check and limit which clients can connect to nbdkit. B unless you specify the I<--tls-verify-peer> option on the command line. There are other methods for limiting access to nbdkit including L. For each client you should generate a private key and a client certificate: $ certtool --generate-privkey > client-key.pem $ chmod 0600 client-key.pem The client key file is sensitive. The client DNS name (C below) is the client's name for information only. $ cat > client.info < need to be present anywhere on the nbdkit host. You don't need to copy them into nbdkit's TLS certificates directory. The security comes from the fact that the client must present a client certificate signed by the Certificate Authority, and nbdkit can check this because it has the F file. To enable checking of client certificates, specify the I<--tls-verify-peer> option on the command line. Clients which don't present a valid certificate (eg. not signed, incorrect signature) are denied. Also denied are clients which present a valid certificate signed by another CA. Also denied are clients with certificates added to the certificate revocation list (F). =head2 Connecting nbd-client to nbdkit with TLS certificates With the TLS certificates files generated above in the current directory (C<.>) you can use: nbdkit --tls=require --tls-certificates=. --tls-verify-peer memory 1G nbd-client /dev/nbd0 \ -cacertfile ca-cert.pem \ -certfile client-cert.pem \ -keyfile client-key.pem I<--tls-verify-peer> is only required if you want to check the client certificate. If you want to allow any client to connect then you can omit it. =head2 TLS with Pre-Shared Keys (PSK) As a simpler alternative to TLS certificates, you may use pre-shared keys to authenticate clients. Create a PSK file containing one or more C pairs. It is easiest to use L for this: mkdir -m 0700 /tmp/keys psktool -u alice -p /tmp/keys/keys.psk The PSK file contains the hex-encoded random keys in plaintext. Any client which can read this file will be able to connect to the server. Use the nbdkit I<--tls-psk> option to start the server: nbdkit --tls=require --tls-psk=/tmp/keys/keys.psk file disk.img This option overrides X.509 certificate authentication. Clients must supply one of the usernames in the PSK file and the corresponding key in order to connect. An example of connecting using L using an NBD URI is: nbdinfo 'nbds://alice@localhost?tls-psk-file=/tmp/keys/keys.psk' An example of connecting using L is: qemu-img info \ --object tls-creds-psk,id=tls0,dir=/tmp/keys,username=alice,endpoint=client \ --image-opts \ file.driver=nbd,file.host=localhost,file.port=10809,file.tls-creds=tls0,file.export=/ =head2 Default TLS behaviour If nbdkit was compiled without GnuTLS support, then TLS is disabled and TLS connections will be rejected (as if I<--tls=off> was specified on the command line). Also it is impossible to turn on TLS in this scenario. You can tell if nbdkit was compiled without GnuTLS support because C will contain C. If TLS certificates cannot be loaded either from the built-in path or from the directory specified by I<--tls-certificates>, then TLS defaults to disabled. Turning TLS on will give a warning (I<--tls=on>) or error (I<--tls=require>) about the missing certificates. If TLS certificates can be loaded from the built-in path or from the I<--tls-certificates> directory, then TLS will by default be enabled (like I<--tls=on>), but it is not required. Clients can choose whether or not to use TLS and whether or not to present certificates. TLS client certificates are I checked by default unless you specify I<--tls-verify-peer>. If the I<--tls-psk> option is used then TLS is enabled (but I required). To ensure that all clients are authorized you must use I<--tls=require>. Each of these defaults is insecure to some extent (including I<--tls=on> which could be subject to a downgrade attack). If you expect TLS then it is best to specify I<--tls=require>, and if you want to check client certificates, additionally use the I<--tls-verify-peer> option. =head2 Controlling TLS fallback to plaintext When I<--tls=on> is used, the connection can fall back to plaintext. You can use L to provide safe fallback content to plaintext connections. With this filter the underlying plugin content is only served on secure connections. Alternatively a plugin may wish to serve different content depending on whether the client is using TLS. The function L can be used during the C<.open> callback for that purpose. =head2 NBD URIs for TLS Tools such L, L and L (from L) allow you to use C or C URIs to connect to nbdkit servers using TLS. The syntax is fully documented in the NBD URI specification: L. This section contains an outline. You can also find further examples in L. Use the nbdkit I<--print-uri> option to print the URI when nbdkit starts up. =over 4 =item Bexample.com Connect over TCP with TLS, to C port 10809. If the server does not support TLS then this will fail. =item BSOCKET As above, but connect over a Unix domain socket called F. =item BSOCKETB<&tls-certificates=>DIR As above, but specify the directory F containing TLS certificates (used by the client to verify the server, and to present client authentication to the server). Note this requires S 1.10>. =item BSOCKETB<&tls-psk-file=>FILENAME As above, but use TLS with Pre-Shared Keys (PSK), stored in the secrets file F. =item BaliceB<@/?socket=>SOCKETB<&tls-psk-file=>FILENAME As above, but use C as the username. =back =head2 Default location of certificates Without I<--tls-certificates> nbdkit and libnbd look in several locations for certificates. If nbdkit is started as a non-root user (note this does not include use of the I<-u> or I<-g> options), nbdkit looks in each of these paths in turn: $HOME/.pki/nbdkit/ $HOME/.config/pki/nbdkit/ If nbdkit is started as root: $sysconfdir/pki/nbdkit/ where $sysconfdir is set when nbdkit is compiled, usually F. (Use C and look at the C setting to get the actual directory built into the binary.) In libnbd the paths are different. For non-root: $HOME/.pki/libnbd/ $HOME/.config/pki/libnbd/ For root: $sysconfdir/pki/libnbd/ In nbdkit you can override these directories by using I<--tls-certificates=/path/to/certificates>. In libnbd you can use L. In S 1.10> you can append C<&tls-certificates=/path/to/certificates> to URIs. =head2 Choice of TLS algorithms TLS has a bewildering choice of algorithms that can be used. To enable you to choose a default set of algorithms, there is a configure setting I<--with-tls-priority>. This defaults to C which, to quote the GnuTLS documentation: =over 4 "C means all C ciphersuites. The 256-bit ciphers are included as a fallback only. The ciphers are sorted by security margin." =back You could also set the TLS priority so that it can be configured from a file at runtime: ./configure --with-tls-priority=@SYSTEM means use the policy from F. ./configure --with-tls-priority=@NBDKIT,SYSTEM means use the policy from F and fall back to F if the first file does not exist. More information can be found in L. =head2 Debugging TLS connections Encrypted connections makes snooping on network traffic with Wireshark impossible, by design. The TLS library used by nbdkit, called gnutls, supports the C standard: L Before running nbdkit set the environment variable to point to a log file (note it will append to the file if it already exists): SSLKEYLOGFILE=/tmp/keylog nbdkit [...] In Wireshark go to Edit → Preferences → Protocols → TLS and set S<(Pre)-Master-Secret log filename> to the log file name. Wireshark should be able to see the unencrypted traffic. For further information read: L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L. =head1 AUTHORS Eric Blake Richard W.M. Jones Pino Toscano =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/docs/synopsis.txt0000644000175000017500000000173014771245250012124 nbdkit [-4|--ipv4-only] [-6|--ipv6-only] [-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N] [--exit-with-parent] [-e|--exportname EXPORTNAME] [--filter=FILTER ...] [-f|--foreground] [-g|--group GROUP] [-i|--ipaddr IPADDR] [--keepalive] [--log=stderr|syslog|null] [--mask-handshake=MASK] [-n|--newstyle] [--no-mc|--no-meta-contexts] [--no-sr|--no-structured-replies] [-o|--oldstyle] [-P|--pidfile PIDFILE] [-p|--port PORT] [--print-uri] [-r|--readonly] [--run 'COMMAND ARGS ...'] [--selinux-label=LABEL] [-s|--single] [--swap] [-t|--threads THREADS] [--timeout=TIMEOUT] [--tls=off|on|require] [--tls-certificates=/path/to/certificates] [--tls-psk=/path/to/pskfile] [--tls-verify-peer] [-U|--unix SOCKET|-] [-u|--user USER] [-v|--verbose] [--vsock] PLUGIN [[KEY=]VALUE [KEY=VALUE [...]]] nbdkit --dump-config nbdkit PLUGIN --dump-plugin nbdkit --help nbdkit [-V|--version] nbdkit-1.42.2/docs/nbdkit_absolute_path.30000644000175000017500000000003314623341243013733 .so man3/nbdkit_realpath.3 nbdkit-1.42.2/docs/nbdkit_disconnect.30000644000175000017500000000003314623341243013232 .so man3/nbdkit_shutdown.3 nbdkit-1.42.2/docs/nbdkit_parse_int8_t.30000644000175000017500000000003414623341243013501 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_int16_t.30000644000175000017500000000003414623341243013560 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_int32_t.30000644000175000017500000000003414623341243013556 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_int64_t.30000644000175000017500000000003414623341243013563 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_uint8_t.30000644000175000017500000000003414623341243013666 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_uint16_t.30000644000175000017500000000003414623341243013745 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_uint32_t.30000644000175000017500000000003414623341243013743 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_uint64_t.30000644000175000017500000000003414623341243013750 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_parse_unsigned.30000644000175000017500000000003414623341243014110 .so man3/nbdkit_parse_int.3 nbdkit-1.42.2/docs/nbdkit_peer_gid.30000644000175000017500000000003414623341243012660 .so man3/nbdkit_peer_name.3 nbdkit-1.42.2/docs/nbdkit_peer_pid.30000644000175000017500000000003414623341243012671 .so man3/nbdkit_peer_name.3 nbdkit-1.42.2/docs/nbdkit_peer_uid.30000644000175000017500000000003414623341243012676 .so man3/nbdkit_peer_name.3 nbdkit-1.42.2/docs/nbdkit_peer_security_context.30000644000175000017500000000003414623341243015530 .so man3/nbdkit_peer_name.3 nbdkit-1.42.2/docs/nbdkit_peer_tls_issuer_dn.30000644000175000017500000000003614676465664015022 .so man3/nbdkit_peer_tls_dn.3 nbdkit-1.42.2/docs/nbdkit_printf_intern.30000644000175000017500000000004014623341243013760 .so man3/nbdkit_strdup_intern.3 nbdkit-1.42.2/docs/nbdkit_set_error.30000644000175000017500000000003014623341243013102 .so man3/nbdkit_error.3 nbdkit-1.42.2/docs/nbdkit_strndup_intern.30000644000175000017500000000004014623341243014155 .so man3/nbdkit_strdup_intern.3 nbdkit-1.42.2/docs/nbdkit_vdebug.30000644000175000017500000000003014623341243012352 .so man3/nbdkit_debug.3 nbdkit-1.42.2/docs/nbdkit_verror.30000644000175000017500000000003014623341243012415 .so man3/nbdkit_error.3 nbdkit-1.42.2/docs/nbdkit_vprintf_intern.30000644000175000017500000000004014623341243014146 .so man3/nbdkit_strdup_intern.3 nbdkit-1.42.2/fuzzing/0000755000175000017500000000000014771247240010320 5nbdkit-1.42.2/fuzzing/testcase_dir/0000755000175000017500000000000014771247240012771 5nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags0000644000175000017500000000000414534316443015734 nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-exportname0000644000175000017500000000002514534316443020117 IHAVEOPT/nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-exportname-read40000644000175000017500000000020514534316443021114 IHAVEOPT/%`•%`•%`•%`•nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-go0000644000175000017500000000003214534316443016340 IHAVEOPTnbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-go-read0000644000175000017500000000006614534316443017260 IHAVEOPT%`•nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-go-read40000644000175000017500000000021214534316443017335 IHAVEOPT%`•%`•%`•%`•nbdkit-1.42.2/fuzzing/testcase_dir/newstyle-cflags-go-write0000644000175000017500000000010614534316443017472 IHAVEOPT%`•0123456789abcdefnbdkit-1.42.2/fuzzing/Makefile.am0000644000175000017500000000343714534316443012302 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = \ README \ testcase_dir/newstyle-cflags \ testcase_dir/newstyle-cflags-exportname \ testcase_dir/newstyle-cflags-exportname-read4 \ testcase_dir/newstyle-cflags-go \ testcase_dir/newstyle-cflags-go-read \ testcase_dir/newstyle-cflags-go-read4 \ testcase_dir/newstyle-cflags-go-write \ $(NULL) nbdkit-1.42.2/fuzzing/Makefile.in0000644000175000017500000004521114771245447012317 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = fuzzing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll EXTRA_DIST = \ README \ testcase_dir/newstyle-cflags \ testcase_dir/newstyle-cflags-exportname \ testcase_dir/newstyle-cflags-exportname-read4 \ testcase_dir/newstyle-cflags-go \ testcase_dir/newstyle-cflags-go-read \ testcase_dir/newstyle-cflags-go-read4 \ testcase_dir/newstyle-cflags-go-write \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fuzzing/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fuzzing/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/fuzzing/README0000644000175000017500000001033514534316443011121 To report security bugs, see ‘SECURITY’ in the top source directory. Fuzzing nbdkit using the American Fuzzy Lop (AFL) fuzzer ======================================================== You can fuzz nbdkit with AFL or AFL++ (https://aflplus.plus/) using the -s (read from stdin) option. You will need to recompile nbdkit with AFL instrumentation: ./configure CC=/usr/bin/afl-gcc CXX=/usr/bin/afl-g++ make clean make To use clang instead (recommended with AFL++): export AFL_USE_ASAN=1 ./configure CC=/usr/bin/afl-clang-lto CXX=/usr/bin/afl-clang-lto++ \ --disable-linker-script make clean make The fuzzing/testcase_dir directory contains some initial testcases that AFL can use. Run multiple copies of afl-fuzz. Usually you should run 1 master (-M) and as many slaves (-S) as you can. Master: mkdir -p fuzzing/sync_dir export AFL_PRELOAD=./plugins/pattern/.libs/nbdkit-pattern-plugin.so afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -M fuzz01 \ ./server/nbdkit -s -t 1 \ --filter=./filters/cow/.libs/nbdkit-cow-filter.so \ ./plugins/pattern/.libs/nbdkit-pattern-plugin.so 1M Slaves: # replace fuzzNN with fuzz02, fuzz03, etc. export AFL_PRELOAD=./plugins/pattern/.libs/nbdkit-pattern-plugin.so afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -S fuzzNN \ ./server/nbdkit -s -t 1 \ --filter=./filters/cow/.libs/nbdkit-cow-filter.so \ ./plugins/pattern/.libs/nbdkit-pattern-plugin.so 1M Test Coverage ------------- To find out if the fuzzing is covering all of the code, I used afl-cov (https://github.com/mrash/afl-cov). Usage is rather complex, so consult the README of that project, but in brief: (1) Create a second copy of the nbdkit source, and compile it with profiling: ./configure CFLAGS="-O2 -g -pg -fprofile-arcs -ftest-coverage" make clean make (2) Assuming ../nbdkit-afl is the nbdkit source compiled with AFL, and the current directory is nbdkit compiled with profiling, then run the command below. You can run this even while afl-fuzz is running. afl-cov -d ../nbdkit-afl/fuzzing/sync_dir \ --code-dir . \ --coverage-cmd "cat AFL_FILE | <>" (replace <> with the './server/nbdkit -s -t 1 ...' command that you are fuzzing). This will create an HTML test coverage report in ../nbdkit-afl/fuzzing/sync_dir/cov/web/ Notes ----- We only have testcases for the newstyle fixed protocol so far, but if people report that they are exposing the oldstyle protocol to the internet / untrusted clients then we could extend the testing for that. We have only fuzzed a handful of plugins. Since plugins can have bugs as well as the core server, it may be productive to test other plugins and filters. Fuzzing nbdkit using honggfuzz ============================== Recompile nbdkit with honggfuzz instrumentation: ./configure CC=/path/to/hfuzz-clang CXX=/path/to/hfuzz-clang++ make clean make Run honggfuzz using test cases: honggfuzz -i fuzzing/testcase_dir -z -s -- \ ./server/nbdkit -s -t 1 ./plugins/memory/.libs/nbdkit-memory-plugin.so 1M Fuzzing nbdkit using Clang + libFuzzer ====================================== Recompile nbdkit with libFuzzer enabled and build the libFuzzer test binary: ./configure \ CC=clang \ CFLAGS="-g -O1 -fPIC" \ --enable-libfuzzer \ --disable-perl make clean make CFLAGS="-g -O1 -fPIC -fsanitize=fuzzer,address" (The awkward CFLAGS on the make command line are necessary because ./configure attempts to test that the compiler works, but this test fails when -fsanitize=fuzzer is used as that option adds an extra main() definition.) ",address" enables the Clang Address Sanitizer, and can be omitted for faster fuzzing. This builds a specialized version of nbdkit which is the fuzzer test program (testing only nbdkit-memory-plugin unless you modify the source). You can run it like this on the input corpus: ./server/nbdkit fuzzing/testcase_dir New test inputs are written to fuzzing/testcase_dir and will be used on subsequent runs. If this is undesirable then delete fuzzing/testcase_dir/[0-f]* before the run. There are various extra command line options supported by libFuzzer. For more details see: https://llvm.org/docs/LibFuzzer.html nbdkit-1.42.2/valgrind/0000755000175000017500000000000014771247240010432 5nbdkit-1.42.2/valgrind/Makefile.am0000644000175000017500000000333314534316443012407 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk suppressions_files = $(wildcard $(srcdir)/*.suppressions) EXTRA_DIST = $(suppressions_files) noinst_DATA = suppressions suppressions: $(suppressions_files) rm -f $@ $@-t cat $^ > $@-t mv $@-t $@ chmod 0444 $@ DISTCLEANFILES = suppressions nbdkit-1.42.2/valgrind/Makefile.in0000644000175000017500000004522214771245450012425 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = valgrind ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll suppressions_files = $(wildcard $(srcdir)/*.suppressions) EXTRA_DIST = $(suppressions_files) noinst_DATA = suppressions DISTCLEANFILES = suppressions all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign valgrind/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign valgrind/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile suppressions: $(suppressions_files) rm -f $@ $@-t cat $^ > $@-t mv $@-t $@ chmod 0444 $@ # 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: nbdkit-1.42.2/valgrind/ext2fs.suppressions0000644000175000017500000000310714534316443014264 # ext2fs valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # The error table is always leaked. { ext2fs_1 Memcheck:Leak fun:malloc fun:initialize_ext2_error_table_r } nbdkit-1.42.2/valgrind/glibc.suppressions0000644000175000017500000000515114534316443014132 # glibc valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # Allow thread-local storage from pthread_create to leak. { glibc_1 Memcheck:Leak fun:calloc ... fun:_dl_allocate_tls } # Suppress leaks from dlopen. When running under valgrind we # deliberately don't run dlclose because otherwise valgrind cannot # print symbols. So it's expected that dlopen will leak. { glibc_2a Memcheck:Leak ... obj:/usr/lib*/libdl-* } { glibc_2b Memcheck:Leak ... fun:dlopen@@* } # bindtextdomain leaks. { glibc_3 Memcheck:Leak ... fun:bindtextdomain } # Both gmtime_r and locatime_r leak some sort of timezone-related # struct inside glibc. These are used by the log filter and the # floppy plugin. { glibc_4 Memcheck:Leak fun:malloc ... fun:tzset_internal } # __printf_chk leaks. { glibc_5 Memcheck:Leak fun:malloc ... fun:__printf_chk } # iconv is very leaky, even if we close the handle. { glibc_6 Memcheck:Leak fun:malloc ... fun:__gconv_open } { glibc_7 Memcheck:Leak fun:calloc ... fun:__gconv_open } # getaddrinfo leaks a memory allocation even though we # call freeaddrinfo. { glibc_8 Memcheck:Leak fun:malloc ... fun:__check_pf fun:getaddrinfo } nbdkit-1.42.2/valgrind/gnutls.suppressions0000644000175000017500000000315214534316443014365 # gnutls valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # Although we call gnutls_global_init/gnutls_global_deinit, gnutls # still leaks stuff. { gnutls_1 Memcheck:Leak ... fun:_gnutls_global_init } nbdkit-1.42.2/valgrind/nbdkit.suppressions0000644000175000017500000000520514534316443014325 # nbdkit valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # This is a fairly unavoidable leak which happens when we fork # into the background. The foreground process exits, but does # not free the malloc'd list of sockets. { nbdkit_1 Memcheck:Leak fun:malloc fun:bind_unix_socket } # Accepting a connection starts a thread (which allocates a thread # stack). However if we get a signal then there's no way to cleanly # exit all threads in progress, so the stack leaks. { nbdkit_2 Memcheck:Leak ... fun:allocate_stack } # close methods are not guaranteed to be called if a connection is in # progress when the server is being shut down, so leaks in various # *_open functions are fairly inevitable. We simply have to check by # hand that the following leaks are not possible under normal # circumstances, and then add them to this list. { nbdkit_3 Memcheck:Leak fun:malloc fun:error_open fun:filter_open } { nbdkit_4 Memcheck:Leak fun:malloc fun:file_open fun:plugin_open } { nbdkit_5 Memcheck:Leak fun:malloc fun:memory_open fun:plugin_open } { nbdkit_6 Memcheck:Leak fun:malloc fun:null_open fun:plugin_open } { nbdkit_7 Memcheck:Leak fun:malloc fun:partition_open fun:filter_open } nbdkit-1.42.2/valgrind/ocaml.suppressions0000644000175000017500000000435114534316443014146 # OCaml valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # OCaml caml_stat_* allocations are meant to be "static" so OCaml will # never free them by design. See the OCaml manual, chapter # "Interfacing C with OCaml". { ocaml_stat_allocations Memcheck:Leak ... fun:caml_stat_alloc* } # This one seems to be a real leak, starting in OCaml 4.13 { caml_setup_stack_overflow_detection Memcheck:Leak ... fun:caml_setup_stack_overflow_detection } # Valgrind bug affecting OCaml 4.14 # https://bugs.kde.org/show_bug.cgi?id=455711 { caml_terminate_signals_uninitialized_sigaltstack Memcheck:Param sigaltstack(ss) fun:sigaltstack fun:caml_terminate_signals } { caml_stop_stack_overflow_detection_uninitialized_sigaltstack Memcheck:Param sigaltstack(ss) fun:sigaltstack fun:caml_stop_stack_overflow_detection } nbdkit-1.42.2/valgrind/perl.suppressions0000644000175000017500000000342114534316443014012 # Perl valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # Perl leaks lots of memory by design. { perl_1 Memcheck:Leak fun:malloc ... fun:perl_construct } { perl_2 Memcheck:Leak fun:realloc ... fun:perl_construct } # The perl_parse function which parses the Perl script leaks memory. { perl_3 Memcheck:Leak ... fun:Perl_yyparse fun:perl_parse } nbdkit-1.42.2/valgrind/sh.suppressions0000644000175000017500000000315314534316443013464 # nbdkit-sh-plugin valgrind suppressions # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit-sh-plugin calls setenv at load time and this unavoidably # leaks memory. { sh_1 Memcheck:Leak ... fun:setenv fun:sh_load } nbdkit-1.42.2/include/0000755000175000017500000000000014771247240010247 5nbdkit-1.42.2/include/Makefile.am0000644000175000017500000000311614534316443012223 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk include_HEADERS = \ nbdkit-common.h \ nbdkit-plugin.h \ nbdkit-filter.h \ nbdkit-version.h \ $(NULL) nbdkit-1.42.2/include/nbdkit-common.h0000644000175000017500000001700714676465664013126 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_COMMON_H #define NBDKIT_COMMON_H #if !defined (NBDKIT_PLUGIN_H) && !defined (NBDKIT_FILTER_H) #error this header file should not be directly included #endif #include #include #include #if !defined (_WIN32) && !defined (__MINGW32__) && \ !defined (__CYGWIN__) && !defined (_MSC_VER) #include #else #include #endif #include #ifdef __cplusplus extern "C" { #endif #if (defined (__GNUC__) || defined (__clang__)) && \ defined (HAVE_VFPRINTF_PERCENT_M) #define ATTRIBUTE_FORMAT_PRINTF(fmtpos, argpos) \ __attribute__ ((__format__ (__printf__, fmtpos, argpos))) #else #define ATTRIBUTE_FORMAT_PRINTF(fmtpos, argpos) #endif #define NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS 0 #define NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS 1 #define NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS 2 #define NBDKIT_THREAD_MODEL_PARALLEL 3 #define NBDKIT_FLAG_MAY_TRIM (1<<0) /* Maps to !NBD_CMD_FLAG_NO_HOLE */ #define NBDKIT_FLAG_FUA (1<<1) /* Maps to NBD_CMD_FLAG_FUA */ #define NBDKIT_FLAG_REQ_ONE (1<<2) /* Maps to NBD_CMD_FLAG_REQ_ONE */ #define NBDKIT_FLAG_FAST_ZERO (1<<3) /* Maps to NBD_CMD_FLAG_FAST_ZERO */ #define NBDKIT_FUA_NONE 0 #define NBDKIT_FUA_EMULATE 1 #define NBDKIT_FUA_NATIVE 2 #define NBDKIT_CACHE_NONE 0 #define NBDKIT_CACHE_EMULATE 1 #define NBDKIT_CACHE_NATIVE 2 #define NBDKIT_EXTENT_HOLE (1<<0) /* Same as NBD_STATE_HOLE */ #define NBDKIT_EXTENT_ZERO (1<<1) /* Same as NBD_STATE_ZERO */ #ifndef WIN32 #define NBDKIT_EXTERN_DECL(ret, fn, args) extern ret fn args #define NBDKIT_DLL_PUBLIC __attribute__ ((__visibility__ ("default"))) #else #define NBDKIT_EXTERN_DECL(ret, fn, args) \ extern __declspec (dllexport) ret fn args #define NBDKIT_DLL_PUBLIC __declspec (dllexport) #endif NBDKIT_EXTERN_DECL (void, nbdkit_error, (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2)); NBDKIT_EXTERN_DECL (void, nbdkit_verror, (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0)); NBDKIT_EXTERN_DECL (void, nbdkit_debug, (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2)); NBDKIT_EXTERN_DECL (void, nbdkit_vdebug, (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0)); NBDKIT_EXTERN_DECL (char *, nbdkit_absolute_path, (const char *path)); NBDKIT_EXTERN_DECL (int64_t, nbdkit_parse_size, (const char *str)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_probability, (const char *what, const char *str, double *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_bool, (const char *str)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_delay, (const char *what, const char *str, unsigned *sec, unsigned *nsec)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_int, (const char *what, const char *str, int *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_unsigned, (const char *what, const char *str, unsigned *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_int8_t, (const char *what, const char *str, int8_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_uint8_t, (const char *what, const char *str, uint8_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_int16_t, (const char *what, const char *str, int16_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_uint16_t, (const char *what, const char *str, uint16_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_int32_t, (const char *what, const char *str, int32_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_uint32_t, (const char *what, const char *str, uint32_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_int64_t, (const char *what, const char *str, int64_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_parse_uint64_t, (const char *what, const char *str, uint64_t *r)); NBDKIT_EXTERN_DECL (int, nbdkit_stdio_safe, (void)); NBDKIT_EXTERN_DECL (int, nbdkit_read_password, (const char *value, char **password)); NBDKIT_EXTERN_DECL (char *, nbdkit_realpath, (const char *path)); NBDKIT_EXTERN_DECL (int, nbdkit_nanosleep, (unsigned sec, unsigned nsec)); NBDKIT_EXTERN_DECL (int, nbdkit_peer_name, (struct sockaddr *addr, socklen_t *addrlen)); NBDKIT_EXTERN_DECL (int64_t, nbdkit_peer_pid, (void)); NBDKIT_EXTERN_DECL (int64_t, nbdkit_peer_uid, (void)); NBDKIT_EXTERN_DECL (int64_t, nbdkit_peer_gid, (void)); NBDKIT_EXTERN_DECL (char *, nbdkit_peer_security_context, (void)); NBDKIT_EXTERN_DECL (char *, nbdkit_peer_tls_dn, (void)); NBDKIT_EXTERN_DECL (char *, nbdkit_peer_tls_issuer_dn, (void)); NBDKIT_EXTERN_DECL (void, nbdkit_shutdown, (void)); NBDKIT_EXTERN_DECL (void, nbdkit_disconnect, (int force)); NBDKIT_EXTERN_DECL (const char *, nbdkit_strdup_intern, (const char *str)); NBDKIT_EXTERN_DECL (const char *, nbdkit_strndup_intern, (const char *str, size_t n)); NBDKIT_EXTERN_DECL (const char *, nbdkit_printf_intern, (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2)); NBDKIT_EXTERN_DECL (const char *, nbdkit_vprintf_intern, (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0)); struct nbdkit_extents; NBDKIT_EXTERN_DECL (int, nbdkit_add_extent, (struct nbdkit_extents *, uint64_t offset, uint64_t length, uint32_t type)); struct nbdkit_exports; NBDKIT_EXTERN_DECL (int, nbdkit_add_export, (struct nbdkit_exports *, const char *name, const char *description)); NBDKIT_EXTERN_DECL (int, nbdkit_use_default_export, (struct nbdkit_exports *)); /* A static non-NULL pointer which can be used when you don't need a * per-connection handle. */ #define NBDKIT_HANDLE_NOT_NEEDED (&errno) #ifdef __cplusplus } #endif #ifdef __cplusplus #define NBDKIT_CXX_LANG_C extern "C" #else #define NBDKIT_CXX_LANG_C /* nothing */ #endif #endif /* NBDKIT_COMMON_H */ nbdkit-1.42.2/include/nbdkit-plugin.h0000644000175000017500000001441414534316443013112 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* See nbdkit-plugin(3) for documentation and how to write a plugin. */ #ifndef NBDKIT_PLUGIN_H #define NBDKIT_PLUGIN_H #include #ifdef __cplusplus extern "C" { #endif /* By default, a plugin gets API version 1; but you may request * version 2 prior to including this header */ #ifndef NBDKIT_API_VERSION #define NBDKIT_API_VERSION 1 #elif (NBDKIT_API_VERSION - 0) < 1 || NBDKIT_API_VERSION > 2 #error Unsupported API version #endif struct nbdkit_plugin { /* Do not set these fields directly; use NBDKIT_REGISTER_PLUGIN. * They exist so that we can support plugins compiled against * one version of the header with a runtime compiled against a * different version with more (or fewer) fields. */ uint64_t _struct_size; int _api_version; int _thread_model; /* Plugins are responsible for these fields; see the documentation * for semantics, and which fields are optional. New fields will * only be added at the end of the struct. */ const char *name; const char *longname; const char *version; const char *description; void (*load) (void); void (*unload) (void); int (*config) (const char *key, const char *value); int (*config_complete) (void); const char *config_help; void * (*open) (int readonly); void (*close) (void *handle); int64_t (*get_size) (void *handle); int (*can_write) (void *handle); int (*can_flush) (void *handle); int (*is_rotational) (void *handle); int (*can_trim) (void *handle); #if NBDKIT_API_VERSION == 1 int (*pread) (void *handle, void *buf, uint32_t count, uint64_t offset); int (*pwrite) (void *handle, const void *buf, uint32_t count, uint64_t offset); int (*flush) (void *handle); int (*trim) (void *handle, uint32_t count, uint64_t offset); int (*zero) (void *handle, uint32_t count, uint64_t offset, int may_trim); #else int (*_pread_v1) (void *, void *, uint32_t, uint64_t); int (*_pwrite_v1) (void *, const void *, uint32_t, uint64_t); int (*_flush_v1) (void *); int (*_trim_v1) (void *, uint32_t, uint64_t); int (*_zero_v1) (void *, uint32_t, uint64_t, int); #endif int errno_is_preserved; void (*dump_plugin) (void); int (*can_zero) (void *handle); int (*can_fua) (void *handle); #if NBDKIT_API_VERSION == 1 int (*_unused1) (void *, void *, uint32_t, uint64_t, uint32_t); int (*_unused2) (void *, const void *, uint32_t, uint64_t, uint32_t); int (*_unused3) (void *, uint32_t); int (*_unused4) (void *, uint32_t, uint64_t, uint32_t); int (*_unused5) (void *, uint32_t, uint64_t, uint32_t); #else int (*pread) (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags); int (*pwrite) (void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags); int (*flush) (void *handle, uint32_t flags); int (*trim) (void *handle, uint32_t count, uint64_t offset, uint32_t flags); int (*zero) (void *handle, uint32_t count, uint64_t offset, uint32_t flags); #endif const char *magic_config_key; int (*can_multi_conn) (void *handle); int (*can_extents) (void *handle); int (*extents) (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents); int (*can_cache) (void *handle); int (*cache) (void *handle, uint32_t count, uint64_t offset, uint32_t flags); int (*thread_model) (void); int (*can_fast_zero) (void *handle); int (*preconnect) (int readonly); int (*get_ready) (void); int (*after_fork) (void); int (*list_exports) (int readonly, int is_tls, struct nbdkit_exports *exports); const char * (*default_export) (int readonly, int is_tls); const char * (*export_description) (void *handle); void (*cleanup) (void); int (*block_size) (void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); }; NBDKIT_EXTERN_DECL (void, nbdkit_set_error, (int err)); NBDKIT_EXTERN_DECL (const char *, nbdkit_export_name, (void)); NBDKIT_EXTERN_DECL (int, nbdkit_is_tls, (void)); #define NBDKIT_REGISTER_PLUGIN(plugin) \ NBDKIT_CXX_LANG_C \ NBDKIT_DLL_PUBLIC \ struct nbdkit_plugin * \ plugin_init (void) \ { \ (plugin)._struct_size = sizeof (plugin); \ (plugin)._api_version = NBDKIT_API_VERSION; \ (plugin)._thread_model = THREAD_MODEL; \ return &(plugin); \ } #ifdef __cplusplus } #endif #endif /* NBDKIT_PLUGIN_H */ nbdkit-1.42.2/include/nbdkit-filter.h0000644000175000017500000002676214534316443013112 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* See nbdkit-filter(3) for documentation and how to write a filter. */ #ifndef NBDKIT_FILTER_H #define NBDKIT_FILTER_H #include #include #ifdef __cplusplus extern "C" { #endif #define NBDKIT_FILTER_API_VERSION 6 /* Corresponding to v1.16+ */ #define NBDKIT_ZERO_NONE 0 #define NBDKIT_ZERO_EMULATE 1 #define NBDKIT_ZERO_NATIVE 2 #ifdef NBDKIT_INTERNAL /* Opaque types encapsulating all information needed for calling into * the next filter or plugin. */ typedef struct backend nbdkit_backend; typedef struct context nbdkit_context; typedef struct context nbdkit_next; #else typedef struct nbdkit_backend nbdkit_backend; typedef struct nbdkit_context nbdkit_context; typedef struct nbdkit_next_ops nbdkit_next; #endif /* Next ops. */ typedef int nbdkit_next_config (nbdkit_backend *nxdata, const char *key, const char *value); typedef int nbdkit_next_config_complete (nbdkit_backend *nxdata); typedef int nbdkit_next_preconnect (nbdkit_backend *nxdata, int readonly); typedef int nbdkit_next_list_exports (nbdkit_backend *nxdata, int readonly, struct nbdkit_exports *exports); typedef const char *nbdkit_next_default_export (nbdkit_backend *nxdata, int readonly); typedef int nbdkit_next_open (nbdkit_context *context, int readonly, const char *exportname); struct nbdkit_next_ops { /* These callbacks are only needed when managing the backend manually * rather than via nbdkit_next_open. */ int (*prepare) (nbdkit_next *nxdata); int (*finalize) (nbdkit_next *nxdata); /* These callbacks are the same as normal plugin operations. */ int64_t (*get_size) (nbdkit_next *nxdata); const char * (*export_description) (nbdkit_next *nxdata); int (*block_size) (nbdkit_next *nxdata, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); int (*can_write) (nbdkit_next *nxdata); int (*can_flush) (nbdkit_next *nxdata); int (*is_rotational) (nbdkit_next *nxdata); int (*can_trim) (nbdkit_next *nxdata); int (*can_zero) (nbdkit_next *nxdata); int (*can_fast_zero) (nbdkit_next *nxdata); int (*can_extents) (nbdkit_next *nxdata); int (*can_fua) (nbdkit_next *nxdata); int (*can_multi_conn) (nbdkit_next *nxdata); int (*can_cache) (nbdkit_next *nxdata); int (*pread) (nbdkit_next *nxdata, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*pwrite) (nbdkit_next *nxdata, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*flush) (nbdkit_next *nxdata, uint32_t flags, int *err); int (*trim) (nbdkit_next *nxdata, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*zero) (nbdkit_next *nxdata, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*extents) (nbdkit_next *nxdata, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err); int (*cache) (nbdkit_next *nxdata, uint32_t count, uint64_t offset, uint32_t flags, int *err); /* Note: Actual instances of this struct contain additional opaque * data not listed in this header; you cannot manually copy or * initialize sizeof(struct nbdkit_next_ops) bytes, but must instead * use unchanged pointers obtained from the nbdkit API. */ }; /* Extent functions. */ struct nbdkit_extent { uint64_t offset; uint64_t length; uint32_t type; }; NBDKIT_EXTERN_DECL (struct nbdkit_extents *, nbdkit_extents_new, (uint64_t start, uint64_t end)); NBDKIT_EXTERN_DECL (void, nbdkit_extents_free, (struct nbdkit_extents *)); NBDKIT_EXTERN_DECL (size_t, nbdkit_extents_count, (const struct nbdkit_extents *)); NBDKIT_EXTERN_DECL (struct nbdkit_extent, nbdkit_get_extent, (const struct nbdkit_extents *, size_t)); NBDKIT_EXTERN_DECL (struct nbdkit_extents *, nbdkit_extents_full, (nbdkit_next *next, uint32_t count, uint64_t offset, uint32_t flags, int *err)); NBDKIT_EXTERN_DECL (int, nbdkit_extents_aligned, (nbdkit_next *next, uint32_t count, uint64_t offset, uint32_t flags, uint32_t align, struct nbdkit_extents *extents, int *err)); /* Export functions. */ struct nbdkit_export { char *name; char *description; }; NBDKIT_EXTERN_DECL (struct nbdkit_exports *, nbdkit_exports_new, (void)); NBDKIT_EXTERN_DECL (void, nbdkit_exports_free, (struct nbdkit_exports *)); NBDKIT_EXTERN_DECL (size_t, nbdkit_exports_count, (const struct nbdkit_exports *)); NBDKIT_EXTERN_DECL (const struct nbdkit_export, nbdkit_get_export, (const struct nbdkit_exports *, size_t)); /* Manual management of backend access. */ NBDKIT_EXTERN_DECL (nbdkit_backend *, nbdkit_context_get_backend, (nbdkit_context *context)); NBDKIT_EXTERN_DECL (nbdkit_next *, nbdkit_next_context_open, (nbdkit_backend *backend, int readonly, const char *exportname, int shared)); NBDKIT_EXTERN_DECL (void, nbdkit_next_context_close, (nbdkit_next *next)); NBDKIT_EXTERN_DECL (nbdkit_next *, nbdkit_context_set_next, (nbdkit_context *context, nbdkit_next *next)); /* Filter struct. */ struct nbdkit_filter { /* Do not set these fields directly; use NBDKIT_REGISTER_FILTER. * They exist so that we can diagnose filters compiled against one * version of the header with a runtime compiled against a different * version. As of API version 6, _version is also part of the * guaranteed ABI, so we no longer have to remember to bump API * versions regardless of other API/ABI changes later in the struct. */ int _api_version; const char *_version; /* Because there is no ABI guarantee, new fields may be added where * logically appropriate. */ const char *name; const char *longname; const char *description; void (*load) (void); void (*unload) (void); int (*config) (nbdkit_next_config *next, nbdkit_backend *nxdata, const char *key, const char *value); int (*config_complete) (nbdkit_next_config_complete *next, nbdkit_backend *nxdata); const char *config_help; int (*thread_model) (void); void (*dump_plugin) (void); int (*get_ready) (int thread_model); int (*after_fork) (nbdkit_backend *backend); void (*cleanup) (nbdkit_backend *backend); int (*preconnect) (nbdkit_next_preconnect *next, nbdkit_backend *nxdata, int readonly); int (*list_exports) (nbdkit_next_list_exports *next, nbdkit_backend *nxdata, int readonly, int is_tls, struct nbdkit_exports *exports); const char * (*default_export) (nbdkit_next_default_export *next, nbdkit_backend *nxdata, int readonly, int is_tls); void * (*open) (nbdkit_next_open *next, nbdkit_context *context, int readonly, const char *exportname, int is_tls); void (*close) (void *handle); int (*prepare) (nbdkit_next *next, void *handle, int readonly); int (*finalize) (nbdkit_next *next, void *handle); int64_t (*get_size) (nbdkit_next *next, void *handle); const char * (*export_description) (nbdkit_next *next, void *handle); int (*block_size) (nbdkit_next *next, void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum); int (*can_write) (nbdkit_next *next, void *handle); int (*can_flush) (nbdkit_next *next, void *handle); int (*is_rotational) (nbdkit_next *next, void *handle); int (*can_trim) (nbdkit_next *next, void *handle); int (*can_zero) (nbdkit_next *next, void *handle); int (*can_fast_zero) (nbdkit_next *next, void *handle); int (*can_extents) (nbdkit_next *next, void *handle); int (*can_fua) (nbdkit_next *next, void *handle); int (*can_multi_conn) (nbdkit_next *next, void *handle); int (*can_cache) (nbdkit_next *next, void *handle); int (*pread) (nbdkit_next *next, void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*pwrite) (nbdkit_next *next, void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*flush) (nbdkit_next *next, void *handle, uint32_t flags, int *err); int (*trim) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*zero) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); int (*extents) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents, int *err); int (*cache) (nbdkit_next *next, void *handle, uint32_t count, uint64_t offset, uint32_t flags, int *err); }; #define NBDKIT_REGISTER_FILTER(filter) \ NBDKIT_CXX_LANG_C \ NBDKIT_DLL_PUBLIC \ struct nbdkit_filter * \ filter_init (void) \ { \ (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ (filter)._version = NBDKIT_VERSION_STRING; \ return &(filter); \ } #ifdef __cplusplus } #endif #endif /* NBDKIT_FILTER_H */ nbdkit-1.42.2/include/nbdkit-version.h0000644000175000017500000000346314771245501013302 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_VERSION_H #define NBDKIT_VERSION_H #if !defined (NBDKIT_PLUGIN_H) && !defined (NBDKIT_FILTER_H) #error this header file should not be directly included #endif #define NBDKIT_VERSION_MAJOR 1 #define NBDKIT_VERSION_MINOR 42 #define NBDKIT_VERSION_MICRO 2 #define NBDKIT_VERSION_STRING "1.42.2" #endif /* NBDKIT_VERSION_H */ nbdkit-1.42.2/include/Makefile.in0000644000175000017500000005552414771245447012256 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = nbdkit-version.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/nbdkit-version.h.in \ $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll include_HEADERS = \ nbdkit-common.h \ nbdkit-plugin.h \ nbdkit-filter.h \ nbdkit-version.h \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): nbdkit-version.h: $(top_builddir)/config.status $(srcdir)/nbdkit-version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/include/nbdkit-version.h.in0000644000175000017500000000365714534316443013715 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_VERSION_H #define NBDKIT_VERSION_H #if !defined (NBDKIT_PLUGIN_H) && !defined (NBDKIT_FILTER_H) #error this header file should not be directly included #endif #define NBDKIT_VERSION_MAJOR @NBDKIT_VERSION_MAJOR@ #define NBDKIT_VERSION_MINOR @NBDKIT_VERSION_MINOR@ #define NBDKIT_VERSION_MICRO @NBDKIT_VERSION_MICRO@ #define NBDKIT_VERSION_STRING "@NBDKIT_VERSION_MAJOR@.@NBDKIT_VERSION_MINOR@.@NBDKIT_VERSION_MICRO@" #endif /* NBDKIT_VERSION_H */ nbdkit-1.42.2/common/0000755000175000017500000000000014771247241010115 5nbdkit-1.42.2/common/include/0000755000175000017500000000000014771247240011537 5nbdkit-1.42.2/common/include/Makefile.am0000644000175000017500000001006114534316443013510 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk # These headers contain only common code shared by the core server, # plugins and/or filters. They are not installed. EXTRA_DIST = \ ansi-colours.h \ array-size.h \ ascii-ctype.h \ ascii-string.h \ byte-swapping.h \ checked-overflow.h \ compiler-macros.h \ hexdigit.h \ human-size.h \ human-size-test-cases.h \ isaligned.h \ ispowerof2.h \ iszero.h \ minmax.h \ nextnonzero.h \ random.h \ rounding.h \ static-assert.h \ tvdiff.h \ unique-name.h \ unix-path-max.h \ $(NULL) # Unit tests. TESTS = \ test-array-size \ test-ascii-ctype \ test-ascii-string \ test-byte-swapping \ test-checked-overflow \ test-human-size \ test-isaligned \ test-ispowerof2 \ test-iszero \ test-minmax \ test-nextnonzero \ test-random \ test-tvdiff \ $(NULL) check_PROGRAMS = $(TESTS) test_array_size_SOURCES = test-array-size.c array-size.h test_array_size_CPPFLAGS = -I$(srcdir) test_array_size_CFLAGS = $(WARNINGS_CFLAGS) test_ascii_ctype_SOURCES = test-ascii-ctype.c ascii-ctype.h test_ascii_ctype_CPPFLAGS = -I$(srcdir) test_ascii_ctype_CFLAGS = $(WARNINGS_CFLAGS) test_ascii_string_SOURCES = test-ascii-string.c ascii-string.h test_ascii_string_CPPFLAGS = -I$(srcdir) test_ascii_string_CFLAGS = $(WARNINGS_CFLAGS) test_byte_swapping_SOURCES = test-byte-swapping.c byte-swapping.h test_byte_swapping_CPPFLAGS = -I$(srcdir) test_byte_swapping_CFLAGS = $(WARNINGS_CFLAGS) test_checked_overflow_SOURCES = test-checked-overflow.c checked-overflow.h test_checked_overflow_CPPFLAGS = -I$(srcdir) test_checked_overflow_CFLAGS = $(WARNINGS_CFLAGS) test_human_size_SOURCES = test-human-size.c human-size.h human-size-test-cases.h test_human_size_CPPFLAGS = -I$(srcdir) test_human_size_CFLAGS = $(WARNINGS_CFLAGS) test_isaligned_SOURCES = test-isaligned.c isaligned.h test_isaligned_CPPFLAGS = -I$(srcdir) test_isaligned_CFLAGS = $(WARNINGS_CFLAGS) test_ispowerof2_SOURCES = test-ispowerof2.c ispowerof2.h test_ispowerof2_CPPFLAGS = -I$(srcdir) test_ispowerof2_CFLAGS = $(WARNINGS_CFLAGS) test_iszero_SOURCES = test-iszero.c iszero.h test_iszero_CPPFLAGS = -I$(srcdir) test_iszero_CFLAGS = $(WARNINGS_CFLAGS) test_minmax_SOURCES = test-minmax.c minmax.h test_minmax_CPPFLAGS = -I$(srcdir) test_minmax_CFLAGS = $(WARNINGS_CFLAGS) test_nextnonzero_SOURCES = test-nextnonzero.c nextnonzero.h test_nextnonzero_CPPFLAGS = -I$(srcdir) test_nextnonzero_CFLAGS = $(WARNINGS_CFLAGS) test_random_SOURCES = test-random.c random.h test_random_CPPFLAGS = -I$(srcdir) test_random_CFLAGS = $(WARNINGS_CFLAGS) test_tvdiff_SOURCES = test-tvdiff.c tvdiff.h test_tvdiff_CPPFLAGS = -I$(srcdir) test_tvdiff_CFLAGS = $(WARNINGS_CFLAGS) nbdkit-1.42.2/common/include/Makefile.in0000644000175000017500000024662114771245446013545 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-array-size$(EXEEXT) test-ascii-ctype$(EXEEXT) \ test-ascii-string$(EXEEXT) test-byte-swapping$(EXEEXT) \ test-checked-overflow$(EXEEXT) test-human-size$(EXEEXT) \ test-isaligned$(EXEEXT) test-ispowerof2$(EXEEXT) \ test-iszero$(EXEEXT) test-minmax$(EXEEXT) \ test-nextnonzero$(EXEEXT) test-random$(EXEEXT) \ test-tvdiff$(EXEEXT) $(am__EXEEXT_1) check_PROGRAMS = $(am__EXEEXT_2) subdir = common/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = am__EXEEXT_2 = test-array-size$(EXEEXT) test-ascii-ctype$(EXEEXT) \ test-ascii-string$(EXEEXT) test-byte-swapping$(EXEEXT) \ test-checked-overflow$(EXEEXT) test-human-size$(EXEEXT) \ test-isaligned$(EXEEXT) test-ispowerof2$(EXEEXT) \ test-iszero$(EXEEXT) test-minmax$(EXEEXT) \ test-nextnonzero$(EXEEXT) test-random$(EXEEXT) \ test-tvdiff$(EXEEXT) $(am__EXEEXT_1) am_test_array_size_OBJECTS = \ test_array_size-test-array-size.$(OBJEXT) test_array_size_OBJECTS = $(am_test_array_size_OBJECTS) test_array_size_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_array_size_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_array_size_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_ascii_ctype_OBJECTS = \ test_ascii_ctype-test-ascii-ctype.$(OBJEXT) test_ascii_ctype_OBJECTS = $(am_test_ascii_ctype_OBJECTS) test_ascii_ctype_LDADD = $(LDADD) test_ascii_ctype_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_ascii_ctype_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_ascii_string_OBJECTS = \ test_ascii_string-test-ascii-string.$(OBJEXT) test_ascii_string_OBJECTS = $(am_test_ascii_string_OBJECTS) test_ascii_string_LDADD = $(LDADD) test_ascii_string_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_ascii_string_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_byte_swapping_OBJECTS = \ test_byte_swapping-test-byte-swapping.$(OBJEXT) test_byte_swapping_OBJECTS = $(am_test_byte_swapping_OBJECTS) test_byte_swapping_LDADD = $(LDADD) test_byte_swapping_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_byte_swapping_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_test_checked_overflow_OBJECTS = \ test_checked_overflow-test-checked-overflow.$(OBJEXT) test_checked_overflow_OBJECTS = $(am_test_checked_overflow_OBJECTS) test_checked_overflow_LDADD = $(LDADD) test_checked_overflow_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_checked_overflow_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_test_human_size_OBJECTS = \ test_human_size-test-human-size.$(OBJEXT) test_human_size_OBJECTS = $(am_test_human_size_OBJECTS) test_human_size_LDADD = $(LDADD) test_human_size_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_human_size_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_isaligned_OBJECTS = test_isaligned-test-isaligned.$(OBJEXT) test_isaligned_OBJECTS = $(am_test_isaligned_OBJECTS) test_isaligned_LDADD = $(LDADD) test_isaligned_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_isaligned_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_test_ispowerof2_OBJECTS = \ test_ispowerof2-test-ispowerof2.$(OBJEXT) test_ispowerof2_OBJECTS = $(am_test_ispowerof2_OBJECTS) test_ispowerof2_LDADD = $(LDADD) test_ispowerof2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_ispowerof2_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_iszero_OBJECTS = test_iszero-test-iszero.$(OBJEXT) test_iszero_OBJECTS = $(am_test_iszero_OBJECTS) test_iszero_LDADD = $(LDADD) test_iszero_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_iszero_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_minmax_OBJECTS = test_minmax-test-minmax.$(OBJEXT) test_minmax_OBJECTS = $(am_test_minmax_OBJECTS) test_minmax_LDADD = $(LDADD) test_minmax_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_minmax_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_nextnonzero_OBJECTS = \ test_nextnonzero-test-nextnonzero.$(OBJEXT) test_nextnonzero_OBJECTS = $(am_test_nextnonzero_OBJECTS) test_nextnonzero_LDADD = $(LDADD) test_nextnonzero_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_nextnonzero_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_test_random_OBJECTS = test_random-test-random.$(OBJEXT) test_random_OBJECTS = $(am_test_random_OBJECTS) test_random_LDADD = $(LDADD) test_random_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_random_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_tvdiff_OBJECTS = test_tvdiff-test-tvdiff.$(OBJEXT) test_tvdiff_OBJECTS = $(am_test_tvdiff_OBJECTS) test_tvdiff_LDADD = $(LDADD) test_tvdiff_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_tvdiff_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_array_size-test-array-size.Po \ ./$(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po \ ./$(DEPDIR)/test_ascii_string-test-ascii-string.Po \ ./$(DEPDIR)/test_byte_swapping-test-byte-swapping.Po \ ./$(DEPDIR)/test_checked_overflow-test-checked-overflow.Po \ ./$(DEPDIR)/test_human_size-test-human-size.Po \ ./$(DEPDIR)/test_isaligned-test-isaligned.Po \ ./$(DEPDIR)/test_ispowerof2-test-ispowerof2.Po \ ./$(DEPDIR)/test_iszero-test-iszero.Po \ ./$(DEPDIR)/test_minmax-test-minmax.Po \ ./$(DEPDIR)/test_nextnonzero-test-nextnonzero.Po \ ./$(DEPDIR)/test_random-test-random.Po \ ./$(DEPDIR)/test_tvdiff-test-tvdiff.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(test_array_size_SOURCES) $(test_ascii_ctype_SOURCES) \ $(test_ascii_string_SOURCES) $(test_byte_swapping_SOURCES) \ $(test_checked_overflow_SOURCES) $(test_human_size_SOURCES) \ $(test_isaligned_SOURCES) $(test_ispowerof2_SOURCES) \ $(test_iszero_SOURCES) $(test_minmax_SOURCES) \ $(test_nextnonzero_SOURCES) $(test_random_SOURCES) \ $(test_tvdiff_SOURCES) DIST_SOURCES = $(test_array_size_SOURCES) $(test_ascii_ctype_SOURCES) \ $(test_ascii_string_SOURCES) $(test_byte_swapping_SOURCES) \ $(test_checked_overflow_SOURCES) $(test_human_size_SOURCES) \ $(test_isaligned_SOURCES) $(test_ispowerof2_SOURCES) \ $(test_iszero_SOURCES) $(test_minmax_SOURCES) \ $(test_nextnonzero_SOURCES) $(test_random_SOURCES) \ $(test_tvdiff_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll # These headers contain only common code shared by the core server, # plugins and/or filters. They are not installed. EXTRA_DIST = \ ansi-colours.h \ array-size.h \ ascii-ctype.h \ ascii-string.h \ byte-swapping.h \ checked-overflow.h \ compiler-macros.h \ hexdigit.h \ human-size.h \ human-size-test-cases.h \ isaligned.h \ ispowerof2.h \ iszero.h \ minmax.h \ nextnonzero.h \ random.h \ rounding.h \ static-assert.h \ tvdiff.h \ unique-name.h \ unix-path-max.h \ $(NULL) test_array_size_SOURCES = test-array-size.c array-size.h test_array_size_CPPFLAGS = -I$(srcdir) test_array_size_CFLAGS = $(WARNINGS_CFLAGS) test_ascii_ctype_SOURCES = test-ascii-ctype.c ascii-ctype.h test_ascii_ctype_CPPFLAGS = -I$(srcdir) test_ascii_ctype_CFLAGS = $(WARNINGS_CFLAGS) test_ascii_string_SOURCES = test-ascii-string.c ascii-string.h test_ascii_string_CPPFLAGS = -I$(srcdir) test_ascii_string_CFLAGS = $(WARNINGS_CFLAGS) test_byte_swapping_SOURCES = test-byte-swapping.c byte-swapping.h test_byte_swapping_CPPFLAGS = -I$(srcdir) test_byte_swapping_CFLAGS = $(WARNINGS_CFLAGS) test_checked_overflow_SOURCES = test-checked-overflow.c checked-overflow.h test_checked_overflow_CPPFLAGS = -I$(srcdir) test_checked_overflow_CFLAGS = $(WARNINGS_CFLAGS) test_human_size_SOURCES = test-human-size.c human-size.h human-size-test-cases.h test_human_size_CPPFLAGS = -I$(srcdir) test_human_size_CFLAGS = $(WARNINGS_CFLAGS) test_isaligned_SOURCES = test-isaligned.c isaligned.h test_isaligned_CPPFLAGS = -I$(srcdir) test_isaligned_CFLAGS = $(WARNINGS_CFLAGS) test_ispowerof2_SOURCES = test-ispowerof2.c ispowerof2.h test_ispowerof2_CPPFLAGS = -I$(srcdir) test_ispowerof2_CFLAGS = $(WARNINGS_CFLAGS) test_iszero_SOURCES = test-iszero.c iszero.h test_iszero_CPPFLAGS = -I$(srcdir) test_iszero_CFLAGS = $(WARNINGS_CFLAGS) test_minmax_SOURCES = test-minmax.c minmax.h test_minmax_CPPFLAGS = -I$(srcdir) test_minmax_CFLAGS = $(WARNINGS_CFLAGS) test_nextnonzero_SOURCES = test-nextnonzero.c nextnonzero.h test_nextnonzero_CPPFLAGS = -I$(srcdir) test_nextnonzero_CFLAGS = $(WARNINGS_CFLAGS) test_random_SOURCES = test-random.c random.h test_random_CPPFLAGS = -I$(srcdir) test_random_CFLAGS = $(WARNINGS_CFLAGS) test_tvdiff_SOURCES = test-tvdiff.c tvdiff.h test_tvdiff_CPPFLAGS = -I$(srcdir) test_tvdiff_CFLAGS = $(WARNINGS_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-array-size$(EXEEXT): $(test_array_size_OBJECTS) $(test_array_size_DEPENDENCIES) $(EXTRA_test_array_size_DEPENDENCIES) @rm -f test-array-size$(EXEEXT) $(AM_V_CCLD)$(test_array_size_LINK) $(test_array_size_OBJECTS) $(test_array_size_LDADD) $(LIBS) test-ascii-ctype$(EXEEXT): $(test_ascii_ctype_OBJECTS) $(test_ascii_ctype_DEPENDENCIES) $(EXTRA_test_ascii_ctype_DEPENDENCIES) @rm -f test-ascii-ctype$(EXEEXT) $(AM_V_CCLD)$(test_ascii_ctype_LINK) $(test_ascii_ctype_OBJECTS) $(test_ascii_ctype_LDADD) $(LIBS) test-ascii-string$(EXEEXT): $(test_ascii_string_OBJECTS) $(test_ascii_string_DEPENDENCIES) $(EXTRA_test_ascii_string_DEPENDENCIES) @rm -f test-ascii-string$(EXEEXT) $(AM_V_CCLD)$(test_ascii_string_LINK) $(test_ascii_string_OBJECTS) $(test_ascii_string_LDADD) $(LIBS) test-byte-swapping$(EXEEXT): $(test_byte_swapping_OBJECTS) $(test_byte_swapping_DEPENDENCIES) $(EXTRA_test_byte_swapping_DEPENDENCIES) @rm -f test-byte-swapping$(EXEEXT) $(AM_V_CCLD)$(test_byte_swapping_LINK) $(test_byte_swapping_OBJECTS) $(test_byte_swapping_LDADD) $(LIBS) test-checked-overflow$(EXEEXT): $(test_checked_overflow_OBJECTS) $(test_checked_overflow_DEPENDENCIES) $(EXTRA_test_checked_overflow_DEPENDENCIES) @rm -f test-checked-overflow$(EXEEXT) $(AM_V_CCLD)$(test_checked_overflow_LINK) $(test_checked_overflow_OBJECTS) $(test_checked_overflow_LDADD) $(LIBS) test-human-size$(EXEEXT): $(test_human_size_OBJECTS) $(test_human_size_DEPENDENCIES) $(EXTRA_test_human_size_DEPENDENCIES) @rm -f test-human-size$(EXEEXT) $(AM_V_CCLD)$(test_human_size_LINK) $(test_human_size_OBJECTS) $(test_human_size_LDADD) $(LIBS) test-isaligned$(EXEEXT): $(test_isaligned_OBJECTS) $(test_isaligned_DEPENDENCIES) $(EXTRA_test_isaligned_DEPENDENCIES) @rm -f test-isaligned$(EXEEXT) $(AM_V_CCLD)$(test_isaligned_LINK) $(test_isaligned_OBJECTS) $(test_isaligned_LDADD) $(LIBS) test-ispowerof2$(EXEEXT): $(test_ispowerof2_OBJECTS) $(test_ispowerof2_DEPENDENCIES) $(EXTRA_test_ispowerof2_DEPENDENCIES) @rm -f test-ispowerof2$(EXEEXT) $(AM_V_CCLD)$(test_ispowerof2_LINK) $(test_ispowerof2_OBJECTS) $(test_ispowerof2_LDADD) $(LIBS) test-iszero$(EXEEXT): $(test_iszero_OBJECTS) $(test_iszero_DEPENDENCIES) $(EXTRA_test_iszero_DEPENDENCIES) @rm -f test-iszero$(EXEEXT) $(AM_V_CCLD)$(test_iszero_LINK) $(test_iszero_OBJECTS) $(test_iszero_LDADD) $(LIBS) test-minmax$(EXEEXT): $(test_minmax_OBJECTS) $(test_minmax_DEPENDENCIES) $(EXTRA_test_minmax_DEPENDENCIES) @rm -f test-minmax$(EXEEXT) $(AM_V_CCLD)$(test_minmax_LINK) $(test_minmax_OBJECTS) $(test_minmax_LDADD) $(LIBS) test-nextnonzero$(EXEEXT): $(test_nextnonzero_OBJECTS) $(test_nextnonzero_DEPENDENCIES) $(EXTRA_test_nextnonzero_DEPENDENCIES) @rm -f test-nextnonzero$(EXEEXT) $(AM_V_CCLD)$(test_nextnonzero_LINK) $(test_nextnonzero_OBJECTS) $(test_nextnonzero_LDADD) $(LIBS) test-random$(EXEEXT): $(test_random_OBJECTS) $(test_random_DEPENDENCIES) $(EXTRA_test_random_DEPENDENCIES) @rm -f test-random$(EXEEXT) $(AM_V_CCLD)$(test_random_LINK) $(test_random_OBJECTS) $(test_random_LDADD) $(LIBS) test-tvdiff$(EXEEXT): $(test_tvdiff_OBJECTS) $(test_tvdiff_DEPENDENCIES) $(EXTRA_test_tvdiff_DEPENDENCIES) @rm -f test-tvdiff$(EXEEXT) $(AM_V_CCLD)$(test_tvdiff_LINK) $(test_tvdiff_OBJECTS) $(test_tvdiff_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_array_size-test-array-size.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ascii_string-test-ascii-string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_byte_swapping-test-byte-swapping.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_checked_overflow-test-checked-overflow.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_human_size-test-human-size.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_isaligned-test-isaligned.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ispowerof2-test-ispowerof2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_iszero-test-iszero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_minmax-test-minmax.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nextnonzero-test-nextnonzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_random-test-random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tvdiff-test-tvdiff.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_array_size-test-array-size.o: test-array-size.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_array_size_CPPFLAGS) $(CPPFLAGS) $(test_array_size_CFLAGS) $(CFLAGS) -MT test_array_size-test-array-size.o -MD -MP -MF $(DEPDIR)/test_array_size-test-array-size.Tpo -c -o test_array_size-test-array-size.o `test -f 'test-array-size.c' || echo '$(srcdir)/'`test-array-size.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_array_size-test-array-size.Tpo $(DEPDIR)/test_array_size-test-array-size.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-array-size.c' object='test_array_size-test-array-size.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_array_size_CPPFLAGS) $(CPPFLAGS) $(test_array_size_CFLAGS) $(CFLAGS) -c -o test_array_size-test-array-size.o `test -f 'test-array-size.c' || echo '$(srcdir)/'`test-array-size.c test_array_size-test-array-size.obj: test-array-size.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_array_size_CPPFLAGS) $(CPPFLAGS) $(test_array_size_CFLAGS) $(CFLAGS) -MT test_array_size-test-array-size.obj -MD -MP -MF $(DEPDIR)/test_array_size-test-array-size.Tpo -c -o test_array_size-test-array-size.obj `if test -f 'test-array-size.c'; then $(CYGPATH_W) 'test-array-size.c'; else $(CYGPATH_W) '$(srcdir)/test-array-size.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_array_size-test-array-size.Tpo $(DEPDIR)/test_array_size-test-array-size.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-array-size.c' object='test_array_size-test-array-size.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_array_size_CPPFLAGS) $(CPPFLAGS) $(test_array_size_CFLAGS) $(CFLAGS) -c -o test_array_size-test-array-size.obj `if test -f 'test-array-size.c'; then $(CYGPATH_W) 'test-array-size.c'; else $(CYGPATH_W) '$(srcdir)/test-array-size.c'; fi` test_ascii_ctype-test-ascii-ctype.o: test-ascii-ctype.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_ctype_CPPFLAGS) $(CPPFLAGS) $(test_ascii_ctype_CFLAGS) $(CFLAGS) -MT test_ascii_ctype-test-ascii-ctype.o -MD -MP -MF $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Tpo -c -o test_ascii_ctype-test-ascii-ctype.o `test -f 'test-ascii-ctype.c' || echo '$(srcdir)/'`test-ascii-ctype.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Tpo $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ascii-ctype.c' object='test_ascii_ctype-test-ascii-ctype.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_ctype_CPPFLAGS) $(CPPFLAGS) $(test_ascii_ctype_CFLAGS) $(CFLAGS) -c -o test_ascii_ctype-test-ascii-ctype.o `test -f 'test-ascii-ctype.c' || echo '$(srcdir)/'`test-ascii-ctype.c test_ascii_ctype-test-ascii-ctype.obj: test-ascii-ctype.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_ctype_CPPFLAGS) $(CPPFLAGS) $(test_ascii_ctype_CFLAGS) $(CFLAGS) -MT test_ascii_ctype-test-ascii-ctype.obj -MD -MP -MF $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Tpo -c -o test_ascii_ctype-test-ascii-ctype.obj `if test -f 'test-ascii-ctype.c'; then $(CYGPATH_W) 'test-ascii-ctype.c'; else $(CYGPATH_W) '$(srcdir)/test-ascii-ctype.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Tpo $(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ascii-ctype.c' object='test_ascii_ctype-test-ascii-ctype.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_ctype_CPPFLAGS) $(CPPFLAGS) $(test_ascii_ctype_CFLAGS) $(CFLAGS) -c -o test_ascii_ctype-test-ascii-ctype.obj `if test -f 'test-ascii-ctype.c'; then $(CYGPATH_W) 'test-ascii-ctype.c'; else $(CYGPATH_W) '$(srcdir)/test-ascii-ctype.c'; fi` test_ascii_string-test-ascii-string.o: test-ascii-string.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_string_CPPFLAGS) $(CPPFLAGS) $(test_ascii_string_CFLAGS) $(CFLAGS) -MT test_ascii_string-test-ascii-string.o -MD -MP -MF $(DEPDIR)/test_ascii_string-test-ascii-string.Tpo -c -o test_ascii_string-test-ascii-string.o `test -f 'test-ascii-string.c' || echo '$(srcdir)/'`test-ascii-string.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ascii_string-test-ascii-string.Tpo $(DEPDIR)/test_ascii_string-test-ascii-string.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ascii-string.c' object='test_ascii_string-test-ascii-string.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_string_CPPFLAGS) $(CPPFLAGS) $(test_ascii_string_CFLAGS) $(CFLAGS) -c -o test_ascii_string-test-ascii-string.o `test -f 'test-ascii-string.c' || echo '$(srcdir)/'`test-ascii-string.c test_ascii_string-test-ascii-string.obj: test-ascii-string.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_string_CPPFLAGS) $(CPPFLAGS) $(test_ascii_string_CFLAGS) $(CFLAGS) -MT test_ascii_string-test-ascii-string.obj -MD -MP -MF $(DEPDIR)/test_ascii_string-test-ascii-string.Tpo -c -o test_ascii_string-test-ascii-string.obj `if test -f 'test-ascii-string.c'; then $(CYGPATH_W) 'test-ascii-string.c'; else $(CYGPATH_W) '$(srcdir)/test-ascii-string.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ascii_string-test-ascii-string.Tpo $(DEPDIR)/test_ascii_string-test-ascii-string.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ascii-string.c' object='test_ascii_string-test-ascii-string.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ascii_string_CPPFLAGS) $(CPPFLAGS) $(test_ascii_string_CFLAGS) $(CFLAGS) -c -o test_ascii_string-test-ascii-string.obj `if test -f 'test-ascii-string.c'; then $(CYGPATH_W) 'test-ascii-string.c'; else $(CYGPATH_W) '$(srcdir)/test-ascii-string.c'; fi` test_byte_swapping-test-byte-swapping.o: test-byte-swapping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_byte_swapping_CPPFLAGS) $(CPPFLAGS) $(test_byte_swapping_CFLAGS) $(CFLAGS) -MT test_byte_swapping-test-byte-swapping.o -MD -MP -MF $(DEPDIR)/test_byte_swapping-test-byte-swapping.Tpo -c -o test_byte_swapping-test-byte-swapping.o `test -f 'test-byte-swapping.c' || echo '$(srcdir)/'`test-byte-swapping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_byte_swapping-test-byte-swapping.Tpo $(DEPDIR)/test_byte_swapping-test-byte-swapping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-byte-swapping.c' object='test_byte_swapping-test-byte-swapping.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_byte_swapping_CPPFLAGS) $(CPPFLAGS) $(test_byte_swapping_CFLAGS) $(CFLAGS) -c -o test_byte_swapping-test-byte-swapping.o `test -f 'test-byte-swapping.c' || echo '$(srcdir)/'`test-byte-swapping.c test_byte_swapping-test-byte-swapping.obj: test-byte-swapping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_byte_swapping_CPPFLAGS) $(CPPFLAGS) $(test_byte_swapping_CFLAGS) $(CFLAGS) -MT test_byte_swapping-test-byte-swapping.obj -MD -MP -MF $(DEPDIR)/test_byte_swapping-test-byte-swapping.Tpo -c -o test_byte_swapping-test-byte-swapping.obj `if test -f 'test-byte-swapping.c'; then $(CYGPATH_W) 'test-byte-swapping.c'; else $(CYGPATH_W) '$(srcdir)/test-byte-swapping.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_byte_swapping-test-byte-swapping.Tpo $(DEPDIR)/test_byte_swapping-test-byte-swapping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-byte-swapping.c' object='test_byte_swapping-test-byte-swapping.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_byte_swapping_CPPFLAGS) $(CPPFLAGS) $(test_byte_swapping_CFLAGS) $(CFLAGS) -c -o test_byte_swapping-test-byte-swapping.obj `if test -f 'test-byte-swapping.c'; then $(CYGPATH_W) 'test-byte-swapping.c'; else $(CYGPATH_W) '$(srcdir)/test-byte-swapping.c'; fi` test_checked_overflow-test-checked-overflow.o: test-checked-overflow.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_checked_overflow_CPPFLAGS) $(CPPFLAGS) $(test_checked_overflow_CFLAGS) $(CFLAGS) -MT test_checked_overflow-test-checked-overflow.o -MD -MP -MF $(DEPDIR)/test_checked_overflow-test-checked-overflow.Tpo -c -o test_checked_overflow-test-checked-overflow.o `test -f 'test-checked-overflow.c' || echo '$(srcdir)/'`test-checked-overflow.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_checked_overflow-test-checked-overflow.Tpo $(DEPDIR)/test_checked_overflow-test-checked-overflow.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-checked-overflow.c' object='test_checked_overflow-test-checked-overflow.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_checked_overflow_CPPFLAGS) $(CPPFLAGS) $(test_checked_overflow_CFLAGS) $(CFLAGS) -c -o test_checked_overflow-test-checked-overflow.o `test -f 'test-checked-overflow.c' || echo '$(srcdir)/'`test-checked-overflow.c test_checked_overflow-test-checked-overflow.obj: test-checked-overflow.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_checked_overflow_CPPFLAGS) $(CPPFLAGS) $(test_checked_overflow_CFLAGS) $(CFLAGS) -MT test_checked_overflow-test-checked-overflow.obj -MD -MP -MF $(DEPDIR)/test_checked_overflow-test-checked-overflow.Tpo -c -o test_checked_overflow-test-checked-overflow.obj `if test -f 'test-checked-overflow.c'; then $(CYGPATH_W) 'test-checked-overflow.c'; else $(CYGPATH_W) '$(srcdir)/test-checked-overflow.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_checked_overflow-test-checked-overflow.Tpo $(DEPDIR)/test_checked_overflow-test-checked-overflow.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-checked-overflow.c' object='test_checked_overflow-test-checked-overflow.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_checked_overflow_CPPFLAGS) $(CPPFLAGS) $(test_checked_overflow_CFLAGS) $(CFLAGS) -c -o test_checked_overflow-test-checked-overflow.obj `if test -f 'test-checked-overflow.c'; then $(CYGPATH_W) 'test-checked-overflow.c'; else $(CYGPATH_W) '$(srcdir)/test-checked-overflow.c'; fi` test_human_size-test-human-size.o: test-human-size.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_human_size_CPPFLAGS) $(CPPFLAGS) $(test_human_size_CFLAGS) $(CFLAGS) -MT test_human_size-test-human-size.o -MD -MP -MF $(DEPDIR)/test_human_size-test-human-size.Tpo -c -o test_human_size-test-human-size.o `test -f 'test-human-size.c' || echo '$(srcdir)/'`test-human-size.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_human_size-test-human-size.Tpo $(DEPDIR)/test_human_size-test-human-size.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-human-size.c' object='test_human_size-test-human-size.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_human_size_CPPFLAGS) $(CPPFLAGS) $(test_human_size_CFLAGS) $(CFLAGS) -c -o test_human_size-test-human-size.o `test -f 'test-human-size.c' || echo '$(srcdir)/'`test-human-size.c test_human_size-test-human-size.obj: test-human-size.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_human_size_CPPFLAGS) $(CPPFLAGS) $(test_human_size_CFLAGS) $(CFLAGS) -MT test_human_size-test-human-size.obj -MD -MP -MF $(DEPDIR)/test_human_size-test-human-size.Tpo -c -o test_human_size-test-human-size.obj `if test -f 'test-human-size.c'; then $(CYGPATH_W) 'test-human-size.c'; else $(CYGPATH_W) '$(srcdir)/test-human-size.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_human_size-test-human-size.Tpo $(DEPDIR)/test_human_size-test-human-size.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-human-size.c' object='test_human_size-test-human-size.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_human_size_CPPFLAGS) $(CPPFLAGS) $(test_human_size_CFLAGS) $(CFLAGS) -c -o test_human_size-test-human-size.obj `if test -f 'test-human-size.c'; then $(CYGPATH_W) 'test-human-size.c'; else $(CYGPATH_W) '$(srcdir)/test-human-size.c'; fi` test_isaligned-test-isaligned.o: test-isaligned.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_isaligned_CPPFLAGS) $(CPPFLAGS) $(test_isaligned_CFLAGS) $(CFLAGS) -MT test_isaligned-test-isaligned.o -MD -MP -MF $(DEPDIR)/test_isaligned-test-isaligned.Tpo -c -o test_isaligned-test-isaligned.o `test -f 'test-isaligned.c' || echo '$(srcdir)/'`test-isaligned.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_isaligned-test-isaligned.Tpo $(DEPDIR)/test_isaligned-test-isaligned.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-isaligned.c' object='test_isaligned-test-isaligned.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_isaligned_CPPFLAGS) $(CPPFLAGS) $(test_isaligned_CFLAGS) $(CFLAGS) -c -o test_isaligned-test-isaligned.o `test -f 'test-isaligned.c' || echo '$(srcdir)/'`test-isaligned.c test_isaligned-test-isaligned.obj: test-isaligned.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_isaligned_CPPFLAGS) $(CPPFLAGS) $(test_isaligned_CFLAGS) $(CFLAGS) -MT test_isaligned-test-isaligned.obj -MD -MP -MF $(DEPDIR)/test_isaligned-test-isaligned.Tpo -c -o test_isaligned-test-isaligned.obj `if test -f 'test-isaligned.c'; then $(CYGPATH_W) 'test-isaligned.c'; else $(CYGPATH_W) '$(srcdir)/test-isaligned.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_isaligned-test-isaligned.Tpo $(DEPDIR)/test_isaligned-test-isaligned.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-isaligned.c' object='test_isaligned-test-isaligned.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_isaligned_CPPFLAGS) $(CPPFLAGS) $(test_isaligned_CFLAGS) $(CFLAGS) -c -o test_isaligned-test-isaligned.obj `if test -f 'test-isaligned.c'; then $(CYGPATH_W) 'test-isaligned.c'; else $(CYGPATH_W) '$(srcdir)/test-isaligned.c'; fi` test_ispowerof2-test-ispowerof2.o: test-ispowerof2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ispowerof2_CPPFLAGS) $(CPPFLAGS) $(test_ispowerof2_CFLAGS) $(CFLAGS) -MT test_ispowerof2-test-ispowerof2.o -MD -MP -MF $(DEPDIR)/test_ispowerof2-test-ispowerof2.Tpo -c -o test_ispowerof2-test-ispowerof2.o `test -f 'test-ispowerof2.c' || echo '$(srcdir)/'`test-ispowerof2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ispowerof2-test-ispowerof2.Tpo $(DEPDIR)/test_ispowerof2-test-ispowerof2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ispowerof2.c' object='test_ispowerof2-test-ispowerof2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ispowerof2_CPPFLAGS) $(CPPFLAGS) $(test_ispowerof2_CFLAGS) $(CFLAGS) -c -o test_ispowerof2-test-ispowerof2.o `test -f 'test-ispowerof2.c' || echo '$(srcdir)/'`test-ispowerof2.c test_ispowerof2-test-ispowerof2.obj: test-ispowerof2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ispowerof2_CPPFLAGS) $(CPPFLAGS) $(test_ispowerof2_CFLAGS) $(CFLAGS) -MT test_ispowerof2-test-ispowerof2.obj -MD -MP -MF $(DEPDIR)/test_ispowerof2-test-ispowerof2.Tpo -c -o test_ispowerof2-test-ispowerof2.obj `if test -f 'test-ispowerof2.c'; then $(CYGPATH_W) 'test-ispowerof2.c'; else $(CYGPATH_W) '$(srcdir)/test-ispowerof2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ispowerof2-test-ispowerof2.Tpo $(DEPDIR)/test_ispowerof2-test-ispowerof2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-ispowerof2.c' object='test_ispowerof2-test-ispowerof2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ispowerof2_CPPFLAGS) $(CPPFLAGS) $(test_ispowerof2_CFLAGS) $(CFLAGS) -c -o test_ispowerof2-test-ispowerof2.obj `if test -f 'test-ispowerof2.c'; then $(CYGPATH_W) 'test-ispowerof2.c'; else $(CYGPATH_W) '$(srcdir)/test-ispowerof2.c'; fi` test_iszero-test-iszero.o: test-iszero.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_iszero_CPPFLAGS) $(CPPFLAGS) $(test_iszero_CFLAGS) $(CFLAGS) -MT test_iszero-test-iszero.o -MD -MP -MF $(DEPDIR)/test_iszero-test-iszero.Tpo -c -o test_iszero-test-iszero.o `test -f 'test-iszero.c' || echo '$(srcdir)/'`test-iszero.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_iszero-test-iszero.Tpo $(DEPDIR)/test_iszero-test-iszero.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-iszero.c' object='test_iszero-test-iszero.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_iszero_CPPFLAGS) $(CPPFLAGS) $(test_iszero_CFLAGS) $(CFLAGS) -c -o test_iszero-test-iszero.o `test -f 'test-iszero.c' || echo '$(srcdir)/'`test-iszero.c test_iszero-test-iszero.obj: test-iszero.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_iszero_CPPFLAGS) $(CPPFLAGS) $(test_iszero_CFLAGS) $(CFLAGS) -MT test_iszero-test-iszero.obj -MD -MP -MF $(DEPDIR)/test_iszero-test-iszero.Tpo -c -o test_iszero-test-iszero.obj `if test -f 'test-iszero.c'; then $(CYGPATH_W) 'test-iszero.c'; else $(CYGPATH_W) '$(srcdir)/test-iszero.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_iszero-test-iszero.Tpo $(DEPDIR)/test_iszero-test-iszero.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-iszero.c' object='test_iszero-test-iszero.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_iszero_CPPFLAGS) $(CPPFLAGS) $(test_iszero_CFLAGS) $(CFLAGS) -c -o test_iszero-test-iszero.obj `if test -f 'test-iszero.c'; then $(CYGPATH_W) 'test-iszero.c'; else $(CYGPATH_W) '$(srcdir)/test-iszero.c'; fi` test_minmax-test-minmax.o: test-minmax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_minmax_CPPFLAGS) $(CPPFLAGS) $(test_minmax_CFLAGS) $(CFLAGS) -MT test_minmax-test-minmax.o -MD -MP -MF $(DEPDIR)/test_minmax-test-minmax.Tpo -c -o test_minmax-test-minmax.o `test -f 'test-minmax.c' || echo '$(srcdir)/'`test-minmax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_minmax-test-minmax.Tpo $(DEPDIR)/test_minmax-test-minmax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-minmax.c' object='test_minmax-test-minmax.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_minmax_CPPFLAGS) $(CPPFLAGS) $(test_minmax_CFLAGS) $(CFLAGS) -c -o test_minmax-test-minmax.o `test -f 'test-minmax.c' || echo '$(srcdir)/'`test-minmax.c test_minmax-test-minmax.obj: test-minmax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_minmax_CPPFLAGS) $(CPPFLAGS) $(test_minmax_CFLAGS) $(CFLAGS) -MT test_minmax-test-minmax.obj -MD -MP -MF $(DEPDIR)/test_minmax-test-minmax.Tpo -c -o test_minmax-test-minmax.obj `if test -f 'test-minmax.c'; then $(CYGPATH_W) 'test-minmax.c'; else $(CYGPATH_W) '$(srcdir)/test-minmax.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_minmax-test-minmax.Tpo $(DEPDIR)/test_minmax-test-minmax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-minmax.c' object='test_minmax-test-minmax.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_minmax_CPPFLAGS) $(CPPFLAGS) $(test_minmax_CFLAGS) $(CFLAGS) -c -o test_minmax-test-minmax.obj `if test -f 'test-minmax.c'; then $(CYGPATH_W) 'test-minmax.c'; else $(CYGPATH_W) '$(srcdir)/test-minmax.c'; fi` test_nextnonzero-test-nextnonzero.o: test-nextnonzero.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nextnonzero_CPPFLAGS) $(CPPFLAGS) $(test_nextnonzero_CFLAGS) $(CFLAGS) -MT test_nextnonzero-test-nextnonzero.o -MD -MP -MF $(DEPDIR)/test_nextnonzero-test-nextnonzero.Tpo -c -o test_nextnonzero-test-nextnonzero.o `test -f 'test-nextnonzero.c' || echo '$(srcdir)/'`test-nextnonzero.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nextnonzero-test-nextnonzero.Tpo $(DEPDIR)/test_nextnonzero-test-nextnonzero.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-nextnonzero.c' object='test_nextnonzero-test-nextnonzero.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nextnonzero_CPPFLAGS) $(CPPFLAGS) $(test_nextnonzero_CFLAGS) $(CFLAGS) -c -o test_nextnonzero-test-nextnonzero.o `test -f 'test-nextnonzero.c' || echo '$(srcdir)/'`test-nextnonzero.c test_nextnonzero-test-nextnonzero.obj: test-nextnonzero.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nextnonzero_CPPFLAGS) $(CPPFLAGS) $(test_nextnonzero_CFLAGS) $(CFLAGS) -MT test_nextnonzero-test-nextnonzero.obj -MD -MP -MF $(DEPDIR)/test_nextnonzero-test-nextnonzero.Tpo -c -o test_nextnonzero-test-nextnonzero.obj `if test -f 'test-nextnonzero.c'; then $(CYGPATH_W) 'test-nextnonzero.c'; else $(CYGPATH_W) '$(srcdir)/test-nextnonzero.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nextnonzero-test-nextnonzero.Tpo $(DEPDIR)/test_nextnonzero-test-nextnonzero.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-nextnonzero.c' object='test_nextnonzero-test-nextnonzero.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nextnonzero_CPPFLAGS) $(CPPFLAGS) $(test_nextnonzero_CFLAGS) $(CFLAGS) -c -o test_nextnonzero-test-nextnonzero.obj `if test -f 'test-nextnonzero.c'; then $(CYGPATH_W) 'test-nextnonzero.c'; else $(CYGPATH_W) '$(srcdir)/test-nextnonzero.c'; fi` test_random-test-random.o: test-random.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_random_CPPFLAGS) $(CPPFLAGS) $(test_random_CFLAGS) $(CFLAGS) -MT test_random-test-random.o -MD -MP -MF $(DEPDIR)/test_random-test-random.Tpo -c -o test_random-test-random.o `test -f 'test-random.c' || echo '$(srcdir)/'`test-random.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_random-test-random.Tpo $(DEPDIR)/test_random-test-random.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-random.c' object='test_random-test-random.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_random_CPPFLAGS) $(CPPFLAGS) $(test_random_CFLAGS) $(CFLAGS) -c -o test_random-test-random.o `test -f 'test-random.c' || echo '$(srcdir)/'`test-random.c test_random-test-random.obj: test-random.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_random_CPPFLAGS) $(CPPFLAGS) $(test_random_CFLAGS) $(CFLAGS) -MT test_random-test-random.obj -MD -MP -MF $(DEPDIR)/test_random-test-random.Tpo -c -o test_random-test-random.obj `if test -f 'test-random.c'; then $(CYGPATH_W) 'test-random.c'; else $(CYGPATH_W) '$(srcdir)/test-random.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_random-test-random.Tpo $(DEPDIR)/test_random-test-random.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-random.c' object='test_random-test-random.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_random_CPPFLAGS) $(CPPFLAGS) $(test_random_CFLAGS) $(CFLAGS) -c -o test_random-test-random.obj `if test -f 'test-random.c'; then $(CYGPATH_W) 'test-random.c'; else $(CYGPATH_W) '$(srcdir)/test-random.c'; fi` test_tvdiff-test-tvdiff.o: test-tvdiff.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tvdiff_CPPFLAGS) $(CPPFLAGS) $(test_tvdiff_CFLAGS) $(CFLAGS) -MT test_tvdiff-test-tvdiff.o -MD -MP -MF $(DEPDIR)/test_tvdiff-test-tvdiff.Tpo -c -o test_tvdiff-test-tvdiff.o `test -f 'test-tvdiff.c' || echo '$(srcdir)/'`test-tvdiff.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvdiff-test-tvdiff.Tpo $(DEPDIR)/test_tvdiff-test-tvdiff.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-tvdiff.c' object='test_tvdiff-test-tvdiff.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tvdiff_CPPFLAGS) $(CPPFLAGS) $(test_tvdiff_CFLAGS) $(CFLAGS) -c -o test_tvdiff-test-tvdiff.o `test -f 'test-tvdiff.c' || echo '$(srcdir)/'`test-tvdiff.c test_tvdiff-test-tvdiff.obj: test-tvdiff.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tvdiff_CPPFLAGS) $(CPPFLAGS) $(test_tvdiff_CFLAGS) $(CFLAGS) -MT test_tvdiff-test-tvdiff.obj -MD -MP -MF $(DEPDIR)/test_tvdiff-test-tvdiff.Tpo -c -o test_tvdiff-test-tvdiff.obj `if test -f 'test-tvdiff.c'; then $(CYGPATH_W) 'test-tvdiff.c'; else $(CYGPATH_W) '$(srcdir)/test-tvdiff.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvdiff-test-tvdiff.Tpo $(DEPDIR)/test_tvdiff-test-tvdiff.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-tvdiff.c' object='test_tvdiff-test-tvdiff.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_tvdiff_CPPFLAGS) $(CPPFLAGS) $(test_tvdiff_CFLAGS) $(CFLAGS) -c -o test_tvdiff-test-tvdiff.obj `if test -f 'test-tvdiff.c'; then $(CYGPATH_W) 'test-tvdiff.c'; else $(CYGPATH_W) '$(srcdir)/test-tvdiff.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-array-size.log: test-array-size$(EXEEXT) @p='test-array-size$(EXEEXT)'; \ b='test-array-size'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-ascii-ctype.log: test-ascii-ctype$(EXEEXT) @p='test-ascii-ctype$(EXEEXT)'; \ b='test-ascii-ctype'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-ascii-string.log: test-ascii-string$(EXEEXT) @p='test-ascii-string$(EXEEXT)'; \ b='test-ascii-string'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-byte-swapping.log: test-byte-swapping$(EXEEXT) @p='test-byte-swapping$(EXEEXT)'; \ b='test-byte-swapping'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-checked-overflow.log: test-checked-overflow$(EXEEXT) @p='test-checked-overflow$(EXEEXT)'; \ b='test-checked-overflow'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-human-size.log: test-human-size$(EXEEXT) @p='test-human-size$(EXEEXT)'; \ b='test-human-size'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-isaligned.log: test-isaligned$(EXEEXT) @p='test-isaligned$(EXEEXT)'; \ b='test-isaligned'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-ispowerof2.log: test-ispowerof2$(EXEEXT) @p='test-ispowerof2$(EXEEXT)'; \ b='test-ispowerof2'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-iszero.log: test-iszero$(EXEEXT) @p='test-iszero$(EXEEXT)'; \ b='test-iszero'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-minmax.log: test-minmax$(EXEEXT) @p='test-minmax$(EXEEXT)'; \ b='test-minmax'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-nextnonzero.log: test-nextnonzero$(EXEEXT) @p='test-nextnonzero$(EXEEXT)'; \ b='test-nextnonzero'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-random.log: test-random$(EXEEXT) @p='test-random$(EXEEXT)'; \ b='test-random'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-tvdiff.log: test-tvdiff$(EXEEXT) @p='test-tvdiff$(EXEEXT)'; \ b='test-tvdiff'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_array_size-test-array-size.Po -rm -f ./$(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po -rm -f ./$(DEPDIR)/test_ascii_string-test-ascii-string.Po -rm -f ./$(DEPDIR)/test_byte_swapping-test-byte-swapping.Po -rm -f ./$(DEPDIR)/test_checked_overflow-test-checked-overflow.Po -rm -f ./$(DEPDIR)/test_human_size-test-human-size.Po -rm -f ./$(DEPDIR)/test_isaligned-test-isaligned.Po -rm -f ./$(DEPDIR)/test_ispowerof2-test-ispowerof2.Po -rm -f ./$(DEPDIR)/test_iszero-test-iszero.Po -rm -f ./$(DEPDIR)/test_minmax-test-minmax.Po -rm -f ./$(DEPDIR)/test_nextnonzero-test-nextnonzero.Po -rm -f ./$(DEPDIR)/test_random-test-random.Po -rm -f ./$(DEPDIR)/test_tvdiff-test-tvdiff.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/test_array_size-test-array-size.Po -rm -f ./$(DEPDIR)/test_ascii_ctype-test-ascii-ctype.Po -rm -f ./$(DEPDIR)/test_ascii_string-test-ascii-string.Po -rm -f ./$(DEPDIR)/test_byte_swapping-test-byte-swapping.Po -rm -f ./$(DEPDIR)/test_checked_overflow-test-checked-overflow.Po -rm -f ./$(DEPDIR)/test_human_size-test-human-size.Po -rm -f ./$(DEPDIR)/test_isaligned-test-isaligned.Po -rm -f ./$(DEPDIR)/test_ispowerof2-test-ispowerof2.Po -rm -f ./$(DEPDIR)/test_iszero-test-iszero.Po -rm -f ./$(DEPDIR)/test_minmax-test-minmax.Po -rm -f ./$(DEPDIR)/test_nextnonzero-test-nextnonzero.Po -rm -f ./$(DEPDIR)/test_random-test-random.Po -rm -f ./$(DEPDIR)/test_tvdiff-test-tvdiff.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/include/test-array-size.c0000644000175000017500000000727514534316443014700 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "array-size.h" #include "static-assert.h" struct st { const char *s; int i; }; static const char *s0[] __attribute__ ((__unused__)) = { }; static const char *s1[] __attribute__ ((__unused__)) = { "a" }; static const char *s3[] __attribute__ ((__unused__)) = { "a", "b", "c" }; static const char *s4[4] __attribute__ ((__unused__)) = { "a", "b", "c", "d" }; static int i0[] __attribute__ ((__unused__)) = { }; static int i1[] __attribute__ ((__unused__)) = { 1 }; static int i3[] __attribute__ ((__unused__)) = { 1, 2, 3 }; static int i4[4] __attribute__ ((__unused__)) = { 1, 2, 3, 4 }; static struct st st0[] __attribute__ ((__unused__)) = { }; static struct st st1[] __attribute__ ((__unused__)) = { { "a", 1 } }; static struct st st3[] __attribute__ ((__unused__)) = { { "a", 1 }, { "b", 2 }, { "c", 3 } }; static struct st st4[4] __attribute__ ((__unused__)) = { { "a", 1 }, { "b", 2 }, { "c", 3 }, { "d", 4 } }; static struct st st4_0[4] __attribute__ ((__unused__)); int main (void) { STATIC_ASSERT (ARRAY_SIZE (s0) == 0, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (s1) == 1, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (s3) == 3, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (s4) == 4, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (i0) == 0, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (i1) == 1, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (i3) == 3, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (i4) == 4, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (st0) == 0, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (st1) == 1, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (st3) == 3, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (st4) == 4, _array_size_macro_works); STATIC_ASSERT (ARRAY_SIZE (st4_0) == 4, _array_size_macro_works); /* You can uncomment this to test the negative case. Unfortunately * it's difficult to automate this test. */ #if 0 int *p = i4; STATIC_ASSERT (ARRAY_SIZE (p) == 4, _array_size_macro_is_applied_to_array); #endif exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/array-size.h0000644000175000017500000000327714534316443013726 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ARRAY_SIZE_H #define NBDKIT_ARRAY_SIZE_H #include "compiler-macros.h" #define ARRAY_SIZE(a) \ ((sizeof (a) / sizeof ((a)[0])) + BUILD_BUG_UNLESS_TRUE (TYPE_IS_ARRAY (a))) #endif /* NBDKIT_ARRAY_SIZE_H */ nbdkit-1.42.2/common/include/test-ascii-ctype.c0000644000175000017500000000621314534316443015013 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "ascii-ctype.h" int main (void) { assert (ascii_isspace (' ')); assert (ascii_isspace ('\t')); assert (ascii_isspace ('\n')); assert (! ascii_isspace ('a')); assert (ascii_isalpha ('a')); assert (ascii_isalpha ('Z')); assert (ascii_isalpha ('z')); assert (! ascii_isalpha (' ')); assert (! ascii_isalpha ('0')); { const char *s = "Ä"; assert (! ascii_isalpha (s[0])); } { const char *s = "®"; assert (! ascii_isalpha (s[0])); } assert (ascii_isdigit ('0')); assert (ascii_isdigit ('9')); { const char *s = "Ø"; assert (! ascii_isdigit (s[0])); } /* U+00D8 */ { const char *s = "ï¼™"; assert (! ascii_isdigit (s[0])); } /* U+FF19 */ assert (ascii_islower ('a')); assert (ascii_islower ('z')); assert (! ascii_islower ('Z')); { const char *s = "Ä"; assert (! ascii_islower (s[0])); } assert (ascii_isupper ('A')); assert (ascii_isupper ('Z')); assert (! ascii_isupper ('z')); { const char *s = "Ä"; assert (! ascii_isupper (s[0])); } assert (ascii_tolower ('A') == 'a'); assert (ascii_tolower ('Z') == 'z'); assert (ascii_tolower ('a') == 'a'); assert (ascii_tolower ('z') == 'z'); assert (ascii_tolower ('0') == '0'); { const char *s = "Ä"; assert (ascii_tolower (s[0]) == s[0]); } assert (ascii_toupper ('a') == 'A'); assert (ascii_toupper ('z') == 'Z'); assert (ascii_toupper ('A') == 'A'); assert (ascii_toupper ('Z') == 'Z'); assert (ascii_toupper ('0') == '0'); { const char *s = "à"; assert (ascii_toupper (s[0]) == s[0]); } exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/ascii-ctype.h0000644000175000017500000000607014534316443014044 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Normal ctype functions are affected by the current locale. For * example isupper() might recognize Ä in some but not all locales. * These functions match only 7 bit ASCII characters. */ #ifndef NBDKIT_ASCII_CTYPE_H #define NBDKIT_ASCII_CTYPE_H #define ascii_isalnum(c) (ascii_isalpha (c) || ascii_isdigit (c)) #define ascii_isalpha(c) \ (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) #define ascii_isdigit(c) \ ((c) >= '0' && (c) <= '9') #define ascii_isspace(c) \ ((c) == '\t' || (c) == '\n' || (c) == '\f' || (c) == '\r' || (c) == ' ') #define ascii_isupper(c) \ ((c) >= 'A' && (c) <= 'Z') #define ascii_islower(c) \ ((c) >= 'a' && (c) <= 'z') /* See also hexdigit.h */ #define ascii_isxdigit(c) \ ((c) == '0' || (c) == '1' || (c) == '2' || (c) == '3' || (c) == '4' || \ (c) == '5' || (c) == '6' || (c) == '7' || (c) == '8' || (c) == '9' || \ (c) == 'a' || (c) == 'b' || (c) == 'c' || \ (c) == 'd' || (c) == 'e' || (c) == 'f' || \ (c) == 'A' || (c) == 'B' || (c) == 'C' || \ (c) == 'D' || (c) == 'E' || (c) == 'F') #define ascii_tolower(c) \ (ascii_isupper ((c)) ? (c) + 32 : (c)) #define ascii_toupper(c) \ (ascii_islower ((c)) ? (c) - 32 : (c)) #define ascii_isprint(c) ((c) >= 32 && (c) <= 126) #endif /* NBDKIT_ASCII_CTYPE_H */ nbdkit-1.42.2/common/include/test-ascii-string.c0000644000175000017500000000611114534316443015172 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "ascii-string.h" int main (void) { assert (ascii_strcasecmp ("", "") == 0); assert (ascii_strcasecmp ("a", "a") == 0); assert (ascii_strcasecmp ("abc", "abc") == 0); assert (ascii_strcasecmp ("a", "b") < 0); assert (ascii_strcasecmp ("b", "a") > 0); assert (ascii_strcasecmp ("aa", "a") > 0); /* Second string contains Turkish dotless lowercase letter ı. */ assert (ascii_strcasecmp ("hi", "hı") != 0); /* Check that we got our rounding behaviour correct. */ assert (ascii_strcasecmp ("\x1", "\x7f") < 0); assert (ascii_strcasecmp ("\x1", "\x80") < 0); assert (ascii_strcasecmp ("\x1", "\x81") < 0); assert (ascii_strcasecmp ("\x1", "\xff") < 0); assert (ascii_strncasecmp ("", "", 0) == 0); assert (ascii_strncasecmp ("a", "a", 1) == 0); assert (ascii_strncasecmp ("abc", "abc", 3) == 0); assert (ascii_strncasecmp ("abc", "def", 0) == 0); assert (ascii_strncasecmp ("abc", "abd", 2) == 0); assert (ascii_strncasecmp ("a", "b", 1) < 0); assert (ascii_strncasecmp ("b", "a", 1) > 0); assert (ascii_strncasecmp ("aa", "a", 2) > 0); assert (ascii_strncasecmp ("aa", "a", 100) > 0); assert (ascii_strncasecmp ("hi", "hı", 1) == 0); assert (ascii_strncasecmp ("hi", "hı", 2) != 0); assert (ascii_strncasecmp ("\x1", "\x7f", 1) < 0); assert (ascii_strncasecmp ("\x1", "\x80", 1) < 0); assert (ascii_strncasecmp ("\x1", "\x81", 1) < 0); assert (ascii_strncasecmp ("\x1", "\xff", 1) < 0); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/ascii-string.h0000644000175000017500000000507414534316443014231 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Case insensitive string comparison functions (like strcasecmp, * strncasecmp) which work correctly in any locale. They can only be * used for comparison when one or both strings is 7 bit ASCII. */ #ifndef NBDKIT_ASCII_STRING_H #define NBDKIT_ASCII_STRING_H #include "ascii-ctype.h" static inline int ascii_strcasecmp (const char *s1, const char *s2) { const unsigned char *us1 = (const unsigned char *)s1; const unsigned char *us2 = (const unsigned char *)s2; while (ascii_tolower (*us1) == ascii_tolower (*us2)) { if (*us1++ == '\0') return 0; us2++; } return ascii_tolower (*us1) - ascii_tolower (*us2); } static inline int ascii_strncasecmp (const char *s1, const char *s2, size_t n) { if (n != 0) { const unsigned char *us1 = (const unsigned char *)s1; const unsigned char *us2 = (const unsigned char *)s2; do { if (ascii_tolower (*us1) != ascii_tolower (*us2)) return ascii_tolower (*us1) - ascii_tolower (*us2); if (*us1++ == '\0') break; us2++; } while (--n != 0); } return 0; } #endif /* NBDKIT_ASCII_STRING_H */ nbdkit-1.42.2/common/include/test-byte-swapping.c0000644000175000017500000000670614534316443015401 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "byte-swapping.h" /* Little-endian test strings. */ static uint8_t le16[] = { 0x34, 0x12 }; static uint8_t le32[] = { 0x78, 0x56, 0x34, 0x12 }; static uint8_t le64[] = { 0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12 }; /* Big-endian test strings. */ static uint8_t be16[] = { 0x12, 0x34 }; static uint8_t be32[] = { 0x12, 0x34, 0x56, 0x78 }; static uint8_t be64[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 }; int main (void) { uint16_t i16; uint32_t i32; uint64_t i64; memcpy (&i16, le16, 2); assert (le16toh (i16) == 0x1234); memcpy (&i32, le32, 4); assert (le32toh (i32) == 0x12345678); memcpy (&i64, le64, 8); assert (le64toh (i64) == 0x123456789abcdef0); memcpy (&i16, be16, 2); assert (be16toh (i16) == 0x1234); memcpy (&i32, be32, 4); assert (be32toh (i32) == 0x12345678); memcpy (&i64, be64, 8); assert (be64toh (i64) == 0x123456789abcdef0); i16 = htole16 (0x1234); assert (memcmp (&i16, le16, 2) == 0); i32 = htole32 (0x12345678); assert (memcmp (&i32, le32, 4) == 0); i64 = htole64 (0x123456789abcdef0); assert (memcmp (&i64, le64, 8) == 0); i16 = htobe16 (0x1234); assert (memcmp (&i16, be16, 2) == 0); i32 = htobe32 (0x12345678); assert (memcmp (&i32, be32, 4) == 0); i64 = htobe64 (0x123456789abcdef0); assert (memcmp (&i64, be64, 8) == 0); memcpy (&i16, le16, 2); i16 = bswap_16 (i16); assert (memcmp (&i16, be16, 2) == 0); i16 = bswap_16 (i16); assert (memcmp (&i16, le16, 2) == 0); memcpy (&i32, le32, 4); i32 = bswap_32 (i32); assert (memcmp (&i32, be32, 4) == 0); i32 = bswap_32 (i32); assert (memcmp (&i32, le32, 4) == 0); memcpy (&i64, le64, 8); i64 = bswap_64 (i64); assert (memcmp (&i64, be64, 8) == 0); i64 = bswap_64 (i64); assert (memcmp (&i64, le64, 8) == 0); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/byte-swapping.h0000644000175000017500000001001614534316443014416 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* The job of this header is to define macros (or functions) called * things like 'htobe32' and 'le64toh' which byte swap N-bit integers * between host representation, and little and big endian. Also * bswap_16, bswap_32 and bswap_64 which simply swap endianness. * * The core code and plugins in nbdkit uses these names and relies on * this header to provide the platform-specific implementation. On * GNU/Linux these are defined in and but * other platforms have other requirements. */ #ifndef NBDKIT_BYTE_SWAPPING_H #define NBDKIT_BYTE_SWAPPING_H #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_ENDIAN_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef __HAIKU__ #include #define htobe16(x) B_HOST_TO_BENDIAN_INT16 (x) #define htole16(x) B_HOST_TO_LENDIAN_INT16 (x) #define be16toh(x) B_BENDIAN_TO_HOST_INT16 (x) #define le16toh(x) B_LENDIAN_TO_HOST_INT16 (x) #define htobe32(x) B_HOST_TO_BENDIAN_INT32 (x) #define htole32(x) B_HOST_TO_LENDIAN_INT32 (x) #define be32toh(x) B_BENDIAN_TO_HOST_INT32 (x) #define le32toh(x) B_LENDIAN_TO_HOST_INT32 (x) #define htobe64(x) B_HOST_TO_BENDIAN_INT64 (x) #define htole64(x) B_HOST_TO_LENDIAN_INT64 (x) #define be64toh(x) B_BENDIAN_TO_HOST_INT64 (x) #define le64toh(x) B_LENDIAN_TO_HOST_INT64 (x) #endif /* If we didn't define bswap_16, bswap_32 and bswap_64 already above, * create macros. GCC >= 4.8 and Clang have builtins. */ #ifndef bswap_16 #define bswap_16 __builtin_bswap16 #endif #ifndef bswap_32 #define bswap_32 __builtin_bswap32 #endif #ifndef bswap_64 #define bswap_64 __builtin_bswap64 #endif /* If we didn't define htobe* above then define them in terms of * bswap_* macros. */ #ifndef htobe32 # ifndef WORDS_BIGENDIAN /* little endian */ # define htobe16(x) bswap_16 (x) # define htole16(x) (x) # define be16toh(x) bswap_16 (x) # define le16toh(x) (x) # define htobe32(x) bswap_32 (x) # define htole32(x) (x) # define be32toh(x) bswap_32 (x) # define le32toh(x) (x) # define htobe64(x) bswap_64 (x) # define htole64(x) (x) # define be64toh(x) bswap_64 (x) # define le64toh(x) (x) # else /* big endian */ # define htobe16(x) (x) # define htole16(x) bswap_16 (x) # define be16toh(x) (x) # define le16toh(x) bswap_16 (x) # define htobe32(x) (x) # define htole32(x) bswap_32 (x) # define be32toh(x) (x) # define le32toh(x) bswap_32 (x) # define htobe64(x) (x) # define htole64(x) bswap_64 (x) # define be64toh(x) (x) # define le64toh(x) bswap_64 (x) # endif #endif #endif /* NBDKIT_BYTE_SWAPPING_H */ nbdkit-1.42.2/common/include/test-checked-overflow.c0000644000175000017500000001724214534316443016034 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "checked-overflow.h" #define TEST_ADD(a, b, result, expected_overflow, expected_result) \ do { \ bool actual_overflow; \ \ actual_overflow = ADD_OVERFLOW_FALLBACK ((a), (b), (result)); \ assert (actual_overflow == (expected_overflow)); \ assert (*(result) == (expected_result)); \ actual_overflow = ADD_OVERFLOW_FALLBACK ((b), (a), (result)); \ assert (actual_overflow == (expected_overflow)); \ assert (*(result) == (expected_result)); \ } while (0) #define TEST_MUL(a, b, result, expected_overflow, expected_result) \ do { \ bool actual_overflow; \ \ actual_overflow = MUL_OVERFLOW_FALLBACK ((a), (b), (result)); \ assert (actual_overflow == (expected_overflow)); \ assert (*(result) == (expected_result)); \ actual_overflow = MUL_OVERFLOW_FALLBACK ((b), (a), (result)); \ assert (actual_overflow == (expected_overflow)); \ assert (*(result) == (expected_result)); \ } while (0) /* Define these const-qualified objects because the UINTN_MAX object-like * macros in have "post integer promotion" types. Therefore, * UINT16_MAX and UINT8_MAX most commonly have type "int". And that trips the * signedness check in ADD_OVERFLOW_FALLBACK(). */ static const uintmax_t umax_max = UINTMAX_MAX; static const uint64_t u64_max = UINT64_MAX; static const uint32_t u32_max = UINT32_MAX; static const uint16_t u16_max = UINT16_MAX; static const uint8_t u8_max = UINT8_MAX; static const size_t size_max = SIZE_MAX; int main (void) { union { uintmax_t umax; uint64_t u64; uint32_t u32; uint16_t u16; uint8_t u8; size_t sz; } result; bool overflow; /* "max + 0" and "0 + max" evaluate to "max", without overflow. */ TEST_ADD (umax_max, 0u, &result.umax, false, umax_max); TEST_ADD (u64_max, 0u, &result.u64, false, u64_max); TEST_ADD (u32_max, 0u, &result.u32, false, u32_max); TEST_ADD (u16_max, 0u, &result.u16, false, u16_max); TEST_ADD (u8_max, 0u, &result.u8, false, u8_max); TEST_ADD (size_max, 0u, &result.sz, false, size_max); /* "max + 1" and "1 + max" overflow to zero. */ TEST_ADD (umax_max, 1u, &result.umax, true, 0); TEST_ADD (u64_max, 1u, &result.u64, true, 0); TEST_ADD (u32_max, 1u, &result.u32, true, 0); TEST_ADD (u16_max, 1u, &result.u16, true, 0); TEST_ADD (u8_max, 1u, &result.u8, true, 0); TEST_ADD (size_max, 1u, &result.sz, true, 0); /* Adding umax_max (i.e., all-bits-one) amounts (with overflow) to * subtracting one. */ TEST_ADD (umax_max, umax_max, &result.umax, true, umax_max - 1); TEST_ADD (u64_max, umax_max, &result.u64, true, u64_max - 1); TEST_ADD (u32_max, umax_max, &result.u32, true, u32_max - 1); TEST_ADD (u16_max, umax_max, &result.u16, true, u16_max - 1); TEST_ADD (u8_max, umax_max, &result.u8, true, u8_max - 1); TEST_ADD (size_max, umax_max, &result.sz, true, size_max - 1); /* "max * 0" and "0 * max" evaluate to 0, without overflow. */ TEST_MUL (umax_max, 0u, &result.umax, false, 0); TEST_MUL (u64_max, 0u, &result.u64, false, 0); TEST_MUL (u32_max, 0u, &result.u32, false, 0); TEST_MUL (u16_max, 0u, &result.u16, false, 0); TEST_MUL (u8_max, 0u, &result.u8, false, 0); TEST_MUL (size_max, 0u, &result.sz, false, 0); /* "max * 1" and "1 * max" evaluate to "max", without overflow. */ TEST_MUL (umax_max, 1u, &result.umax, false, umax_max); TEST_MUL (u64_max, 1u, &result.u64, false, u64_max); TEST_MUL (u32_max, 1u, &result.u32, false, u32_max); TEST_MUL (u16_max, 1u, &result.u16, false, u16_max); TEST_MUL (u8_max, 1u, &result.u8, false, u8_max); TEST_MUL (size_max, 1u, &result.sz, false, size_max); /* "max * 2" and "2 * max" evaluate (with overflow) to "max - 1". */ TEST_MUL (umax_max, 2u, &result.umax, true, umax_max - 1); TEST_MUL (u64_max, 2u, &result.u64, true, u64_max - 1); TEST_MUL (u32_max, 2u, &result.u32, true, u32_max - 1); TEST_MUL (u16_max, 2u, &result.u16, true, u16_max - 1); TEST_MUL (u8_max, 2u, &result.u8, true, u8_max - 1); TEST_MUL (size_max, 2u, &result.sz, true, size_max - 1); /* factor 255 -> 3 5 17 * factor 65535 -> 3 5 17 257 * factor 4294967295 -> 3 5 17 257 65537 * factor 18446744073709551615 -> 3 5 17 257 641 65537 6700417 * * Note: every time we double the width, we multiply the previous maximum * 0xF...F with 0x10...01: * * 0xF (= 3 * 5) * 0x11 (= 17) = 0xFF * 0xFF * 0x101 (= 257) = 0xFFFF * 0xFFFF * 0x10001 (= 65537) = 0xFFFFFFFF * 0xFFFFFFFF * 0x100000001 (= 641 * 6700417) = 0xFFFFFFFFFFFFFFFF * * Perform the above multiplications, advacing with prime factors. */ overflow = MUL_OVERFLOW_FALLBACK (3u, 5u, &result.u8); assert (!overflow); assert (result.u8 == 0xF); overflow = MUL_OVERFLOW_FALLBACK (result.u8, 17u, &result.u8); assert (!overflow); assert (result.u8 == UINT8_MAX); overflow = MUL_OVERFLOW_FALLBACK (result.u8, 257u, &result.u16); assert (!overflow); assert (result.u16 == UINT16_MAX); overflow = MUL_OVERFLOW_FALLBACK (result.u16, 65537ul, &result.u32); assert (!overflow); assert (result.u32 == UINT32_MAX); overflow = MUL_OVERFLOW_FALLBACK (result.u32, 641u, &result.u64); assert (!overflow); overflow = MUL_OVERFLOW_FALLBACK (result.u64, 6700417ul, &result.u64); assert (!overflow); assert (result.u64 == UINT64_MAX); return 0; } nbdkit-1.42.2/common/include/checked-overflow.h0000644000175000017500000002107214534316443015060 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* This header file defines macros and functions for checking overflow in * common integer arithmetic operations. * * The macros use: * - the "statement expression" GCC extension, * - the "typeof" GCC extension, * - the __builtin_add_overflow() and __builtin_mul_overflow() GCC/Clang * built-ins. * * If either built-in is unavailable, the corresponding macro replaces it with * a call to an inline C function. */ #ifndef NBDKIT_CHECKED_OVERFLOW_H #define NBDKIT_CHECKED_OVERFLOW_H #if !defined (__GNUC__) && !defined (__clang__) #error "this file may need to be ported to your compiler" #endif #include #include #include "static-assert.h" #include "unique-name.h" /* Add "a" and "b", both of (possibly different) unsigned integer types, and * store the sum in "*r", which must also have some unsigned integer type. * * Each macro argument is evaluated exactly once, as long as it does not have * variably modified type. * * The macro evaluates to "false" if "*r" can represent the mathematical sum. * Otherwise, the macro evaluates to "true", and the low order bits of the * mathematical sum are stored to "*r". */ #if HAVE_DECL___BUILTIN_ADD_OVERFLOW #define ADD_OVERFLOW(a, b, r) ADD_OVERFLOW_BUILTIN ((a), (b), (r)) #else #define ADD_OVERFLOW(a, b, r) ADD_OVERFLOW_FALLBACK ((a), (b), (r)) #endif /* Multiply "a" and "b", both of (possibly different) unsigned integer types, * and store the product in "*r", which must also have some unsigned integer * type. * * Each macro argument is evaluated exactly once, as long as it does not have * variably modified type. * * The macro evaluates to "false" if "*r" can represent the mathematical * product. Otherwise, the macro evaluates to "true", and the low order bits of * the mathematical product are stored to "*r". */ #if HAVE_DECL___BUILTIN_MUL_OVERFLOW #define MUL_OVERFLOW(a, b, r) MUL_OVERFLOW_BUILTIN ((a), (b), (r)) #else #define MUL_OVERFLOW(a, b, r) MUL_OVERFLOW_FALLBACK ((a), (b), (r)) #endif /* The ADD_OVERFLOW_BUILTIN and MUL_OVERFLOW_BUILTIN function-like macros * enforce the unsignedness of all their operands even though the underlying * compiler built-ins, __builtin_add_overflow() and __builtin_mul_overflow(), * don't depend on that. The explanation is that the fallback implementation * does depend on the unsignedness of all operands, and the codebase should * seamlessly build regardless of the built-in vs. fallback choice. * * Each macro argument is evaluated exactly once, as long as it does not have * variably modified type. */ #if HAVE_DECL___BUILTIN_ADD_OVERFLOW #define ADD_OVERFLOW_BUILTIN(a, b, r) \ ({ \ STATIC_ASSERT_UNSIGNED_INT (a); \ STATIC_ASSERT_UNSIGNED_INT (b); \ STATIC_ASSERT_UNSIGNED_INT (*(r)); \ __builtin_add_overflow ((a), (b), (r)); \ }) #endif #if HAVE_DECL___BUILTIN_MUL_OVERFLOW #define MUL_OVERFLOW_BUILTIN(a, b, r) \ ({ \ STATIC_ASSERT_UNSIGNED_INT (a); \ STATIC_ASSERT_UNSIGNED_INT (b); \ STATIC_ASSERT_UNSIGNED_INT (*(r)); \ __builtin_mul_overflow ((a), (b), (r)); \ }) #endif /* The fallback macros call inline C functions. The unsignedness of all * operands is enforced in order to keep the conversion to uintmax_t * value-preserving, and to keep the conversion back from uintmax_t independent * of the C language implementation. * * Each macro argument is evaluated exactly once, as long as it does not have * variably modified type. * * The fallback macros and the inline C functions are defined regardless of * HAVE_DECL___BUILTIN_ADD_OVERFLOW and HAVE_DECL___BUILTIN_MUL_OVERFLOW so * that the test suite can always test the fallback. */ #define ADD_OVERFLOW_FALLBACK(a, b, r) \ ADD_OVERFLOW_FALLBACK_1 ((a), (b), (r), \ NBDKIT_UNIQUE_NAME (_overflow), \ NBDKIT_UNIQUE_NAME (_tmp)) #define ADD_OVERFLOW_FALLBACK_1(a, b, r, overflow, tmp) \ ({ \ bool overflow; \ uintmax_t tmp; \ \ STATIC_ASSERT_UNSIGNED_INT (a); \ STATIC_ASSERT_UNSIGNED_INT (b); \ STATIC_ASSERT_UNSIGNED_INT (*(r)); \ overflow = check_add_overflow ((a), (b), \ (typeof (*(r)))-1, \ &tmp); \ *(r) = tmp; \ overflow; \ }) #define MUL_OVERFLOW_FALLBACK(a, b, r) \ MUL_OVERFLOW_FALLBACK_1 ((a), (b), (r), \ NBDKIT_UNIQUE_NAME (_overflow), \ NBDKIT_UNIQUE_NAME (_tmp)) #define MUL_OVERFLOW_FALLBACK_1(a, b, r, overflow, tmp) \ ({ \ bool overflow; \ uintmax_t tmp; \ \ STATIC_ASSERT_UNSIGNED_INT (a); \ STATIC_ASSERT_UNSIGNED_INT (b); \ STATIC_ASSERT_UNSIGNED_INT (*(r)); \ overflow = check_mul_overflow ((a), (b), \ (typeof (*(r)))-1, \ &tmp); \ *(r) = tmp; \ overflow; \ }) /* Assert, at compile time, that the expression "x" has some unsigned integer * type. * * The expression "x" is not evaluated, unless it has variably modified type. */ #define STATIC_ASSERT_UNSIGNED_INT(x) \ STATIC_ASSERT ((typeof (x))-1 > 0, _x_has_uint_type) /* Assign the sum "a + b" to "*r", using uintmax_t modular arithmetic. * * Return true iff the addition overflows or the result exceeds "max". */ static inline bool check_add_overflow (uintmax_t a, uintmax_t b, uintmax_t max, uintmax_t *r) { bool in_range; *r = a + b; in_range = a <= UINTMAX_MAX - b && *r <= max; return !in_range; } /* Assign the product "a * b" to "*r", using uintmax_t modular arithmetic. * * Return true iff the multiplication overflows or the result exceeds "max". */ static inline bool check_mul_overflow (uintmax_t a, uintmax_t b, uintmax_t max, uintmax_t *r) { bool in_range; *r = a * b; in_range = b == 0 || (a <= UINTMAX_MAX / b && *r <= max); return !in_range; } #endif /* NBDKIT_CHECKED_OVERFLOW_H */ nbdkit-1.42.2/common/include/test-human-size.c0000644000175000017500000000447314534316443014667 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include "array-size.h" #include "human-size.h" #include "human-size-test-cases.h" /* defines 'pairs' below */ int main (void) { size_t i; bool pass = true; for (i = 0; i < ARRAY_SIZE (pairs); i++) { const char *error = NULL, *pstr = NULL; int64_t r; r = human_size_parse (pairs[i].str, &error, &pstr); if (r != pairs[i].res) { fprintf (stderr, "Wrong parse for %s, got %" PRId64 ", expected %" PRId64 "\n", pairs[i].str, r, pairs[i].res); pass = false; } if (r == -1) { if (error == NULL || pstr == NULL) { fprintf (stderr, "Wrong error message handling for %s\n", pairs[i].str); pass = false; } } } exit (pass ? EXIT_SUCCESS : EXIT_FAILURE); } nbdkit-1.42.2/common/include/human-size.h0000644000175000017500000000744014534316443013714 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_HUMAN_SIZE_H #define NBDKIT_HUMAN_SIZE_H #include #include #include /* Attempt to parse a string with a possible scaling suffix, such as * "2M". Disk sizes cannot usefully exceed off_t (which is signed) * and cannot be negative. * * On error, returns -1 and sets *error and *pstr. You can form a * final error message by appending ": ". */ static inline int64_t human_size_parse (const char *str, const char **error, const char **pstr) { int64_t size; char *end; uint64_t scale = 1; /* XXX Should we also parse things like '1.5M'? */ /* XXX Should we allow hex? If so, hex cannot use scaling suffixes, * because some of them are valid hex digits. */ errno = 0; size = strtoimax (str, &end, 10); if (str == end) { *error = "could not parse size string"; *pstr = str; return -1; } if (size < 0) { *error = "size cannot be negative"; *pstr = str; return -1; } if (errno) { *error = "size exceeds maximum value"; *pstr = str; return -1; } switch (*end) { /* No suffix */ case '\0': end--; /* Safe, since we already filtered out empty string */ break; /* Powers of 1024 */ case 'e': case 'E': scale *= 1024; /* fallthru */ case 'p': case 'P': scale *= 1024; /* fallthru */ case 't': case 'T': scale *= 1024; /* fallthru */ case 'g': case 'G': scale *= 1024; /* fallthru */ case 'm': case 'M': scale *= 1024; /* fallthru */ case 'k': case 'K': scale *= 1024; /* fallthru */ case 'b': case 'B': break; /* "sectors", ie. units of 512 bytes, even if that's not the real * sector size */ case 's': case 'S': scale = 512; break; default: *error = "could not parse size: unknown suffix"; *pstr = end; return -1; } /* XXX Maybe we should support 'MiB' as a synonym for 'M'; and 'MB' * for powers of 1000, for similarity to GNU tools. But for now, * anything beyond 'M' is dropped. */ if (end[1]) { *error = "could not parse size: unknown suffix"; *pstr = end; return -1; } if (INT64_MAX / scale < size) { *error = "could not parse size: size * scale overflows"; *pstr = str; return -1; } return size * scale; } #endif /* NBDKIT_HUMAN_SIZE_H */ nbdkit-1.42.2/common/include/human-size-test-cases.h0000644000175000017500000000700614534316443015763 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_HUMAN_SIZE_TEST_CASES_H #define NBDKIT_HUMAN_SIZE_TEST_CASES_H #include /* Just some common test cases shared (in nbdkit) between * common/include/test-human-size.c and server/test-public.c */ static struct pair { const char *str; int64_t res; } pairs[] = { /* Bogus strings */ { "", -1 }, { "0x0", -1 }, { "garbage", -1 }, { "0garbage", -1 }, { "8E", -1 }, { "8192P", -1 }, /* Strings leading to overflow */ { "9223372036854775808", -1 }, /* INT_MAX + 1 */ { "18446744073709551614", -1 }, /* UINT64_MAX - 1 */ { "18446744073709551615", -1 }, /* UINT64_MAX */ { "18446744073709551616", -1 }, /* UINT64_MAX + 1 */ { "999999999999999999999999", -1 }, /* Strings representing negative values */ { "-1", -1 }, { "-2", -1 }, { "-9223372036854775809", -1 }, /* INT64_MIN - 1 */ { "-9223372036854775808", -1 }, /* INT64_MIN */ { "-9223372036854775807", -1 }, /* INT64_MIN + 1 */ { "-18446744073709551616", -1 }, /* -UINT64_MAX - 1 */ { "-18446744073709551615", -1 }, /* -UINT64_MAX */ { "-18446744073709551614", -1 }, /* -UINT64_MAX + 1 */ /* Strings we may want to support in the future */ { "M", -1 }, { "1MB", -1 }, { "1MiB", -1 }, { "1.5M", -1 }, /* Valid strings */ { "-0", 0 }, { "0", 0 }, { "+0", 0 }, { " 08", 8 }, { "1", 1 }, { "+1", 1 }, { "1234567890", 1234567890 }, { "+1234567890", 1234567890 }, { "9223372036854775807", INT64_MAX }, { "1s", 512 }, { "2S", 1024 }, { "1b", 1 }, { "1B", 1 }, { "1k", 1024 }, { "1K", 1024 }, { "1m", 1024 * 1024 }, { "1M", 1024 * 1024 }, { "+1M", 1024 * 1024 }, { "1g", 1024 * 1024 * 1024 }, { "1G", 1024 * 1024 * 1024 }, { "1t", 1024LL * 1024 * 1024 * 1024 }, { "1T", 1024LL * 1024 * 1024 * 1024 }, { "1p", 1024LL * 1024 * 1024 * 1024 * 1024 }, { "1P", 1024LL * 1024 * 1024 * 1024 * 1024 }, { "8191p", 1024LL * 1024 * 1024 * 1024 * 1024 * 8191 }, { "1e", 1024LL * 1024 * 1024 * 1024 * 1024 * 1024 }, { "1E", 1024LL * 1024 * 1024 * 1024 * 1024 * 1024 }, }; #endif /* NBDKIT_HUMAN_SIZE_TEST_CASES_H */ nbdkit-1.42.2/common/include/test-isaligned.c0000644000175000017500000000406014534316443014536 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "isaligned.h" int main (void) { uint64_t i; for (i = 1; i <= 0x80000000; i <<= 1) { assert (IS_ALIGNED (0, i)); assert (IS_ALIGNED (i, i)); assert (IS_ALIGNED (i*2, i)); assert (IS_ALIGNED (i*3, i)); assert (IS_ALIGNED (i*4, i)); if (i > 1) { assert (! IS_ALIGNED (i-1, i)); assert (! IS_ALIGNED (i/2, i)); } } exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/isaligned.h0000644000175000017500000000351314534316443013570 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ISALIGNED_H #define NBDKIT_ISALIGNED_H #include #include "ispowerof2.h" /* Return true if size is a multiple of align. align must be power of 2. */ #define IS_ALIGNED(size, align) ({ \ assert (is_power_of_2 ((align))); \ !((size) & ((align) - 1)); \ }) #endif /* NBDKIT_ISALIGNED_H */ nbdkit-1.42.2/common/include/test-ispowerof2.c0000644000175000017500000000637414534316443014710 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "ispowerof2.h" int main (void) { uint64_t i; assert (! is_power_of_2 (0)); /* is_power_of_2 is only defined for unsigned long type, which is * 32 bit on 32 bit platforms. We need to store i in a 64 bit type * so the loops don't wrap around. */ for (i = 1; i <= 0x80000000; i <<= 1) assert (is_power_of_2 (i)); for (i = 4; i <= 0x80000000; i <<= 1) assert (! is_power_of_2 (i-1)); /* Check log_2_bits on some known values. */ assert (log_2_bits (1) == 0); assert (log_2_bits (512) == 9); assert (log_2_bits (4096) == 12); assert (log_2_bits (0x80000000) == 31); assert (log_2_bits (UINT64_C (0x100000000)) == 32); assert (log_2_bits (UINT64_C (0x8000000000000000)) == 63); /* Test next power of 2. */ assert (next_power_of_2 (0) == 1); assert (next_power_of_2 (1) == 1); assert (next_power_of_2 (3) == 4); assert (next_power_of_2 (8) == 8); assert (next_power_of_2 (9) == 16); assert (next_power_of_2 (0xffff) == 0x10000); assert (next_power_of_2 (0x10000) == 0x10000); assert (next_power_of_2 (INT64_C ( 0xffffffff)) == 0x100000000); assert (next_power_of_2 (INT64_C (0x100000000)) == 0x100000000); assert (next_power_of_2 (INT64_C (0x200000001)) == 0x400000000); assert (next_power_of_2 (INT64_C (0x6ffffffff)) == 0x800000000); assert (next_power_of_2 (INT64_C (0x700000001)) == 0x800000000); assert (next_power_of_2 (INT64_C (0x800000000)) == 0x800000000); assert (next_power_of_2 (UINT64_C (0x8000000000000000)) == UINT64_C (0x8000000000000000)); assert (next_power_of_2 (-1) == (uint64_t)-1); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/ispowerof2.h0000644000175000017500000000524314534316443013732 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ISPOWEROF2_H #define NBDKIT_ISPOWEROF2_H #include /* Returns true if v is a power of 2. * * Uses the algorithm described at * http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2 */ static inline bool is_power_of_2 (unsigned long v) { return v && ((v & (v - 1)) == 0); } /* Calculate log2(v) which is the size of the equivalent bit shift * for a power of 2. For example log_2_bits (512) == 9. * * Note: * - the input must be a power of 2 * - this is undefined for v == 0 * * __builtin_clzl is available in GCC and clang. */ static inline int log_2_bits (uint64_t v) { return 64 - __builtin_clzll (v) - 1; } /* Round up to next power of 2. * https://jameshfisher.com/2018/03/30/round-up-power-2/ * * Note: * 0x8000000000000000ULL => returns itself * >= 0x8000000000000001ULL (negative) => returns ((uint64_t)-1) (error) */ static inline uint64_t next_power_of_2 (int64_t x) { if ((uint64_t) x == UINT64_C (0x8000000000000000)) return UINT64_C (0x8000000000000000); else if (x < 0) return (uint64_t) -1; else if (x <= 1) return 1; else return UINT64_C (1) << (64 - __builtin_clzll (x-1)); } #endif /* NBDKIT_ISPOWEROF2_H */ nbdkit-1.42.2/common/include/test-iszero.c0000644000175000017500000000407014534316443014113 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "iszero.h" int main (void) { char *buf; size_t i, j; buf = malloc (256); if (buf == NULL) { perror ("malloc"); exit (EXIT_FAILURE); } memset (buf, 0, 256); for (j = 0; j <= 16; ++j) { for (i = 0; i <= 16; ++i) assert (is_zero (&buf[j], i)); for (i = 0; i <= 16; ++i) assert (is_zero (&buf[j], 256-j-i)); } free (buf); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/iszero.h0000644000175000017500000000427514534316443013152 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ISZERO_H #define NBDKIT_ISZERO_H #include #include /* Return true iff the buffer is all zero bytes. * * The clever approach here was suggested by Eric Blake. See: * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html * https://rusty.ozlabs.org/?p=560 * * See also: * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69908 */ static inline bool __attribute__ ((__nonnull__ (1))) is_zero (const char *buffer, size_t size) { size_t i; const size_t limit = size < 16 ? size : 16; for (i = 0; i < limit; ++i) if (buffer[i]) return false; if (size != limit) return ! memcmp (buffer, buffer + 16, size - 16); return true; } #endif /* NBDKIT_ISZERO_H */ nbdkit-1.42.2/common/include/test-minmax.c0000644000175000017500000001444314534316443014076 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include #include "minmax.h" #define SIGNED_TEST(var, min, max) \ MIN_SIGNED_TEST (var, min, max) \ MAX_SIGNED_TEST (var, min, max) #define MIN_SIGNED_TEST(var, min, max) \ var = 0; \ assert (MIN (0, var) == 0); \ var = 1; \ assert (MIN (0, var) == 0); \ var = -1; \ assert (MIN (0, var) == -1); \ var = 1; \ assert (MIN (var, 0) == 0); \ var = 1; \ assert (MIN (var, 1) == 1); \ var = -1; \ assert (MIN (var, 0) == -1); \ var = min; \ assert (MIN (var, min) == min); \ var = max; \ assert (MIN (var, max) == max); \ var = min; \ assert (MIN (var, max) == min); \ assert (MIN (0, min) == min); #define MAX_SIGNED_TEST(var, min, max) \ var = 0; \ assert (MAX (0, var) == 0); \ var = 1; \ assert (MAX (0, var) == 1); \ var = -1; \ assert (MAX (0, var) == 0); \ var = 1; \ assert (MAX (var, 0) == 1); \ var = 1; \ assert (MAX (var, 1) == 1); \ var = -1; \ assert (MAX (var, 0) == 0); \ var = min; \ assert (MAX (var, min) == min); \ var = max; \ assert (MAX (var, max) == max); \ var = min; \ assert (MAX (var, max) == max); \ assert (MAX (0, min) == 0); #define UNSIGNED_TEST(var, max) \ MIN_UNSIGNED_TEST (var, max) \ MAX_UNSIGNED_TEST (var, max) #define MIN_UNSIGNED_TEST(var, max) \ var = 0; \ assert (MIN (0, var) == 0); \ var = 1; \ assert (MIN (0, var) == 0); \ var = 1; \ assert (MIN (var, 0) == 0); \ var = 1; \ assert (MIN (var, 1) == 1); \ var = max; \ assert (MIN (var, max) == max); #define MAX_UNSIGNED_TEST(var, max) \ var = 0; \ assert (MAX (0, var) == 0); \ var = 1; \ assert (MAX (0, var) == 1); \ var = 1; \ assert (MAX (var, 0) == 1); \ var = 1; \ assert (MAX (var, 1) == 1); \ var = max; \ assert (MAX (var, max) == max); int main (void) { signed char sc; int i; int8_t i8; int16_t i16; int32_t i32; int64_t i64; unsigned char uc; unsigned u; uint8_t u8; uint16_t u16; uint32_t u32; uint64_t u64; float f; double d; SIGNED_TEST (sc, SCHAR_MIN, SCHAR_MAX); SIGNED_TEST (i, INT_MIN, INT_MAX); SIGNED_TEST (i8, INT8_MIN, INT8_MAX); SIGNED_TEST (i16, INT16_MIN, INT16_MAX); SIGNED_TEST (i32, INT32_MIN, INT32_MAX); SIGNED_TEST (i64, INT64_MIN, INT64_MAX); UNSIGNED_TEST (uc, UCHAR_MAX); UNSIGNED_TEST (u, UINT_MAX); UNSIGNED_TEST (u8, UINT8_MAX); UNSIGNED_TEST (u16, UINT16_MAX); UNSIGNED_TEST (u32, UINT32_MAX); UNSIGNED_TEST (u64, UINT64_MAX); /* Note that FLT_MIN and DBL_MIN are the closest positive normalized * numbers to 0.0, not the min. */ SIGNED_TEST (f, -FLT_MAX, FLT_MAX); SIGNED_TEST (d, -DBL_MAX, DBL_MAX); /* Test that MIN and MAX can be nested. This is really a compile * test, but we do check the answer. */ assert (MIN (MIN (1, 2), 3) == 1); assert (MAX (MIN (1, 2), 3) == 3); assert (MIN (MAX (1, 2), 3) == 2); assert (MAX (MAX (1, 4), 3) == 4); assert (MIN (3, MIN (1, 2)) == 1); assert (MAX (3, MIN (1, 2)) == 3); assert (MIN (3, MAX (1, 2)) == 2); assert (MAX (3, MAX (1, 4)) == 4); assert (MIN (MIN (1, MIN (2, 3)), 4) == 1); assert (MAX (MAX (1, MAX (2, 3)), 4) == 4); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/minmax.h0000644000175000017500000000570714534316443013131 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_MINMAX_H #define NBDKIT_MINMAX_H #include /* Safe MIN and MAX macros. These evaluate each parameter once. They * work for any comparable type. * * __auto_type is a GCC extension, added in GCC 4.9 in 2014, and to * Clang in 2015. The fallback uses typeof which was added a very * long time ago. Note that OpenBSD lacks __auto_type so the fallback * is required. */ #include "unique-name.h" #undef MIN #define MIN(x, y) \ MIN_1 ((x), (y), NBDKIT_UNIQUE_NAME (_x), NBDKIT_UNIQUE_NAME (_y)) #undef MAX #define MAX(x, y) \ MAX_1 ((x), (y), NBDKIT_UNIQUE_NAME (_x), NBDKIT_UNIQUE_NAME (_y)) #ifdef HAVE_AUTO_TYPE #define MIN_1(x, y, _x, _y) ({ \ __auto_type _x = (x); \ __auto_type _y = (y); \ _x < _y ? _x : _y; \ }) #define MAX_1(x, y, _x, _y) ({ \ __auto_type _x = (x); \ __auto_type _y = (y); \ _x > _y ? _x : _y; \ }) #else #define MIN_1(x, y, _x, _y) ({ \ typeof (x) _x = (x); \ typeof (y) _y = (y); \ _x < _y ? _x : _y; \ }) #define MAX_1(x, y, _x, _y) ({ \ typeof (x) _x = (x); \ typeof (y) _y = (y); \ _x > _y ? _x : _y; \ }) #endif #endif /* NBDKIT_MINMAX_H */ nbdkit-1.42.2/common/include/test-nextnonzero.c0000644000175000017500000000376414534316443015202 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "nextnonzero.h" char buf[256]; int main (void) { size_t i, j; char *p; for (j = 0; j <= 64; ++j) { for (i = 0; i <= 64; ++i) { memset (buf, 0, sizeof buf); p = &buf[sizeof buf - j - 1]; *p = i+1; assert (next_non_zero (&buf[i], sizeof buf - i) == p); } } exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/nextnonzero.h0000644000175000017500000000427714534316443014232 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_NEXTNONZERO_H #define NBDKIT_NEXTNONZERO_H /* Given a byte buffer, return a pointer to the first non-zero byte, * or return NULL if we reach the end of the buffer. * * XXX: Even with -O3 -mavx2, gcc 8.2.1 does a terrible job with this * loop, compiling it completely naively. QEMU has an AVX2 * implementation of a similar loop. * * See also: * https://sourceware.org/bugzilla/show_bug.cgi?id=19920 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69908 */ static inline const char * __attribute__ ((__nonnull__ (1))) next_non_zero (const char *buffer, size_t size) { size_t i; for (i = 0; i < size; ++i) if (buffer[i] != 0) return &buffer[i]; return NULL; } #endif /* NBDKIT_NEXTNONZERO_H */ nbdkit-1.42.2/common/include/test-random.c0000644000175000017500000001276314534316443014070 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include "array-size.h" #include "random.h" /* This works by comparing the result to some known test vectors. It * should produce the same result on all architectures, platforms and * compilers. */ #define LEN 16 struct { uint64_t seed; uint64_t vector[LEN]; } tests[] = { { 0, { UINT64_C (0x99ec5f36cb75f2b4), UINT64_C (0xbf6e1f784956452a), UINT64_C (0x1a5f849d4933e6e0), UINT64_C (0x6aa594f1262d2d2c), UINT64_C (0xbba5ad4a1f842e59), UINT64_C (0xffef8375d9ebcaca), UINT64_C (0x6c160deed2f54c98), UINT64_C (0x8920ad648fc30a3f), UINT64_C (0xdb032c0ba7539731), UINT64_C (0xeb3a475a3e749a3d), UINT64_C (0x1d42993fa43f2a54), UINT64_C (0x11361bf526a14bb5), UINT64_C (0x1b4f07a5ab3d8e9c), UINT64_C (0xa7a3257f6986db7f), UINT64_C (0x7efdaa95605dfc9c), UINT64_C (0x4bde97c0a78eaab8), } }, { 1, { UINT64_C (0xb3f2af6d0fc710c5), UINT64_C (0x853b559647364cea), UINT64_C (0x92f89756082a4514), UINT64_C (0x642e1c7bc266a3a7), UINT64_C (0xb27a48e29a233673), UINT64_C (0x24c123126ffda722), UINT64_C (0x123004ef8df510e6), UINT64_C (0x61954dcc47b1e89d), UINT64_C (0xddfdb48ab9ed4a21), UINT64_C (0x8d3cdb8c3aa5b1d0), UINT64_C (0xeebd114bd87226d1), UINT64_C (0xf50c3ff1e7d7e8a6), UINT64_C (0xeeca3115e23bc8f1), UINT64_C (0xab49ed3db4c66435), UINT64_C (0x99953c6c57808dd7), UINT64_C (0xe3fa941b05219325), } }, { 2, { UINT64_C (0x1a28690da8a8d057), UINT64_C (0xb9bb8042daedd58a), UINT64_C (0x2f1829af001ef205), UINT64_C (0xbf733e63d139683d), UINT64_C (0xafa78247c6a82034), UINT64_C (0x3c69a1b6d15cf0d0), UINT64_C (0xa5a9fdd18948c400), UINT64_C (0x3813d2654a981e91), UINT64_C (0x9be35597c9c97bfa), UINT64_C (0xbfc5e80fd0b75f32), UINT64_C (0xbee02daaac716557), UINT64_C (0x5afed6f12b594dbe), UINT64_C (0xae346b9196e12cc7), UINT64_C (0xf5f45afc1af068ed), UINT64_C (0xff75eccacfb37519), UINT64_C (0x1adca5a0b2e766c5), } }, { 3, { UINT64_C (0xb0cdabdae5668cc0), UINT64_C (0xa3fd1dea5e1864ee), UINT64_C (0x37e00afb3229fd51), UINT64_C (0x88b1b58b236f3bea), UINT64_C (0x6cb24c8fb224980a), UINT64_C (0x6646287ee2a98083), UINT64_C (0x35cd8bb5e1fa7256), UINT64_C (0xb72fe6e16b6fb4e6), UINT64_C (0xf1397a9f1db4f5d9), UINT64_C (0x31f25047faa8e5d4), UINT64_C (0xec616a6e46e96dec), UINT64_C (0xae0c5e0f7b5d1449), UINT64_C (0xa517e799c5c6e32f), UINT64_C (0xc1276908f843b688), UINT64_C (0xaf7e924d738d87ec), UINT64_C (0x1c3f3ba863d5c7d1), } }, { 4, { UINT64_C (0x437057a4eb7c3a13), UINT64_C (0xe95a0d7fd8c1832c), UINT64_C (0x71807ff81a0c627e), UINT64_C (0xfa40f34634632cd2), UINT64_C (0x39cf61fc694b95b7), UINT64_C (0x9ca3d6e037621a02), UINT64_C (0x7be965236729c7d3), UINT64_C (0xb95fba07afa980ac), UINT64_C (0x91424978ab94232), UINT64_C (0x565eb8170fdae341), UINT64_C (0x0744508beb95a6bb), UINT64_C (0xf2426b33aa0a601d), UINT64_C (0x7ddc1fcd0bfec893), UINT64_C (0x9e09fedd4af1ff3d), UINT64_C (0xbe77c1bed02132e7), UINT64_C (0x61e4f6e3e88d34d4), } }, { UINT64_MAX, { UINT64_C (0x8f5520d52a7ead08), UINT64_C (0xc476a018caa1802d), UINT64_C (0x81de31c0d260469e), UINT64_C (0xbf658d7e065f3c2f), UINT64_C (0x913593fda1bca32a), UINT64_C (0xbb535e93941ba525), UINT64_C (0x5ecda415c3c6dfde), UINT64_C (0xc487398fc9de9ae2), UINT64_C (0xa06746dbb57c4d62), UINT64_C (0x9d414196fdf05c8a), UINT64_C (0x41cf1af9a178c669), UINT64_C (0x0b3b3a95e78839f9), UINT64_C (0x7aaab30444aefc7e), UINT64_C (0x7b251ec961f341b1), UINT64_C (0x30ed32acf367205f), UINT64_C (0xc6ca62fc772728b0), } }, }; int main (void) { size_t i, j; uint64_t r; unsigned errors = 0; for (i = 0; i < ARRAY_SIZE (tests); ++i) { struct random_state state; printf ("seed: %" PRIu64 "\n", tests[i].seed); xsrandom (tests[i].seed, &state); for (j = 0; j < LEN; ++j) { r = xrandom (&state); if (tests[i].vector[j] != r) { printf ("\texpected: 0x%" PRIx64 "\tactual: 0x%" PRIx64 "\n", tests[i].vector[j], r); errors++; } } } if (errors > 0) { fprintf (stderr, "random vector does not match expected\n"); exit (EXIT_FAILURE); } printf ("test successful\n"); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/include/random.h0000644000175000017500000000667114534316443013121 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_RANDOM_H #define NBDKIT_RANDOM_H #include /* Generate pseudo-random numbers, quickly, with explicit state. * * This is based on the xoshiro/xoroshiro generators by David Blackman * and Sebastiano Vigna (http://xoshiro.di.unimi.it/). Specifically * the main PRNG is ‘xoshiro256** 1.0’, and the seed generator is * ‘splitmix64’. * * This does _NOT_ generate cryptographically secure random numbers * (CSPRNG) and so should not be used when cryptography or security is * required - use gcrypt if you need those. */ /* You can seed ‘struct random_state’ by setting the s[] elements * directly - but you must NOT set them all to zero. Alternately if * you have a 64 bit seed, you can call xsrandom to initialize the * state. */ struct random_state { uint64_t s[4]; }; static inline uint64_t snext (uint64_t *seed) { uint64_t z = (*seed += 0x9e3779b97f4a7c15); z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9; z = (z ^ (z >> 27)) * 0x94d049bb133111eb; return z ^ (z >> 31); } /* Seed the random state from a 64 bit seed. */ static inline void __attribute__ ((__nonnull__ (2))) xsrandom (uint64_t seed, struct random_state *state) { state->s[0] = snext (&seed); state->s[1] = snext (&seed); state->s[2] = snext (&seed); state->s[3] = snext (&seed); } static inline uint64_t rotl (const uint64_t x, int k) { /* RWMJ: I checked and GCC 10 emits either ‘rol’ or ‘ror’ correctly * for this code. */ return (x << k) | (x >> (64 - k)); } /* Returns 64 random bits. Updates the state. */ static inline uint64_t __attribute__ ((__nonnull__ (1))) xrandom (struct random_state *state) { const uint64_t result_starstar = rotl (state->s[1] * 5, 7) * 9; const uint64_t t = state->s[1] << 17; state->s[2] ^= state->s[0]; state->s[3] ^= state->s[1]; state->s[1] ^= state->s[2]; state->s[0] ^= state->s[3]; state->s[2] ^= t; state->s[3] = rotl (state->s[3], 45); return result_starstar; } #endif /* NBDKIT_RANDOM_H */ nbdkit-1.42.2/common/include/test-tvdiff.c0000644000175000017500000001134314534316443014063 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "tvdiff.h" /* This is mainly a test of the compiler and platform rather than our * implementation. */ #define TEST_TVDIFF(tv1, tv2, expected) \ do { \ int64_t actual = tvdiff_usec (&(tv1), &(tv2)); \ \ if (actual != (expected)) { \ fprintf (stderr, \ "%s: unexpected result %" PRIi64 ", expecting %" PRIi64 "\n", \ argv[0], actual, (int64_t) (expected)); \ errors++; \ } \ } while (0) #define TEST_SUBTRACT(tv1, tv2, exp_sec, exp_usec) \ do { \ struct timeval z; \ \ subtract_timeval (&tv1, &tv2, &z); \ if (z.tv_sec != (exp_sec) || z.tv_usec != (exp_usec)) { \ fprintf (stderr, \ "%s: unexpected (%ld, %d), expecting (%ld, %d)\n", \ argv[0], \ (long) z.tv_sec, (int) z.tv_usec, \ (long) (exp_sec), (int) (exp_usec)); \ errors++; \ } \ } while (0) int main (int argc, char *argv[]) { struct timeval tv1, tv2; unsigned errors = 0; tv1.tv_sec = 1000; tv1.tv_usec = 1; TEST_TVDIFF (tv1, tv1, 0); TEST_SUBTRACT (tv1, tv1, 0, 0); tv2.tv_sec = 1000; tv2.tv_usec = 2; TEST_TVDIFF (tv1, tv2, 1); TEST_SUBTRACT (tv1, tv2, 0, 1); TEST_TVDIFF (tv2, tv1, -1); TEST_SUBTRACT (tv2, tv1, 0, -1); tv2.tv_sec = 1000; tv2.tv_usec = 3; TEST_TVDIFF (tv1, tv2, 2); TEST_SUBTRACT (tv1, tv2, 0, 2); TEST_TVDIFF (tv2, tv1, -2); TEST_SUBTRACT (tv2, tv1, 0, -2); tv2.tv_sec = 1001; tv2.tv_usec = 0; TEST_TVDIFF (tv1, tv2, 999999); TEST_SUBTRACT (tv1, tv2, 0, 999999); TEST_TVDIFF (tv2, tv1, -999999); TEST_SUBTRACT (tv2, tv1, 0, -999999); tv1.tv_sec = 1000; tv1.tv_usec = 999999; tv2.tv_sec = 1001; tv2.tv_usec = 1; TEST_TVDIFF (tv1, tv2, 2); TEST_SUBTRACT (tv1, tv2, 0, 2); TEST_TVDIFF (tv2, tv1, -2); TEST_SUBTRACT (tv2, tv1, 0, -2); tv1.tv_sec = 1000; tv1.tv_usec = 1; tv2.tv_sec = 1001; tv2.tv_usec = 2; TEST_TVDIFF (tv1, tv2, 1000001); TEST_SUBTRACT (tv1, tv2, 1, 1); TEST_TVDIFF (tv2, tv1, -1000001); TEST_SUBTRACT (tv2, tv1, -1, -1); /* Test that an arbitrary tv is equal to itself. */ gettimeofday (&tv1, NULL); TEST_TVDIFF (tv1, tv1, 0); TEST_SUBTRACT (tv1, tv1, 0, 0); exit (errors == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } nbdkit-1.42.2/common/include/tvdiff.h0000644000175000017500000000425714534316443013121 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_TVDIFF_H #define NBDKIT_TVDIFF_H /* Compute struct timeval differences. */ #include #include /* Return the number of µs (microseconds) in y - x. */ static inline int64_t tvdiff_usec (const struct timeval *x, const struct timeval *y) { int64_t usec; usec = (y->tv_sec - x->tv_sec) * 1000000; usec += y->tv_usec - x->tv_usec; return usec; } /* Return timeval difference as another struct timeval. z = y - x. */ static inline void subtract_timeval (const struct timeval *x, const struct timeval *y, struct timeval *z) { int64_t usec = tvdiff_usec (x, y); z->tv_sec = usec / 1000000; z->tv_usec = usec % 1000000; } #endif /* NBDKIT_TVDIFF_H */ nbdkit-1.42.2/common/include/ansi-colours.h0000644000175000017500000000624214534316443014251 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ANSI_COLOURS_H #define NBDKIT_ANSI_COLOURS_H #include /* For the ansi_* functions, the main program should declare this * variable, and initialize it in main() / option parsing. See * libnbd.git/dump/dump.c for an example of how to initialize it. */ extern bool colour; /* Restore the terminal colours to the default. * * As well as doing this before normal exit, you should also set a * signal handler which calls this and fflush(fp). See * libnbd.git/dump/dump.c for an example. */ static inline void ansi_restore (FILE *fp) { if (colour) fputs ("\033[0m", fp); } /* Set the terminal colour. */ static inline void ansi_colour (const char *c, FILE *fp) { if (colour) fprintf (fp, "\033[%sm", c); } #define ANSI_FG_BOLD_BLACK "1;30" #define ANSI_FG_BLUE "22;34" #define ANSI_FG_BRIGHT_BLUE "1;34" #define ANSI_FG_BRIGHT_CYAN "1;36" #define ANSI_FG_BRIGHT_GREEN "1;32" #define ANSI_FG_BRIGHT_MAGENTA "1;35" #define ANSI_FG_BRIGHT_RED "1;31" #define ANSI_FG_BRIGHT_WHITE "1;37" #define ANSI_FG_BRIGHT_YELLOW "1;33" #define ANSI_FG_CYAN "22;36" #define ANSI_FG_GREEN "22;32" #define ANSI_FG_GREY "22;90" #define ANSI_FG_MAGENTA "22;35" #define ANSI_FG_RED "22;31" #define ANSI_FG_YELLOW "22;33" #define ANSI_BG_BLACK "40" #define ANSI_BG_LIGHT_GREY "47" #define ANSI_BG_GREY "100" /* Unconditional versions of above (don't depend on global ‘colour’). */ static inline void ansi_force_restore (FILE *fp) { fputs ("\033[0m", fp); } static inline void ansi_force_colour (const char *c, FILE *fp) { fprintf (fp, "\033[%sm", c); } #endif /* NBDKIT_ANSI_COLOURS_H */ nbdkit-1.42.2/common/include/compiler-macros.h0000644000175000017500000000734314534316443014732 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_COMPILER_MACROS_H #define NBDKIT_COMPILER_MACROS_H #ifndef __cplusplus /* BUILD_BUG_UNLESS_TRUE(1) => 0 * BUILD_BUG_UNLESS_TRUE(0) => compile-time failure * * It works by constructing a struct which has an impossible * (negative-sized) bitfield in the false case. Anonymous bitfields * are permitted in C99 and above. * * The Linux kernel calls this BUILD_BUG_ON_ZERO(!cond) which is a * confusing name. It has the same semantics except cond is negated. */ #define BUILD_BUG_STRUCT_SIZE(cond) \ (sizeof (struct { int: (cond) ? 1 : -1; })) #define BUILD_BUG_UNLESS_TRUE(cond) \ (BUILD_BUG_STRUCT_SIZE (cond) - BUILD_BUG_STRUCT_SIZE (cond)) /* Each of TYPE_IS_POINTER() and TYPE_IS_ARRAY() produces a build failure if it * is invoked with an object that has neither pointer-to-object type nor array * type. * * C99 6.5.2.1 constrains one of the operands of the subscript operator to have * pointer-to-object type, and the other operand to have integer type. In the * replacement text of TYPE_IS_POINTER(), we use [0] as subscript (providing the * integer operand), therefore the macro argument (p) is constrained to have * pointer-to-object type. * * If TYPE_IS_POINTER() is invoked with a pointer that has pointer-to-object * type, the constraint is directly satisfied, and TYPE_IS_POINTER() evaluates, * at compile time, to 1. * * If TYPE_IS_POINTER() is invoked with an array, the constraint of the * subscript operator is satisfied again -- because the array argument "decays" * to a pointer to the array's initial element (C99 6.3.2p3) --, and * TYPE_IS_POINTER() evaluates, at compile time, to 0. * * If TYPE_IS_POINTER() is invoked with an argument having any other type, then * the subscript operator constraint is not satisfied, and C99 5.1.1.3p1 * requires the emission of a diagnostic message -- the build breaks. Therefore, * TYPE_IS_ARRAY() can be defined simply as the logical negation of * TYPE_IS_POINTER(). */ #define TYPE_IS_POINTER(p) \ (__builtin_types_compatible_p (typeof (p), typeof (&(p)[0]))) #define TYPE_IS_ARRAY(a) (!TYPE_IS_POINTER (a)) #else /* __cplusplus */ #define BUILD_BUG_UNLESS_TRUE(cond) 0 #define TYPE_IS_POINTER(p) 1 #define TYPE_IS_ARRAY(a) 1 #endif /* __cplusplus */ #endif /* NBDKIT_COMPILER_MACROS_H */ nbdkit-1.42.2/common/include/hexdigit.h0000644000175000017500000000463614534316443013445 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_HEXDIGIT_H #define NBDKIT_HEXDIGIT_H /* Convert a hex character ('0'-'9', 'a'-'f', 'A'-'F') to the * corresponding numeric value. * * Note this does *not* check that the input is a hex character. To * check that, see ascii_isxdigit() in ascii-ctype.h */ static inline unsigned char hexdigit (const char c) { if (c >= '0' && c <= '9') return c - '0'; else if (c >= 'a' && c <= 'f') return c - 'a' + 10; else /* if (c >= 'A' && c <= 'F') */ return c - 'A' + 10; } /* Convert a pair of hex digits x0, x1 to a byte, eg. '5', 'A' -> 0x5A */ static inline unsigned char hexbyte (const char x0, const char x1) { unsigned char c0, c1; c0 = hexdigit (x0); c1 = hexdigit (x1); return c0 << 4 | c1; } /* Convert a number mod 16 to the corresponding hex character. */ static inline const char hexchar (size_t i) { static const char hex[] = "0123456789abcdef"; return hex[i & 0xf]; } #endif /* NBDKIT_HEXDIGIT_H */ nbdkit-1.42.2/common/include/rounding.h0000644000175000017500000000424414534316443013460 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ROUNDING_H #define NBDKIT_ROUNDING_H #include #include "ispowerof2.h" /* Round up i to next multiple of n (n must be a power of 2). */ #define ROUND_UP(i, n) ({ \ assert (is_power_of_2 (n)); \ ((i) + (n) - 1) & -((typeof (i))(n)); \ }) /* Round down i to next multiple of n (n must be a power of 2). */ #define ROUND_DOWN(i, n) ({ \ assert (is_power_of_2 (n)); \ (i) & -((typeof (i))(n)); \ }) /* Return n / d, rounding the result up to the next integer. */ #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #endif /* NBDKIT_ROUNDING_H */ nbdkit-1.42.2/common/include/static-assert.h0000644000175000017500000000411314534316443014414 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_STATIC_ASSERT_H #define NBDKIT_STATIC_ASSERT_H #include "unique-name.h" /* Assert "expression" at compile time. If "expression" evaluates to zero (at * compile time), produce a compiler error message that includes * "expectation_id". */ #define STATIC_ASSERT(expression, expectation_id) \ do { \ typedef char NBDKIT_UNIQUE_NAME (expectation_id)[(expression) ? 1 : -1] \ __attribute__ ((__unused__)); \ } while (0) #endif /* NBDKIT_STATIC_ASSERT_H */ nbdkit-1.42.2/common/include/unique-name.h0000644000175000017500000000351114534316443014053 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_UNIQUE_NAME_H #define NBDKIT_UNIQUE_NAME_H /* https://stackoverflow.com/a/1597129 * https://stackoverflow.com/a/12711226 */ #define XXUNIQUE_NAME(name, counter) name ## counter #define XUNIQUE_NAME(name, counter) XXUNIQUE_NAME (name, counter) #define NBDKIT_UNIQUE_NAME(name) XUNIQUE_NAME (name, __COUNTER__) #endif /* NBDKIT_UNIQUE_NAME_H */ nbdkit-1.42.2/common/include/unix-path-max.h0000644000175000017500000000322514534316443014331 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_UNIX_PATH_MAX_H #define NBDKIT_UNIX_PATH_MAX_H #ifdef __APPLE__ #define UNIX_PATH_MAX 104 #else #define UNIX_PATH_MAX 108 #endif #endif /* NBDKIT_UNIX_PATH_MAX_H */ nbdkit-1.42.2/common/protocol/0000755000175000017500000000000014771247240011755 5nbdkit-1.42.2/common/protocol/Makefile.am0000644000175000017500000000441114771245341013731 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = \ nbd-protocol.h \ protostrings.c \ $(NULL) include_HEADERS = nbd-protocol.h noinst_LTLIBRARIES = libprotocol.la libprotocol_la_SOURCES = \ protostrings.c \ protostrings.h \ nbd-protocol.h \ $(NULL) libprotocol_la_CFLAGS = $(WARNINGS_CFLAGS) # protostrings.c is generated from the nbd-protocol.h header file # where it is used to map NBD protocol flags to strings. BUILT_SOURCES = protostrings.c CLEANFILES += protostrings.c protostrings.c: nbd-protocol.h generate-protostrings.sh Makefile rm -f $@ $@-t $(builddir)/generate-protostrings.sh > $@-t mv $@-t $@ chmod 0444 $@ # Unit tests. TESTS = test-protostrings check_PROGRAMS = test-protostrings test_protostrings_SOURCES = test-protostrings.c protostrings.c protostrings.h test_protostrings_CFLAGS = $(WARNINGS_CFLAGS) nbdkit-1.42.2/common/protocol/nbd-protocol.h0000644000175000017500000002763514534316443014464 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBD_PROTOCOL_H #define NBD_PROTOCOL_H #include /* Note that all NBD fields are sent on the wire in network byte * order, so you must use beXXtoh or htobeXX when reading or writing * these structures. */ #if defined (__GNUC__) || defined (__clang__) #define NBD_ATTRIBUTE_PACKED __attribute__ ((__packed__)) #else #error "Please port to your compiler's notion of a packed struct" #endif #define NBD_MAX_STRING 4096 /* Maximum length of a string field */ /* Old-style handshake. */ struct nbd_old_handshake { uint64_t nbdmagic; /* NBD_MAGIC */ uint64_t version; /* NBD_OLD_VERSION */ uint64_t exportsize; uint16_t gflags; /* global flags */ uint16_t eflags; /* per-export flags */ char zeroes[124]; /* must be sent as zero bytes */ } NBD_ATTRIBUTE_PACKED; #define NBD_MAGIC UINT64_C (0x4e42444d41474943) /* ASCII "NBDMAGIC" */ #define NBD_OLD_VERSION UINT64_C (0x0000420281861253) /* New-style handshake. */ struct nbd_new_handshake { uint64_t nbdmagic; /* NBD_MAGIC */ uint64_t version; /* NBD_NEW_VERSION */ uint16_t gflags; /* global flags */ } NBD_ATTRIBUTE_PACKED; #define NBD_NEW_VERSION UINT64_C (0x49484156454F5054) /* ASCII "IHAVEOPT" */ /* New-style handshake option (sent by the client to us). */ struct nbd_new_option { uint64_t version; /* NBD_NEW_VERSION */ uint32_t option; /* NBD_OPT_* */ uint32_t optlen; /* option data length */ /* option data follows */ } NBD_ATTRIBUTE_PACKED; /* Newstyle handshake OPT_EXPORT_NAME reply message. * Modern clients use NBD_OPT_GO instead of this. */ struct nbd_export_name_option_reply { uint64_t exportsize; /* size of export */ uint16_t eflags; /* per-export flags */ char zeroes[124]; /* optional zeroes, unless NBD_FLAG_NO_ZEROES */ } NBD_ATTRIBUTE_PACKED; /* Fixed newstyle handshake reply message. */ struct nbd_fixed_new_option_reply { uint64_t magic; /* NBD_REP_MAGIC */ uint32_t option; /* option we are replying to */ uint32_t reply; /* NBD_REP_* */ uint32_t replylen; } NBD_ATTRIBUTE_PACKED; #define NBD_REP_MAGIC UINT64_C (0x3e889045565a9) /* Global flags. */ #define NBD_FLAG_FIXED_NEWSTYLE (1U << 0) #define NBD_FLAG_NO_ZEROES (1U << 1) /* Per-export flags. */ #define NBD_FLAG_HAS_FLAGS (1U << 0) #define NBD_FLAG_READ_ONLY (1U << 1) #define NBD_FLAG_SEND_FLUSH (1U << 2) #define NBD_FLAG_SEND_FUA (1U << 3) #define NBD_FLAG_ROTATIONAL (1U << 4) #define NBD_FLAG_SEND_TRIM (1U << 5) #define NBD_FLAG_SEND_WRITE_ZEROES (1U << 6) #define NBD_FLAG_SEND_DF (1U << 7) #define NBD_FLAG_CAN_MULTI_CONN (1U << 8) #define NBD_FLAG_SEND_CACHE (1U << 10) #define NBD_FLAG_SEND_FAST_ZERO (1U << 11) /* NBD options (new style handshake only). */ #define NBD_OPT_EXPORT_NAME 1 #define NBD_OPT_ABORT 2 #define NBD_OPT_LIST 3 #define NBD_OPT_STARTTLS 5 #define NBD_OPT_INFO 6 #define NBD_OPT_GO 7 #define NBD_OPT_STRUCTURED_REPLY 8 #define NBD_OPT_LIST_META_CONTEXT 9 #define NBD_OPT_SET_META_CONTEXT 10 #define NBD_OPT_EXTENDED_HEADERS 11 #define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val) & 0x80000000)) #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 #define NBD_REP_INFO 3 #define NBD_REP_META_CONTEXT 4 #define NBD_REP_ERR_UNSUP NBD_REP_ERR (1) #define NBD_REP_ERR_POLICY NBD_REP_ERR (2) #define NBD_REP_ERR_INVALID NBD_REP_ERR (3) #define NBD_REP_ERR_PLATFORM NBD_REP_ERR (4) #define NBD_REP_ERR_TLS_REQD NBD_REP_ERR (5) #define NBD_REP_ERR_UNKNOWN NBD_REP_ERR (6) #define NBD_REP_ERR_SHUTDOWN NBD_REP_ERR (7) #define NBD_REP_ERR_BLOCK_SIZE_REQD NBD_REP_ERR (8) #define NBD_REP_ERR_TOO_BIG NBD_REP_ERR (9) #define NBD_REP_ERR_EXT_HEADER_REQD NBD_REP_ERR (10) #define NBD_INFO_EXPORT 0 #define NBD_INFO_NAME 1 #define NBD_INFO_DESCRIPTION 2 #define NBD_INFO_BLOCK_SIZE 3 /* NBD_INFO_EXPORT reply (follows fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_info_export { uint16_t info; /* NBD_INFO_EXPORT */ uint64_t exportsize; /* size of export */ uint16_t eflags; /* per-export flags */ } NBD_ATTRIBUTE_PACKED; /* NBD_INFO_NAME or NBD_INFO_DESCRIPTION reply (follows * fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_info_name_or_desc { uint16_t info; /* NBD_INFO_NAME, NBD_INFO_DESCRIPTION */ /* followed by a string name or description */ } NBD_ATTRIBUTE_PACKED; /* NBD_INFO_BLOCK_SIZE reply (follows fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_info_block_size { uint16_t info; /* NBD_INFO_BLOCK_SIZE */ uint32_t minimum; /* minimum block size */ uint32_t preferred; /* preferred block size */ uint32_t maximum; /* maximum block size */ } NBD_ATTRIBUTE_PACKED; /* NBD_REP_SERVER reply (follows fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_server { uint32_t export_name_len; /* length of export name */ /* followed by a string export name and description */ } NBD_ATTRIBUTE_PACKED; /* NBD_REP_META_CONTEXT reply (follows fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_meta_context { uint32_t context_id; /* metadata context ID */ /* followed by a string */ } NBD_ATTRIBUTE_PACKED; /* Compact request (client -> server). */ struct nbd_request { uint32_t magic; /* NBD_REQUEST_MAGIC. */ uint16_t flags; /* Request flags: NBD_CMD_FLAG_*. */ uint16_t type; /* Request type: NBD_CMD_*. */ uint64_t cookie; /* Opaque handle. */ uint64_t offset; /* Request offset. */ uint32_t count; /* Request length. */ } NBD_ATTRIBUTE_PACKED; /* Extended request (client -> server). */ struct nbd_request_ext { uint32_t magic; /* NBD_EXTENDED_REQUEST_MAGIC. */ uint16_t flags; /* Request flags: NBD_CMD_FLAG_*. */ uint16_t type; /* Request type: NBD_CMD_*. */ uint64_t cookie; /* Opaque handle. */ uint64_t offset; /* Request offset. */ uint64_t count; /* Request effect or payload length. */ } NBD_ATTRIBUTE_PACKED; /* Simple reply (server -> client). */ struct nbd_simple_reply { uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC. */ uint32_t error; /* NBD_SUCCESS or one of NBD_E*. */ uint64_t cookie; /* Opaque handle. */ } NBD_ATTRIBUTE_PACKED; /* Structured reply (server -> client). */ struct nbd_structured_reply { uint32_t magic; /* NBD_STRUCTURED_REPLY_MAGIC. */ uint16_t flags; /* NBD_REPLY_FLAG_* */ uint16_t type; /* NBD_REPLY_TYPE_* */ uint64_t cookie; /* Opaque handle. */ uint32_t length; /* Length of following nbd_chunk_* payload. */ } NBD_ATTRIBUTE_PACKED; /* Extended reply (server -> client). */ struct nbd_extended_reply { uint32_t magic; /* NBD_EXTENDED_REPLY_MAGIC. */ uint16_t flags; /* NBD_REPLY_FLAG_* */ uint16_t type; /* NBD_REPLY_TYPE_* */ uint64_t cookie; /* Opaque handle. */ uint64_t offset; /* Client's offset. */ uint64_t length; /* Length of following nbd_chunk_* payload. */ } NBD_ATTRIBUTE_PACKED; struct nbd_chunk_offset_data { uint64_t offset; /* offset */ /* Followed by data. */ } NBD_ATTRIBUTE_PACKED; struct nbd_chunk_offset_hole { uint64_t offset; uint32_t length; /* Length of hole. */ } NBD_ATTRIBUTE_PACKED; struct nbd_chunk_block_status_32 { uint32_t context_id; /* metadata context ID */ /* followed by array of nbd_block_descriptor_32 extents */ } NBD_ATTRIBUTE_PACKED; struct nbd_block_descriptor_32 { uint32_t length; /* length of block */ uint32_t status_flags; /* block type (hole etc) */ } NBD_ATTRIBUTE_PACKED; struct nbd_chunk_block_status_64 { uint32_t context_id; /* metadata context ID */ uint32_t count; /* non-zero descriptor count */ /* followed by nbd_block_descriptor_64[count] extents */ } NBD_ATTRIBUTE_PACKED; struct nbd_block_descriptor_64 { uint64_t length; /* length of block */ uint64_t status_flags; /* block type (hole etc) */ } NBD_ATTRIBUTE_PACKED; struct nbd_chunk_error { uint32_t error; /* NBD_E* error number */ uint16_t len; /* Length of human readable error. */ /* Followed by human readable error string, and possibly more structure. */ } NBD_ATTRIBUTE_PACKED; #define NBD_REQUEST_MAGIC 0x25609513 #define NBD_EXTENDED_REQUEST_MAGIC 0x21e41c71 #define NBD_SIMPLE_REPLY_MAGIC 0x67446698 #define NBD_STRUCTURED_REPLY_MAGIC 0x668e33ef #define NBD_EXTENDED_REPLY_MAGIC 0x6e8a278c /* Structured reply flags. */ #define NBD_REPLY_FLAG_DONE (1U << 0) #define NBD_REPLY_TYPE_ERR(val) ((1U<<15) | (val)) #define NBD_REPLY_TYPE_IS_ERR(val) (!!((val) & (1U<<15))) /* Structured reply types. */ #define NBD_REPLY_TYPE_NONE 0 #define NBD_REPLY_TYPE_OFFSET_DATA 1 #define NBD_REPLY_TYPE_OFFSET_HOLE 2 #define NBD_REPLY_TYPE_BLOCK_STATUS 5 #define NBD_REPLY_TYPE_BLOCK_STATUS_EXT 6 #define NBD_REPLY_TYPE_ERROR NBD_REPLY_TYPE_ERR (1) #define NBD_REPLY_TYPE_ERROR_OFFSET NBD_REPLY_TYPE_ERR (2) /* NBD commands. */ #define NBD_CMD_READ 0 #define NBD_CMD_WRITE 1 #define NBD_CMD_DISC 2 /* Disconnect. */ #define NBD_CMD_FLUSH 3 #define NBD_CMD_TRIM 4 #define NBD_CMD_CACHE 5 #define NBD_CMD_WRITE_ZEROES 6 #define NBD_CMD_BLOCK_STATUS 7 #define NBD_CMD_FLAG_FUA (1U << 0) #define NBD_CMD_FLAG_NO_HOLE (1U << 1) #define NBD_CMD_FLAG_DF (1U << 2) #define NBD_CMD_FLAG_REQ_ONE (1U << 3) #define NBD_CMD_FLAG_FAST_ZERO (1U << 4) #define NBD_CMD_FLAG_PAYLOAD_LEN (1U << 5) /* NBD error codes. */ #define NBD_SUCCESS 0 #define NBD_EPERM 1 #define NBD_EIO 5 #define NBD_ENOMEM 12 #define NBD_EINVAL 22 #define NBD_ENOSPC 28 #define NBD_EOVERFLOW 75 #define NBD_ENOTSUP 95 #define NBD_ESHUTDOWN 108 #endif /* NBD_PROTOCOL_H */ nbdkit-1.42.2/common/protocol/Makefile.in0000644000175000017500000013620114771245446013753 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-protostrings$(EXEEXT) check_PROGRAMS = test-protostrings$(EXEEXT) subdir = common/protocol ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = generate-protostrings.sh CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libprotocol_la_LIBADD = am__objects_1 = am_libprotocol_la_OBJECTS = libprotocol_la-protostrings.lo \ $(am__objects_1) libprotocol_la_OBJECTS = $(am_libprotocol_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libprotocol_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libprotocol_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_test_protostrings_OBJECTS = \ test_protostrings-test-protostrings.$(OBJEXT) \ test_protostrings-protostrings.$(OBJEXT) test_protostrings_OBJECTS = $(am_test_protostrings_OBJECTS) test_protostrings_LDADD = $(LDADD) test_protostrings_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_protostrings_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libprotocol_la-protostrings.Plo \ ./$(DEPDIR)/test_protostrings-protostrings.Po \ ./$(DEPDIR)/test_protostrings-test-protostrings.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libprotocol_la_SOURCES) $(test_protostrings_SOURCES) DIST_SOURCES = $(libprotocol_la_SOURCES) $(test_protostrings_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/generate-protostrings.sh.in \ $(top_srcdir)/common-rules.mk $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll protostrings.c EXTRA_DIST = \ nbd-protocol.h \ protostrings.c \ $(NULL) include_HEADERS = nbd-protocol.h noinst_LTLIBRARIES = libprotocol.la libprotocol_la_SOURCES = \ protostrings.c \ protostrings.h \ nbd-protocol.h \ $(NULL) libprotocol_la_CFLAGS = $(WARNINGS_CFLAGS) # protostrings.c is generated from the nbd-protocol.h header file # where it is used to map NBD protocol flags to strings. BUILT_SOURCES = protostrings.c test_protostrings_SOURCES = test-protostrings.c protostrings.c protostrings.h test_protostrings_CFLAGS = $(WARNINGS_CFLAGS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/protocol/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/protocol/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): generate-protostrings.sh: $(top_builddir)/config.status $(srcdir)/generate-protostrings.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libprotocol.la: $(libprotocol_la_OBJECTS) $(libprotocol_la_DEPENDENCIES) $(EXTRA_libprotocol_la_DEPENDENCIES) $(AM_V_CCLD)$(libprotocol_la_LINK) $(libprotocol_la_OBJECTS) $(libprotocol_la_LIBADD) $(LIBS) test-protostrings$(EXEEXT): $(test_protostrings_OBJECTS) $(test_protostrings_DEPENDENCIES) $(EXTRA_test_protostrings_DEPENDENCIES) @rm -f test-protostrings$(EXEEXT) $(AM_V_CCLD)$(test_protostrings_LINK) $(test_protostrings_OBJECTS) $(test_protostrings_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libprotocol_la-protostrings.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_protostrings-protostrings.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_protostrings-test-protostrings.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libprotocol_la-protostrings.lo: protostrings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libprotocol_la_CFLAGS) $(CFLAGS) -MT libprotocol_la-protostrings.lo -MD -MP -MF $(DEPDIR)/libprotocol_la-protostrings.Tpo -c -o libprotocol_la-protostrings.lo `test -f 'protostrings.c' || echo '$(srcdir)/'`protostrings.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libprotocol_la-protostrings.Tpo $(DEPDIR)/libprotocol_la-protostrings.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protostrings.c' object='libprotocol_la-protostrings.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libprotocol_la_CFLAGS) $(CFLAGS) -c -o libprotocol_la-protostrings.lo `test -f 'protostrings.c' || echo '$(srcdir)/'`protostrings.c test_protostrings-test-protostrings.o: test-protostrings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -MT test_protostrings-test-protostrings.o -MD -MP -MF $(DEPDIR)/test_protostrings-test-protostrings.Tpo -c -o test_protostrings-test-protostrings.o `test -f 'test-protostrings.c' || echo '$(srcdir)/'`test-protostrings.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_protostrings-test-protostrings.Tpo $(DEPDIR)/test_protostrings-test-protostrings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-protostrings.c' object='test_protostrings-test-protostrings.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -c -o test_protostrings-test-protostrings.o `test -f 'test-protostrings.c' || echo '$(srcdir)/'`test-protostrings.c test_protostrings-test-protostrings.obj: test-protostrings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -MT test_protostrings-test-protostrings.obj -MD -MP -MF $(DEPDIR)/test_protostrings-test-protostrings.Tpo -c -o test_protostrings-test-protostrings.obj `if test -f 'test-protostrings.c'; then $(CYGPATH_W) 'test-protostrings.c'; else $(CYGPATH_W) '$(srcdir)/test-protostrings.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_protostrings-test-protostrings.Tpo $(DEPDIR)/test_protostrings-test-protostrings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-protostrings.c' object='test_protostrings-test-protostrings.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -c -o test_protostrings-test-protostrings.obj `if test -f 'test-protostrings.c'; then $(CYGPATH_W) 'test-protostrings.c'; else $(CYGPATH_W) '$(srcdir)/test-protostrings.c'; fi` test_protostrings-protostrings.o: protostrings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -MT test_protostrings-protostrings.o -MD -MP -MF $(DEPDIR)/test_protostrings-protostrings.Tpo -c -o test_protostrings-protostrings.o `test -f 'protostrings.c' || echo '$(srcdir)/'`protostrings.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_protostrings-protostrings.Tpo $(DEPDIR)/test_protostrings-protostrings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protostrings.c' object='test_protostrings-protostrings.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -c -o test_protostrings-protostrings.o `test -f 'protostrings.c' || echo '$(srcdir)/'`protostrings.c test_protostrings-protostrings.obj: protostrings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -MT test_protostrings-protostrings.obj -MD -MP -MF $(DEPDIR)/test_protostrings-protostrings.Tpo -c -o test_protostrings-protostrings.obj `if test -f 'protostrings.c'; then $(CYGPATH_W) 'protostrings.c'; else $(CYGPATH_W) '$(srcdir)/protostrings.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_protostrings-protostrings.Tpo $(DEPDIR)/test_protostrings-protostrings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protostrings.c' object='test_protostrings-protostrings.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_protostrings_CFLAGS) $(CFLAGS) -c -o test_protostrings-protostrings.obj `if test -f 'protostrings.c'; then $(CYGPATH_W) 'protostrings.c'; else $(CYGPATH_W) '$(srcdir)/protostrings.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-protostrings.log: test-protostrings$(EXEEXT) @p='test-protostrings$(EXEEXT)'; \ b='test-protostrings'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libprotocol_la-protostrings.Plo -rm -f ./$(DEPDIR)/test_protostrings-protostrings.Po -rm -f ./$(DEPDIR)/test_protostrings-test-protostrings.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libprotocol_la-protostrings.Plo -rm -f ./$(DEPDIR)/test_protostrings-protostrings.Po -rm -f ./$(DEPDIR)/test_protostrings-test-protostrings.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: all check check-am install install-am install-exec \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile protostrings.c: nbd-protocol.h generate-protostrings.sh Makefile rm -f $@ $@-t $(builddir)/generate-protostrings.sh > $@-t mv $@-t $@ chmod 0444 $@ # 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: nbdkit-1.42.2/common/protocol/generate-protostrings.sh.in0000755000175000017500000000530314771245331017206 #!/usr/bin/env bash # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. set -e # The header. cat <<'EOF' /* Generated from nbd-protocol.h by generate-protostrings.sh. * License of this file is BSD, the same as the rest of nbdkit. */ #include #include "nbd-protocol.h" EOF declare -A functions=( [global_flag]=NBD_FLAG_FIXED_NEWSTYLE [flag]=NBD_FLAG_HAS_FLAGS [opt]=NBD_OPT_EXPORT_NAME [rep]=NBD_REP_ACK [info]=NBD_INFO_EXPORT [reply]=NBD_REPLY_FLAG_DONE [reply_type]=NBD_REPLY_TYPE_NONE [cmd]=NBD_CMD_READ [cmd_flag]=NBD_CMD_FLAG_FUA [error]=NBD_SUCCESS ) # Generate each 'const char *name_of_nbd_' keys=$( printf '%s\n' ${!functions[@]} | sort ) for fn in $keys; do echo 'extern const char *' echo "name_of_nbd_$fn (unsigned int fl)" echo '{' echo ' static __thread char buf[] = "unknown (0x00000000)";' echo ' switch (fl) {' # We look for the first #define and rewrite every # line up to the next blank line. symbol="${functions[$fn]}" @SED@ -n "/^#define $symbol/,/^$/p" @srcdir@/nbd-protocol.h | @SED@ 's/^#define \([_A-Z]*\).*/ case \1:\ return "\1\";/' echo ' default:' echo ' snprintf (buf, sizeof buf, "unknown (0x%x)", fl);' echo ' return buf;' echo ' }' echo '}' echo done nbdkit-1.42.2/common/protocol/protostrings.c0000444000175000017500000001501114771245504014613 /* Generated from nbd-protocol.h by generate-protostrings.sh. * License of this file is BSD, the same as the rest of nbdkit. */ #include #include "nbd-protocol.h" extern const char * name_of_nbd_cmd (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_CMD_READ: return "NBD_CMD_READ"; case NBD_CMD_WRITE: return "NBD_CMD_WRITE"; case NBD_CMD_DISC: return "NBD_CMD_DISC"; case NBD_CMD_FLUSH: return "NBD_CMD_FLUSH"; case NBD_CMD_TRIM: return "NBD_CMD_TRIM"; case NBD_CMD_CACHE: return "NBD_CMD_CACHE"; case NBD_CMD_WRITE_ZEROES: return "NBD_CMD_WRITE_ZEROES"; case NBD_CMD_BLOCK_STATUS: return "NBD_CMD_BLOCK_STATUS"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_cmd_flag (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_CMD_FLAG_FUA: return "NBD_CMD_FLAG_FUA"; case NBD_CMD_FLAG_NO_HOLE: return "NBD_CMD_FLAG_NO_HOLE"; case NBD_CMD_FLAG_DF: return "NBD_CMD_FLAG_DF"; case NBD_CMD_FLAG_REQ_ONE: return "NBD_CMD_FLAG_REQ_ONE"; case NBD_CMD_FLAG_FAST_ZERO: return "NBD_CMD_FLAG_FAST_ZERO"; case NBD_CMD_FLAG_PAYLOAD_LEN: return "NBD_CMD_FLAG_PAYLOAD_LEN"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_error (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_SUCCESS: return "NBD_SUCCESS"; case NBD_EPERM: return "NBD_EPERM"; case NBD_EIO: return "NBD_EIO"; case NBD_ENOMEM: return "NBD_ENOMEM"; case NBD_EINVAL: return "NBD_EINVAL"; case NBD_ENOSPC: return "NBD_ENOSPC"; case NBD_EOVERFLOW: return "NBD_EOVERFLOW"; case NBD_ENOTSUP: return "NBD_ENOTSUP"; case NBD_ESHUTDOWN: return "NBD_ESHUTDOWN"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_flag (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_FLAG_HAS_FLAGS: return "NBD_FLAG_HAS_FLAGS"; case NBD_FLAG_READ_ONLY: return "NBD_FLAG_READ_ONLY"; case NBD_FLAG_SEND_FLUSH: return "NBD_FLAG_SEND_FLUSH"; case NBD_FLAG_SEND_FUA: return "NBD_FLAG_SEND_FUA"; case NBD_FLAG_ROTATIONAL: return "NBD_FLAG_ROTATIONAL"; case NBD_FLAG_SEND_TRIM: return "NBD_FLAG_SEND_TRIM"; case NBD_FLAG_SEND_WRITE_ZEROES: return "NBD_FLAG_SEND_WRITE_ZEROES"; case NBD_FLAG_SEND_DF: return "NBD_FLAG_SEND_DF"; case NBD_FLAG_CAN_MULTI_CONN: return "NBD_FLAG_CAN_MULTI_CONN"; case NBD_FLAG_SEND_CACHE: return "NBD_FLAG_SEND_CACHE"; case NBD_FLAG_SEND_FAST_ZERO: return "NBD_FLAG_SEND_FAST_ZERO"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_global_flag (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_FLAG_FIXED_NEWSTYLE: return "NBD_FLAG_FIXED_NEWSTYLE"; case NBD_FLAG_NO_ZEROES: return "NBD_FLAG_NO_ZEROES"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_info (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_INFO_EXPORT: return "NBD_INFO_EXPORT"; case NBD_INFO_NAME: return "NBD_INFO_NAME"; case NBD_INFO_DESCRIPTION: return "NBD_INFO_DESCRIPTION"; case NBD_INFO_BLOCK_SIZE: return "NBD_INFO_BLOCK_SIZE"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_opt (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_OPT_EXPORT_NAME: return "NBD_OPT_EXPORT_NAME"; case NBD_OPT_ABORT: return "NBD_OPT_ABORT"; case NBD_OPT_LIST: return "NBD_OPT_LIST"; case NBD_OPT_STARTTLS: return "NBD_OPT_STARTTLS"; case NBD_OPT_INFO: return "NBD_OPT_INFO"; case NBD_OPT_GO: return "NBD_OPT_GO"; case NBD_OPT_STRUCTURED_REPLY: return "NBD_OPT_STRUCTURED_REPLY"; case NBD_OPT_LIST_META_CONTEXT: return "NBD_OPT_LIST_META_CONTEXT"; case NBD_OPT_SET_META_CONTEXT: return "NBD_OPT_SET_META_CONTEXT"; case NBD_OPT_EXTENDED_HEADERS: return "NBD_OPT_EXTENDED_HEADERS"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_rep (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_REP_ACK: return "NBD_REP_ACK"; case NBD_REP_SERVER: return "NBD_REP_SERVER"; case NBD_REP_INFO: return "NBD_REP_INFO"; case NBD_REP_META_CONTEXT: return "NBD_REP_META_CONTEXT"; case NBD_REP_ERR_UNSUP: return "NBD_REP_ERR_UNSUP"; case NBD_REP_ERR_POLICY: return "NBD_REP_ERR_POLICY"; case NBD_REP_ERR_INVALID: return "NBD_REP_ERR_INVALID"; case NBD_REP_ERR_PLATFORM: return "NBD_REP_ERR_PLATFORM"; case NBD_REP_ERR_TLS_REQD: return "NBD_REP_ERR_TLS_REQD"; case NBD_REP_ERR_UNKNOWN: return "NBD_REP_ERR_UNKNOWN"; case NBD_REP_ERR_SHUTDOWN: return "NBD_REP_ERR_SHUTDOWN"; case NBD_REP_ERR_BLOCK_SIZE_REQD: return "NBD_REP_ERR_BLOCK_SIZE_REQD"; case NBD_REP_ERR_TOO_BIG: return "NBD_REP_ERR_TOO_BIG"; case NBD_REP_ERR_EXT_HEADER_REQD: return "NBD_REP_ERR_EXT_HEADER_REQD"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_reply (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_REPLY_FLAG_DONE: return "NBD_REPLY_FLAG_DONE"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } extern const char * name_of_nbd_reply_type (unsigned int fl) { static __thread char buf[] = "unknown (0x00000000)"; switch (fl) { case NBD_REPLY_TYPE_NONE: return "NBD_REPLY_TYPE_NONE"; case NBD_REPLY_TYPE_OFFSET_DATA: return "NBD_REPLY_TYPE_OFFSET_DATA"; case NBD_REPLY_TYPE_OFFSET_HOLE: return "NBD_REPLY_TYPE_OFFSET_HOLE"; case NBD_REPLY_TYPE_BLOCK_STATUS: return "NBD_REPLY_TYPE_BLOCK_STATUS"; case NBD_REPLY_TYPE_BLOCK_STATUS_EXT: return "NBD_REPLY_TYPE_BLOCK_STATUS_EXT"; case NBD_REPLY_TYPE_ERROR: return "NBD_REPLY_TYPE_ERROR"; case NBD_REPLY_TYPE_ERROR_OFFSET: return "NBD_REPLY_TYPE_ERROR_OFFSET"; default: snprintf (buf, sizeof buf, "unknown (0x%x)", fl); return buf; } } nbdkit-1.42.2/common/protocol/protostrings.h0000644000175000017500000000431614771245321014625 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_PROTOSTRINGS_H #define NBDKIT_PROTOSTRINGS_H /* The corresponding functions are generated by * generate-protostrings.sh from the nbd-protocol.h header file. */ extern const char *name_of_nbd_global_flag (unsigned int); extern const char *name_of_nbd_flag (unsigned int); extern const char *name_of_nbd_opt (unsigned int); extern const char *name_of_nbd_rep (unsigned int); extern const char *name_of_nbd_info (unsigned int); extern const char *name_of_nbd_reply (unsigned int); extern const char *name_of_nbd_reply_type (unsigned int); extern const char *name_of_nbd_cmd (unsigned int); extern const char *name_of_nbd_cmd_flag (unsigned int); extern const char *name_of_nbd_error (unsigned int); #endif /* NBDKIT_PROTOSTRINGS_H */ nbdkit-1.42.2/common/protocol/test-protostrings.c0000644000175000017500000000576114771245341015604 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Unit tests of protocol strings. */ #include #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "nbd-protocol.h" #include "protostrings.h" #define TEST_GOOD(fn, val) \ { \ const char *actual = fn (val); \ printf ("%d: %u -> %s\n", __LINE__, val, actual); \ assert (strcmp (actual, #val) == 0); \ } #define TEST_UNKNOWN(fn, val, expected) \ { \ const char *actual = fn (val); \ printf ("%d: %u -> %s\n", __LINE__, val, actual); \ assert (strcmp (actual, expected) == 0); \ } int main (void) { TEST_GOOD (name_of_nbd_cmd, NBD_CMD_READ); TEST_GOOD (name_of_nbd_cmd, NBD_CMD_DISC); TEST_UNKNOWN (name_of_nbd_cmd, 0x100, "unknown (0x100)"); TEST_GOOD (name_of_nbd_cmd_flag, NBD_CMD_FLAG_FUA); TEST_UNKNOWN (name_of_nbd_cmd_flag, 0xffffff, "unknown (0xffffff)"); TEST_GOOD (name_of_nbd_flag, NBD_FLAG_SEND_DF); TEST_GOOD (name_of_nbd_global_flag, NBD_FLAG_FIXED_NEWSTYLE); TEST_GOOD (name_of_nbd_info, NBD_INFO_EXPORT); TEST_GOOD (name_of_nbd_opt, NBD_OPT_ABORT); TEST_GOOD (name_of_nbd_rep, NBD_REP_INFO); TEST_GOOD (name_of_nbd_reply, NBD_REPLY_FLAG_DONE); TEST_GOOD (name_of_nbd_reply_type, NBD_REPLY_TYPE_ERROR); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/replacements/0000755000175000017500000000000014771247240012576 5nbdkit-1.42.2/common/replacements/Makefile.am0000644000175000017500000000464714534316443014564 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk SUBDIRS = win32 AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common/include \ -I$(top_builddir)/include \ $(NULL) noinst_LTLIBRARIES = libcompat.la # sources should be empty libcompat_la_SOURCES = libcompat_la_LIBADD = $(LTLIBOBJS) EXTRA_DIST = \ fdatasync.c \ fdatasync.h \ fsync.c \ fsync.h \ get_current_dir_name.c \ get_current_dir_name.h \ getdelim.c \ getline.c \ getline.h \ openlog.c \ open_memstream.c \ open_memstream.h \ poll.c \ poll.h \ posix_memalign.c \ posix_memalign.h \ pread.c \ pread.h \ pwrite.c \ pwrite.h \ realpath.c \ realpath.h \ strndup.c \ strndup.h \ sysconf.c \ sysconf.h \ syslog.c \ syslog.h \ vsyslog.c TESTS = \ test-current-dir-name check_PROGRAMS = $(TESTS) test_current_dir_name_SOURCES = \ test-current-dir-name.c \ get_current_dir_name.c \ get_current_dir_name.h \ $(NULL) test_current_dir_name_CPPFLAGS = -I$(srcdir) test_current_dir_name_CFLAGS = $(WARNINGS_CFLAGS) nbdkit-1.42.2/common/replacements/Makefile.in0000644000175000017500000015041514771245446014577 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-current-dir-name$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) subdir = common/replacements ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test-current-dir-name$(EXEEXT) LTLIBRARIES = $(noinst_LTLIBRARIES) libcompat_la_DEPENDENCIES = $(LTLIBOBJS) am_libcompat_la_OBJECTS = libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__objects_1 = am_test_current_dir_name_OBJECTS = \ test_current_dir_name-test-current-dir-name.$(OBJEXT) \ test_current_dir_name-get_current_dir_name.$(OBJEXT) \ $(am__objects_1) test_current_dir_name_OBJECTS = $(am_test_current_dir_name_OBJECTS) test_current_dir_name_LDADD = $(LDADD) test_current_dir_name_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_current_dir_name_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(DEPDIR)/fdatasync.Plo $(DEPDIR)/fsync.Plo \ $(DEPDIR)/get_current_dir_name.Plo $(DEPDIR)/getdelim.Plo \ $(DEPDIR)/getline.Plo $(DEPDIR)/open_memstream.Plo \ $(DEPDIR)/openlog.Plo $(DEPDIR)/poll.Plo \ $(DEPDIR)/posix_memalign.Plo $(DEPDIR)/pread.Plo \ $(DEPDIR)/pwrite.Plo $(DEPDIR)/realpath.Plo \ $(DEPDIR)/strndup.Plo $(DEPDIR)/sysconf.Plo \ $(DEPDIR)/syslog.Plo $(DEPDIR)/vsyslog.Plo \ ./$(DEPDIR)/test_current_dir_name-get_current_dir_name.Po \ ./$(DEPDIR)/test_current_dir_name-test-current-dir-name.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcompat_la_SOURCES) $(test_current_dir_name_SOURCES) DIST_SOURCES = $(libcompat_la_SOURCES) \ $(test_current_dir_name_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver fdatasync.c \ fsync.c get_current_dir_name.c getdelim.c getline.c \ open_memstream.c openlog.c poll.c posix_memalign.c pread.c \ pwrite.c realpath.c strndup.c sysconf.c syslog.c vsyslog.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll SUBDIRS = win32 AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common/include \ -I$(top_builddir)/include \ $(NULL) noinst_LTLIBRARIES = libcompat.la # sources should be empty libcompat_la_SOURCES = libcompat_la_LIBADD = $(LTLIBOBJS) EXTRA_DIST = \ fdatasync.c \ fdatasync.h \ fsync.c \ fsync.h \ get_current_dir_name.c \ get_current_dir_name.h \ getdelim.c \ getline.c \ getline.h \ openlog.c \ open_memstream.c \ open_memstream.h \ poll.c \ poll.h \ posix_memalign.c \ posix_memalign.h \ pread.c \ pread.h \ pwrite.c \ pwrite.h \ realpath.c \ realpath.h \ strndup.c \ strndup.h \ sysconf.c \ sysconf.h \ syslog.c \ syslog.h \ vsyslog.c test_current_dir_name_SOURCES = \ test-current-dir-name.c \ get_current_dir_name.c \ get_current_dir_name.h \ $(NULL) test_current_dir_name_CPPFLAGS = -I$(srcdir) test_current_dir_name_CFLAGS = $(WARNINGS_CFLAGS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/replacements/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/replacements/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcompat.la: $(libcompat_la_OBJECTS) $(libcompat_la_DEPENDENCIES) $(EXTRA_libcompat_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libcompat_la_OBJECTS) $(libcompat_la_LIBADD) $(LIBS) test-current-dir-name$(EXEEXT): $(test_current_dir_name_OBJECTS) $(test_current_dir_name_DEPENDENCIES) $(EXTRA_test_current_dir_name_DEPENDENCIES) @rm -f test-current-dir-name$(EXEEXT) $(AM_V_CCLD)$(test_current_dir_name_LINK) $(test_current_dir_name_OBJECTS) $(test_current_dir_name_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fdatasync.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fsync.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/get_current_dir_name.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getdelim.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getline.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/open_memstream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/openlog.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/poll.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/posix_memalign.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pwrite.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realpath.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/sysconf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/syslog.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vsyslog.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_current_dir_name-get_current_dir_name.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_current_dir_name-test-current-dir-name.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_current_dir_name-test-current-dir-name.o: test-current-dir-name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -MT test_current_dir_name-test-current-dir-name.o -MD -MP -MF $(DEPDIR)/test_current_dir_name-test-current-dir-name.Tpo -c -o test_current_dir_name-test-current-dir-name.o `test -f 'test-current-dir-name.c' || echo '$(srcdir)/'`test-current-dir-name.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_current_dir_name-test-current-dir-name.Tpo $(DEPDIR)/test_current_dir_name-test-current-dir-name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-current-dir-name.c' object='test_current_dir_name-test-current-dir-name.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -c -o test_current_dir_name-test-current-dir-name.o `test -f 'test-current-dir-name.c' || echo '$(srcdir)/'`test-current-dir-name.c test_current_dir_name-test-current-dir-name.obj: test-current-dir-name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -MT test_current_dir_name-test-current-dir-name.obj -MD -MP -MF $(DEPDIR)/test_current_dir_name-test-current-dir-name.Tpo -c -o test_current_dir_name-test-current-dir-name.obj `if test -f 'test-current-dir-name.c'; then $(CYGPATH_W) 'test-current-dir-name.c'; else $(CYGPATH_W) '$(srcdir)/test-current-dir-name.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_current_dir_name-test-current-dir-name.Tpo $(DEPDIR)/test_current_dir_name-test-current-dir-name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-current-dir-name.c' object='test_current_dir_name-test-current-dir-name.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -c -o test_current_dir_name-test-current-dir-name.obj `if test -f 'test-current-dir-name.c'; then $(CYGPATH_W) 'test-current-dir-name.c'; else $(CYGPATH_W) '$(srcdir)/test-current-dir-name.c'; fi` test_current_dir_name-get_current_dir_name.o: get_current_dir_name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -MT test_current_dir_name-get_current_dir_name.o -MD -MP -MF $(DEPDIR)/test_current_dir_name-get_current_dir_name.Tpo -c -o test_current_dir_name-get_current_dir_name.o `test -f 'get_current_dir_name.c' || echo '$(srcdir)/'`get_current_dir_name.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_current_dir_name-get_current_dir_name.Tpo $(DEPDIR)/test_current_dir_name-get_current_dir_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_current_dir_name.c' object='test_current_dir_name-get_current_dir_name.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -c -o test_current_dir_name-get_current_dir_name.o `test -f 'get_current_dir_name.c' || echo '$(srcdir)/'`get_current_dir_name.c test_current_dir_name-get_current_dir_name.obj: get_current_dir_name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -MT test_current_dir_name-get_current_dir_name.obj -MD -MP -MF $(DEPDIR)/test_current_dir_name-get_current_dir_name.Tpo -c -o test_current_dir_name-get_current_dir_name.obj `if test -f 'get_current_dir_name.c'; then $(CYGPATH_W) 'get_current_dir_name.c'; else $(CYGPATH_W) '$(srcdir)/get_current_dir_name.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_current_dir_name-get_current_dir_name.Tpo $(DEPDIR)/test_current_dir_name-get_current_dir_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_current_dir_name.c' object='test_current_dir_name-get_current_dir_name.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_current_dir_name_CPPFLAGS) $(CPPFLAGS) $(test_current_dir_name_CFLAGS) $(CFLAGS) -c -o test_current_dir_name-get_current_dir_name.obj `if test -f 'get_current_dir_name.c'; then $(CYGPATH_W) 'get_current_dir_name.c'; else $(CYGPATH_W) '$(srcdir)/get_current_dir_name.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-current-dir-name.log: test-current-dir-name$(EXEEXT) @p='test-current-dir-name$(EXEEXT)'; \ b='test-current-dir-name'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -f $(DEPDIR)/fdatasync.Plo -rm -f $(DEPDIR)/fsync.Plo -rm -f $(DEPDIR)/get_current_dir_name.Plo -rm -f $(DEPDIR)/getdelim.Plo -rm -f $(DEPDIR)/getline.Plo -rm -f $(DEPDIR)/open_memstream.Plo -rm -f $(DEPDIR)/openlog.Plo -rm -f $(DEPDIR)/poll.Plo -rm -f $(DEPDIR)/posix_memalign.Plo -rm -f $(DEPDIR)/pread.Plo -rm -f $(DEPDIR)/pwrite.Plo -rm -f $(DEPDIR)/realpath.Plo -rm -f $(DEPDIR)/strndup.Plo -rm -f $(DEPDIR)/sysconf.Plo -rm -f $(DEPDIR)/syslog.Plo -rm -f $(DEPDIR)/vsyslog.Plo -rm -f ./$(DEPDIR)/test_current_dir_name-get_current_dir_name.Po -rm -f ./$(DEPDIR)/test_current_dir_name-test-current-dir-name.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(DEPDIR)/fdatasync.Plo -rm -f $(DEPDIR)/fsync.Plo -rm -f $(DEPDIR)/get_current_dir_name.Plo -rm -f $(DEPDIR)/getdelim.Plo -rm -f $(DEPDIR)/getline.Plo -rm -f $(DEPDIR)/open_memstream.Plo -rm -f $(DEPDIR)/openlog.Plo -rm -f $(DEPDIR)/poll.Plo -rm -f $(DEPDIR)/posix_memalign.Plo -rm -f $(DEPDIR)/pread.Plo -rm -f $(DEPDIR)/pwrite.Plo -rm -f $(DEPDIR)/realpath.Plo -rm -f $(DEPDIR)/strndup.Plo -rm -f $(DEPDIR)/sysconf.Plo -rm -f $(DEPDIR)/syslog.Plo -rm -f $(DEPDIR)/vsyslog.Plo -rm -f ./$(DEPDIR)/test_current_dir_name-get_current_dir_name.Po -rm -f ./$(DEPDIR)/test_current_dir_name-test-current-dir-name.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/replacements/fdatasync.c0000644000175000017500000000336614534316443014645 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for fdatasync for platforms which lack this function. */ #include #include #include #ifndef HAVE_FDATASYNC #include "fsync.h" #include "fdatasync.h" int fdatasync (int fd) { return fsync (fd); } #endif /* !HAVE_FDATASYNC */ nbdkit-1.42.2/common/replacements/fsync.c0000644000175000017500000000427414534316443014012 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for fsync for platforms which lack this function. */ #include #include #include #include #ifndef HAVE_FSYNC #include "fsync.h" #ifdef WIN32 /* Replacement fsync for Win32. */ #include "nbdkit-plugin.h" #include int fsync (int fd) { HANDLE h; h = (HANDLE) _get_osfhandle (fd); if (h == INVALID_HANDLE_VALUE) { nbdkit_debug ("ReadFile: bad handle"); errno = EIO; return -1; } if (!FlushFileBuffers (h)) { nbdkit_debug ("FlushFileBuffers: error %d", GetLastError ()); errno = EIO; return -1; } return 0; } #else /* !WIN32 */ #error "no replacement fsync is available on this platform" #endif #endif /* !HAVE_FSYNC */ nbdkit-1.42.2/common/replacements/get_current_dir_name.c0000644000175000017500000000374114534316443017045 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Implement get_current_dir_name(3) on platforms which don't have it. */ #include #ifndef HAVE_GET_CURRENT_DIR_NAME #include #include #include #include #include "get_current_dir_name.h" char * get_current_dir_name (void) { char *ret; ret = malloc (PATH_MAX); if (ret == NULL) return NULL; ret = getcwd (ret, PATH_MAX); if (ret == NULL) return NULL; return realloc (ret, strlen (ret) + 1); } #endif /* !HAVE_GET_CURRENT_DIR_NAME */ nbdkit-1.42.2/common/replacements/getdelim.c0000644000175000017500000000506114534316443014455 /* $NetBSD: getdelim.c,v 1.2 2015/12/25 20:12:46 joerg Exp $ */ /* NetBSD-src: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 #include #ifndef HAVE_GETDELIM #include "getline.h" ssize_t getdelim (char **buf, size_t *bufsiz, int delimiter, FILE *fp) { char *ptr, *eptr; if (*buf == NULL || *bufsiz == 0) { *bufsiz = BUFSIZ; if ((*buf = malloc (*bufsiz)) == NULL) return -1; } for (ptr = *buf, eptr = *buf + *bufsiz;;) { int c = fgetc (fp); if (c == -1) { if (feof (fp)) { ssize_t diff = (ssize_t)(ptr - *buf); if (diff != 0) { *ptr = '\0'; return diff; } } return -1; } *ptr++ = c; if (c == delimiter) { *ptr = '\0'; return ptr - *buf; } if (ptr + 2 >= eptr) { char *nbuf; size_t nbufsiz = *bufsiz * 2; ssize_t d = ptr - *buf; if ((nbuf = realloc (*buf, nbufsiz)) == NULL) return -1; *buf = nbuf; *bufsiz = nbufsiz; eptr = nbuf + nbufsiz; ptr = nbuf + d; } } } #endif nbdkit-1.42.2/common/replacements/getline.c0000644000175000017500000000343114534316443014311 /* $NetBSD: getline.c,v 1.2 2015/12/25 20:12:46 joerg Exp $ */ /* NetBSD-src: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 #ifndef HAVE_GETLINE #include "getline.h" ssize_t getline (char **buf, size_t *bufsiz, FILE *fp) { return getdelim (buf, bufsiz, '\n', fp); } #endif nbdkit-1.42.2/common/replacements/open_memstream.c0000644000175000017500000000761314534316443015703 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for open_memstream for platforms which lack this function. */ #include #include #include "open_memstream.h" #ifndef HAVE_OPEN_MEMSTREAM #ifdef WIN32 /* Replacement open_memstream for Win32. */ #include #include /* This is provided by common/utils which hasn't been compiled yet. * Programs using this replacement will need to link to * libutils.la. XXX */ #include "../utils/vector.h" #include "../utils/nbdkit-string.h" /* Map FILE* that we return to the user buffer. */ struct file_to_memstream { FILE *fp; char tmpname[MAX_PATH]; char **ptr; size_t *size; }; DEFINE_VECTOR_TYPE (file_vector, struct file_to_memstream); static file_vector files = empty_vector; FILE * open_memstream (char **ptr, size_t *size) { struct file_to_memstream f2m; char tmppath[MAX_PATH]; DWORD ret; FILE *fp; ret = GetTempPath (MAX_PATH, tmppath); if (ret > MAX_PATH || ret == 0) return NULL; ret = GetTempFileName (tmppath, TEXT ("nbdkit"), 0, f2m.tmpname); if (!ret) return NULL; fp = fopen (f2m.tmpname, "w+"); if (fp == NULL) return NULL; f2m.fp = fp; f2m.ptr = ptr; f2m.size = size; if (file_vector_append (&files, f2m) == -1) { fclose (fp); return NULL; } return fp; } int close_memstream (FILE *fp) { size_t i; int c, r; string content = empty_vector; struct file_to_memstream *f2m; for (i = 0; i < files.len; ++i) { if (files.ptr[i].fp == fp) break; } assert (i < files.len); f2m = &files.ptr[i]; /* Read the file back into memory. */ rewind (fp); while ((c = getc (fp)) != EOF) { if (string_append (&content, c) == -1) { append_failed: fclose (fp); unlink (f2m->tmpname); free (content.ptr); file_vector_remove (&files, i); return -1; } } /* Make sure the buffer is \0-terminated but don't include this * in the buffer size returned below. */ if (string_append (&content, 0) == -1) goto append_failed; r = fclose (fp); unlink (f2m->tmpname); if (r == EOF) { free (content.ptr); file_vector_remove (&files, i); return -1; } /* Pass the buffer to the user. User will free it. */ *(files.ptr[i].ptr) = content.ptr; *(files.ptr[i].size) = content.len - 1; file_vector_remove (&files, i); return 0; } #else /* !WIN32 */ #error "no replacement open_memstream is available on this platform" #endif #endif /* !HAVE_OPEN_MEMSTREAM */ nbdkit-1.42.2/common/replacements/openlog.c0000644000175000017500000000367514534316443014337 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #ifndef HAVE_OPENLOG_H #include "syslog.h" #ifdef WIN32 /* Replacement openlog for Win32. */ #include HANDLE event_source = INVALID_HANDLE_VALUE; void openlog (const char *ident, int option, int facility) { event_source = RegisterEventSource (NULL, ident); } #else /* !WIN32 */ #error "no replacement openlog is available on this platform" #endif #endif /* !HAVE_SYSLOG_H */ nbdkit-1.42.2/common/replacements/poll.c0000644000175000017500000000673614534316443013643 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for poll for platforms which lack this function. */ #include #include #include #ifndef HAVE_POLL #include "poll.h" #ifdef WIN32 #include #include #include #include /* This is provided by common/utils which hasn't been compiled yet. * Programs using the poll replacement will need to link to * libutils.la. XXX */ extern int translate_winsock_error (const char *fn, int err); /* Windows doesn't have poll. It has something called WSAPoll in * Winsock, but even Microsoft admit it is broken. Gnulib contains an * elaborate emulation of poll written by Paolo Bonzini, but it's * distributed under an incompatible license. However Winsock has * select so we can write a simple (but slow) emulation of poll using * select. */ int poll (struct pollfd *fds, int n, int timeout) { int i, r; fd_set readfds, writefds; struct timeval tv, *tvp; /* https://docs.microsoft.com/en-us/windows/win32/winsock/maximum-number-of-sockets-supported-2 */ if (n >= 64) { errno = EINVAL; return -1; } FD_ZERO (&readfds); FD_ZERO (&writefds); for (i = 0; i < n; ++i) { if (fds[i].events & POLLIN) FD_SET (fds[i].fd, &readfds); if (fds[i].events & POLLOUT) FD_SET (fds[i].fd, &writefds); fds[i].revents = 0; } if (timeout >= 0) { tv.tv_sec = timeout / 1000; tv.tv_usec = timeout % 1000; tvp = &tv; } else tvp = NULL; /* Windows ignores the nfds parameter of select. */ r = select (0, &readfds, &writefds, NULL, tvp); if (r == -1) { errno = translate_winsock_error ("select", WSAGetLastError ()); return -1; } r = 0; for (i = 0; i < n; ++i) { if (FD_ISSET (fds[i].fd, &readfds)) fds[i].revents |= POLLIN; if (FD_ISSET (fds[i].fd, &writefds)) fds[i].revents |= POLLOUT; if (fds[i].revents != 0) r++; } return r; } #else /* !WIN32 */ #error "no replacement poll is available on this platform" #endif #endif /* !HAVE_POLL */ nbdkit-1.42.2/common/replacements/posix_memalign.c0000644000175000017500000000425514534316443015702 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #ifndef HAVE_POSIX_MEMALIGN #include "posix_memalign.h" #ifdef HAVE_VALLOC int posix_memalign (void **ptr, size_t alignment, size_t size) { *ptr = valloc (size); if (*ptr == NULL) return errno; return 0; } #else /* !HAVE_VALLOC */ #ifdef WIN32 #include int posix_memalign (void **ptr, size_t alignment, size_t size) { *ptr = VirtualAlloc (NULL, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); if (*ptr == NULL) return ENOMEM; return 0; } #else /* !WIN32 */ #error "no replacement posix_memalign() is available on this platform" #endif #endif /* !HAVE_VALLOC */ #endif /* !HAVE_POSIX_MEMALIGN */ nbdkit-1.42.2/common/replacements/pread.c0000644000175000017500000000504014534316443013753 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for pread for platforms which lack this function. */ #include #include #include #include #include #ifndef HAVE_PREAD #include "pread.h" #ifdef WIN32 /* Replacement pread for Win32. */ #include "nbdkit-plugin.h" #include ssize_t pread (int fd, void *buf, size_t count, off_t offset) { DWORD r; OVERLAPPED ovl; HANDLE h; memset (&ovl, 0, sizeof ovl); /* Seriously WTF Windows? */ ovl.Offset = offset & 0xffffffff; ovl.OffsetHigh = offset >> 32; h = (HANDLE) _get_osfhandle (fd); if (h == INVALID_HANDLE_VALUE) { nbdkit_debug ("ReadFile: bad handle"); errno = EIO; return -1; } /* XXX Will fail weirdly if count is larger than 32 bits. */ if (!ReadFile (h, buf, count, &r, &ovl)) { if (GetLastError () == ERROR_HANDLE_EOF) return 0; nbdkit_debug ("ReadFile: error %d", GetLastError ()); errno = EIO; return -1; } return r; } #else /* !WIN32 */ #error "no replacement pread is available on this platform" #endif #endif /* !HAVE_PREAD */ nbdkit-1.42.2/common/replacements/pwrite.c0000644000175000017500000000476214534316443014204 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for pwrite for platforms which lack this function. */ #include #include #include #include #include #ifndef HAVE_PWRITE #include "pwrite.h" #ifdef WIN32 /* Replacement pwrite for Win32. */ #include "nbdkit-plugin.h" #include ssize_t pwrite (int fd, const void *buf, size_t count, off_t offset) { DWORD r; OVERLAPPED ovl; HANDLE h; memset (&ovl, 0, sizeof ovl); /* Seriously WTF Windows? */ ovl.Offset = offset & 0xffffffff; ovl.OffsetHigh = offset >> 32; h = (HANDLE) _get_osfhandle (fd); if (h == INVALID_HANDLE_VALUE) { nbdkit_debug ("ReadFile: bad handle"); errno = EIO; return -1; } /* XXX Will fail weirdly if count is larger than 32 bits. */ if (!WriteFile (h, buf, count, &r, &ovl)) { nbdkit_debug ("WriteFile: error %d", GetLastError ()); errno = EIO; return -1; } return r; } #else /* !WIN32 */ #error "no replacement pwrite is available on this platform" #endif #endif /* !HAVE_PWRITE */ nbdkit-1.42.2/common/replacements/realpath.c0000644000175000017500000000442614534316443014467 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for realpath for platforms which lack this function. */ #include #include #include #include #ifndef HAVE_REALPATH #include "realpath.h" #ifdef WIN32 /* Replacement realpath for Win32. * * Note this is not thread-safe, but should be fine for all the * uses in the server and ordinary plugins. */ #include char * realpath (const char *path, char *out) { TCHAR buf[MAX_PATH]; int r; r = GetFullPathNameA (path, MAX_PATH, buf, NULL); if (r == 0) { errno = GetLastError (); return NULL; } out = malloc (r + 1); if (out == NULL) return NULL; memcpy (out, buf, r); out[r] = '\0'; return out; } #else /* !WIN32 */ #error "no replacement realpath is available on this platform" #endif #endif /* !HAVE_REALPATH */ nbdkit-1.42.2/common/replacements/strndup.c0000644000175000017500000000407414534316443014365 /* $NetBSD: strndup.c,v 1.4 2007/07/03 12:11:09 nakayama Exp $ */ /* * Copyright (c) 1988, 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. 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. */ /* $NetBSD: strndup.c,v 1.4 2007/07/03 12:11:09 nakayama Exp $ */ #include #include #include #include #ifndef HAVE_STRNDUP char * strndup (const char *str, size_t n) { size_t len; char *copy; for (len = 0; len < n && str[len]; len++) continue; if (!(copy = malloc (len + 1))) return NULL; memcpy (copy, str, len); copy[len] = '\0'; return copy; } #endif /* !HAVE_STRNDUP */ nbdkit-1.42.2/common/replacements/sysconf.c0000644000175000017500000000374214534316443014353 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #ifndef HAVE_SYSCONF #include "sysconf.h" #ifdef WIN32 #include /* Replacement sysconf for Win32. */ long sysconf (int name) { SYSTEM_INFO sysinfo; if (name == _SC_PAGESIZE) { GetSystemInfo (&sysinfo); return sysinfo.dwPageSize; } else { errno = EINVAL; return -1; } } #else /* !WIN32 */ #error "no replacement sysconf() is available on this platform" #endif #endif /* !HAVE_SYSCONF */ nbdkit-1.42.2/common/replacements/syslog.c0000644000175000017500000000361214534316443014203 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #ifndef HAVE_SYSLOG_H #include "syslog.h" #ifdef WIN32 /* Replacement syslog for Win32. */ void syslog (int pri, const char *fmt, ...) { va_list args; va_start (args, fmt); vsyslog (pri, fmt, args); va_end (args); } #else /* !WIN32 */ #error "no replacement syslog is available on this platform" #endif #endif /* !HAVE_SYSLOG_H */ nbdkit-1.42.2/common/replacements/vsyslog.c0000644000175000017500000000420114534316443014364 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #ifndef HAVE_SYSLOG_H #include "syslog.h" #ifdef WIN32 /* Replacement vsyslog for Win32. */ #include #include "win32/nbdkit-cat.h" extern HANDLE event_source; void vsyslog (int pri, const char *fmt, va_list args) { char *str; const char *strs[1]; if (vasprintf (&str, fmt, args) == -1) return; strs[0] = str; ReportEventA (event_source, EVENTLOG_ERROR_TYPE, 0, NBDKIT_SYSLOG_ERROR, NULL, 1, 0, strs, NULL); free (str); } #else /* !WIN32 */ #error "no replacement vsyslog is available on this platform" #endif #endif /* !HAVE_SYSLOG_H */ nbdkit-1.42.2/common/replacements/test-current-dir-name.c0000644000175000017500000000354314534316443017017 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "get_current_dir_name.h" int main (void) { char *pwd; pwd = get_current_dir_name (); printf ("pwd = %s\n", pwd); free (pwd); exit (EXIT_SUCCESS); } nbdkit-1.42.2/common/replacements/get_current_dir_name.h0000644000175000017500000000333514534316443017051 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_GET_CURRENT_DIR_NAME_H #define NBDKIT_GET_CURRENT_DIR_NAME_H #include #ifdef HAVE_GET_CURRENT_DIR_NAME #include #else extern char *get_current_dir_name (void); #endif #endif /* NBDKIT_GET_CURRENT_DIR_NAME_H */ nbdkit-1.42.2/common/replacements/fdatasync.h0000644000175000017500000000323614534316443014646 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_FDATASYNC_H #define NBDKIT_FDATASYNC_H #include #include #ifndef HAVE_FDATASYNC extern int fdatasync (int fd); #endif #endif /* NBDKIT_FDATASYNC_H */ nbdkit-1.42.2/common/replacements/fsync.h0000644000175000017500000000321214534316443014006 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_FSYNC_H #define NBDKIT_FSYNC_H #include #include #ifndef HAVE_FSYNC extern int fsync (int fd); #endif #endif /* NBDKIT_FSYNC_H */ nbdkit-1.42.2/common/replacements/getline.h0000644000175000017500000000341614534316443014321 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_GETLINE_H #define NBDKIT_GETLINE_H #include #include #include #ifndef HAVE_GETLINE ssize_t getline (char **lineptr, size_t *n, FILE *stream); ssize_t getdelim (char **lineptr, size_t *n, int delim, FILE *stream); #endif #endif /* NBDKIT_GETLINE_H */ nbdkit-1.42.2/common/replacements/open_memstream.h0000644000175000017500000000406514534316443015706 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_OPEN_MEMSTREAM_H #define NBDKIT_OPEN_MEMSTREAM_H #include #include #ifndef HAVE_OPEN_MEMSTREAM extern FILE *open_memstream (char **ptr, size_t *size); /* This function is not a straight replacement for open_memstream * because if you use it you must replace fclose with close_memstream. * * Also you cannot access the buffer until you close it, which is fine * for all uses in nbdkit, but it is not a general replacement. */ extern int close_memstream (FILE *memstream); #else #define close_memstream fclose #endif #endif /* NBDKIT_OPEN_MEMSTREAM_H */ nbdkit-1.42.2/common/replacements/poll.h0000644000175000017500000000404714534316443013641 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_POLL_H #define NBDKIT_POLL_H #include #ifdef HAVE_POLL #include_next #else #ifdef HAVE_WINSOCK2_H #include #endif #ifdef HAVE_WINSOCK2_H #undef POLLIN #undef POLLOUT #undef POLLERR #undef POLLHUP #undef POLLRDHUP #define pollfd rpl_pollfd #endif struct pollfd { int fd; short events; short revents; }; #define POLLIN 0x0001 #define POLLOUT 0x0002 #define POLLERR 0x0008 #define POLLHUP 0x0010 #define POLLRDHUP 0x2000 extern int poll (struct pollfd *fds, int n, int timeout); #endif #endif /* NBDKIT_POLL_H */ nbdkit-1.42.2/common/replacements/posix_memalign.h0000644000175000017500000000367614534316443015715 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for posix_memalign for platforms which lack it. * * NB: This only works for page aligned allocations. The alignment * parameter is ignored in our replacement functions. */ #ifndef NBDKIT_POSIX_MEMALIGN_H #define NBDKIT_POSIX_MEMALIGN_H #include #ifdef HAVE_POSIX_MEMALIGN #include #else extern int posix_memalign (void **ptr, size_t alignment, size_t size); #endif /* !HAVE_POSIX_MEMALIGN */ #endif /* NBDKIT_POSIX_MEMALIGN_H */ nbdkit-1.42.2/common/replacements/pread.h0000644000175000017500000000326514534316443013767 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_PREAD_H #define NBDKIT_PREAD_H #include #include #ifndef HAVE_PREAD extern ssize_t pread (int fd, void *buf, size_t count, off_t offset); #endif #endif /* NBDKIT_PREAD_H */ nbdkit-1.42.2/common/replacements/pwrite.h0000644000175000017500000000330014534316443014174 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_PWRITE_H #define NBDKIT_PWRITE_H #include #include #ifndef HAVE_PWRITE extern ssize_t pwrite (int fd, const void *buf, size_t count, off_t offset); #endif #endif /* NBDKIT_PWRITE_H */ nbdkit-1.42.2/common/replacements/realpath.h0000644000175000017500000000327614534316443014476 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_REALPATH_H #define NBDKIT_REALPATH_H #include #include #include #ifndef HAVE_REALPATH char *realpath (const char *path, char *out); #endif #endif /* NBDKIT_REALPATH_H */ nbdkit-1.42.2/common/replacements/strndup.h0000644000175000017500000000326614534316443014374 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_STRNDUP_H #define NBDKIT_STRNDUP_H #include #include #include #ifndef HAVE_STRNDUP char *strndup (const char *s, size_t n); #endif #endif /* NBDKIT_STRNDUP_H */ nbdkit-1.42.2/common/replacements/sysconf.h0000644000175000017500000000352114534316443014353 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for sysconf for platforms which lack it. Just enough * to get the system page size. */ #ifndef NBDKIT_SYSCONF_H #define NBDKIT_SYSCONF_H #include #ifdef HAVE_SYSCONF #include #else #ifndef _SC_PAGESIZE #define _SC_PAGESIZE 1 #endif extern long sysconf (int name); #endif /* !HAVE_SYSCONF */ #endif /* NBDKIT_SYSCONF_H */ nbdkit-1.42.2/common/replacements/syslog.h0000644000175000017500000000440014534316443014204 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Replacement for syslog for platforms which lack it. Note this only * implements "just enough syslog" for nbdkit. It's not a general * replacement. */ #ifndef NBDKIT_SYSLOG_H #define NBDKIT_SYSLOG_H #include #ifdef HAVE_SYSLOG_H #include_next #else #include /* Since the replacement function ignores the priority field, we only * need to define these to any integer. */ #define LOG_PID 0 #define LOG_ERR 0 #define LOG_DAEMON 0 extern void openlog (const char *ident, int option, int facility); extern void syslog (int pri, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); extern void vsyslog (int pri, const char *fmt, va_list args) __attribute__ ((format (printf, 2, 0))); #endif /* !HAVE_SYSLOG_H */ #endif /* NBDKIT_SYSLOG_H */ nbdkit-1.42.2/common/replacements/win32/0000755000175000017500000000000014771247240013540 5nbdkit-1.42.2/common/replacements/win32/Makefile.am0000644000175000017500000000364714623341243015520 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # The Windows message catalog. include $(top_srcdir)/common-rules.mk noinst_DATA = MSG00001.bin nbdkit-cat.h nbdkit-cat.rc # We distribute the generated message catalog files to save people # needing to install the windmc tool, but they are regenerated (below) # if windmc is found at configure time. EXTRA_DIST = nbdkit-cat.mc $(noinst_DATA) if HAVE_MC CLEANFILES += stamp-data $(noinst_DATA): stamp-data stamp-data: nbdkit-cat.mc rm -f $@ $(noinst_DATA) $(MC) $< touch $@ endif nbdkit-1.42.2/common/replacements/win32/Makefile.in0000644000175000017500000004565514771245446015552 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # The Windows message catalog. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_MC_TRUE@am__append_1 = stamp-data subdir = common/replacements/win32 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_1) noinst_DATA = MSG00001.bin nbdkit-cat.h nbdkit-cat.rc # We distribute the generated message catalog files to save people # needing to install the windmc tool, but they are regenerated (below) # if windmc is found at configure time. EXTRA_DIST = nbdkit-cat.mc $(noinst_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/replacements/win32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/replacements/win32/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile @HAVE_MC_TRUE@$(noinst_DATA): stamp-data @HAVE_MC_TRUE@stamp-data: nbdkit-cat.mc @HAVE_MC_TRUE@ rm -f $@ $(noinst_DATA) @HAVE_MC_TRUE@ $(MC) $< @HAVE_MC_TRUE@ touch $@ # 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: nbdkit-1.42.2/common/replacements/win32/nbdkit-cat.mc0000644000175000017500000000311314534316443016016 ;// nbdkit ;// Copyright Red Hat ;// ;// Redistribution and use in source and binary forms, with or without ;// modification, are permitted provided that the following conditions are ;// met: ;// ;// * Redistributions of source code must retain the above copyright ;// notice, this list of conditions and the following disclaimer. ;// ;// * Redistributions in binary form must reproduce the above copyright ;// notice, this list of conditions and the following disclaimer in the ;// documentation and/or other materials provided with the distribution. ;// ;// * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. MessageId=1 Severity=Error SymbolicName=NBDKIT_SYSLOG_ERROR Language=English %1 . nbdkit-1.42.2/common/replacements/win32/MSG00001.bin0000644000175000017500000000003414623341243015150 ÀÀ %1 nbdkit-1.42.2/common/replacements/win32/nbdkit-cat.h0000644000175000017500000000461214623341243015646 /* Do not edit this file manually. This file is autogenerated by windmc. */ // // The values are 32 bit layed out as follows: // // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 // +---+-+-+-----------------------+-------------------------------+ // |Sev|C|R| Facility | Code | // +---+-+-+-----------------------+-------------------------------+ // // where // // C - is the Customer code flag // // R - is a reserved bit // // Code - is the facility's status code // // Sev - is the severity code // // Success - 00 // Informational - 01 // Warning - 02 // Error - 03 // // Facility - is the facility code // // System - 00ff // Application - 0fff // // nbdkit // Copyright Red Hat // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. // // MessageId: NBDKIT_SYSLOG_ERROR // #define NBDKIT_SYSLOG_ERROR 0xc0000001 nbdkit-1.42.2/common/replacements/win32/nbdkit-cat.rc0000644000175000017500000000031114623341243016013 /* Do not edit this file manually. This file is autogenerated by windmc. */ // Country: United States // Language: English #pragma code_page(1252) LANGUAGE 0x9, 0x1 1 MESSAGETABLE "MSG00001.bin" nbdkit-1.42.2/common/utils/0000755000175000017500000000000014771247240011254 5nbdkit-1.42.2/common/utils/Makefile.am0000644000175000017500000000764514623341243013236 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = windows-errors.txt noinst_LTLIBRARIES = libutils.la libutils_la_SOURCES = \ cleanup.c \ cleanup-nbdkit.c \ cleanup.h \ const-string-vector.h \ device-size.c \ environ.c \ exit-with-parent.c \ exit-with-parent.h \ full-rw.c \ quote.c \ nbdkit-string.h \ string-vector.h \ utils.c \ utils.h \ vector.c \ vector.h \ windows-compat.h \ windows-compat.c \ windows-errors.c \ $(NULL) libutils_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/replacements \ $(NULL) libutils_la_CFLAGS = \ $(WARNINGS_CFLAGS) \ $(PTHREAD_CFLAGS) \ $(NULL) libutils_la_LIBADD = \ $(PTHREAD_LIBS) \ $(NULL) # Generate the code to map Winsock errors to errno codes. BUILT_SOURCES = windows-errors.c windows-errors.c: windows-errors.txt @rm -f $@ $@-t @echo '/* Generated from windows-errors.txt */' > $@-t @echo '#include ' >> $@-t @echo '#ifdef WIN32' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo 'int' >> $@-t @echo 'translate_winsock_error (const char *fn, int err) {' >> $@-t # Always log the original error. @echo ' nbdkit_debug ("%s: winsock error %d", fn, err);' >> $@-t @echo ' switch (err) {' >> $@-t @$(SED) -e '/^#/d' \ -e '/^$$/d' \ -e 's/\(.*\)[[:space:]][[:space:]]*\(.*\)/#if defined(\1) \&\& defined(\2)\n\ case \1: return \2;\n\ \#endif/' \ < $< >> $@-t @echo ' default:' >> $@-t @echo ' return err > 10000 && err < 10025 ? err - 10000 : EINVAL;' >> $@-t @echo ' }' >> $@-t @echo '}' >> $@-t @echo '#endif /* WIN32 */' >> $@-t mv $@-t $@ chmod -w $@ # Unit tests. TESTS = test-quotes test-vector check_PROGRAMS = test-quotes test-vector test_quotes_SOURCES = test-quotes.c quote.c utils.h test_quotes_CPPFLAGS = \ -I$(srcdir) \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ $(NULL) test_quotes_CFLAGS = $(WARNINGS_CFLAGS) test_quotes_LDADD = \ $(top_builddir)/common/replacements/libcompat.la \ $(NULL) test_vector_SOURCES = test-vector.c vector.c vector.h bench.h test_vector_CPPFLAGS = \ -I$(srcdir) \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ $(NULL) test_vector_CFLAGS = $(WARNINGS_CFLAGS) test_vector_LDADD = \ $(top_builddir)/common/replacements/libcompat.la \ $(NULL) bench: test-vector NBDKIT_BENCH=1 ./test-vector nbdkit-1.42.2/common/utils/Makefile.in0000644000175000017500000020244414771245446013255 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-quotes$(EXEEXT) test-vector$(EXEEXT) check_PROGRAMS = test-quotes$(EXEEXT) test-vector$(EXEEXT) subdir = common/utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libutils_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = am_libutils_la_OBJECTS = libutils_la-cleanup.lo \ libutils_la-cleanup-nbdkit.lo libutils_la-device-size.lo \ libutils_la-environ.lo libutils_la-exit-with-parent.lo \ libutils_la-full-rw.lo libutils_la-quote.lo \ libutils_la-utils.lo libutils_la-vector.lo \ libutils_la-windows-compat.lo libutils_la-windows-errors.lo \ $(am__objects_1) libutils_la_OBJECTS = $(am_libutils_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libutils_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libutils_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_quotes_OBJECTS = test_quotes-test-quotes.$(OBJEXT) \ test_quotes-quote.$(OBJEXT) test_quotes_OBJECTS = $(am_test_quotes_OBJECTS) test_quotes_DEPENDENCIES = \ $(top_builddir)/common/replacements/libcompat.la \ $(am__DEPENDENCIES_1) test_quotes_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_quotes_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_vector_OBJECTS = test_vector-test-vector.$(OBJEXT) \ test_vector-vector.$(OBJEXT) test_vector_OBJECTS = $(am_test_vector_OBJECTS) test_vector_DEPENDENCIES = \ $(top_builddir)/common/replacements/libcompat.la \ $(am__DEPENDENCIES_1) test_vector_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_vector_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libutils_la-cleanup-nbdkit.Plo \ ./$(DEPDIR)/libutils_la-cleanup.Plo \ ./$(DEPDIR)/libutils_la-device-size.Plo \ ./$(DEPDIR)/libutils_la-environ.Plo \ ./$(DEPDIR)/libutils_la-exit-with-parent.Plo \ ./$(DEPDIR)/libutils_la-full-rw.Plo \ ./$(DEPDIR)/libutils_la-quote.Plo \ ./$(DEPDIR)/libutils_la-utils.Plo \ ./$(DEPDIR)/libutils_la-vector.Plo \ ./$(DEPDIR)/libutils_la-windows-compat.Plo \ ./$(DEPDIR)/libutils_la-windows-errors.Plo \ ./$(DEPDIR)/test_quotes-quote.Po \ ./$(DEPDIR)/test_quotes-test-quotes.Po \ ./$(DEPDIR)/test_vector-test-vector.Po \ ./$(DEPDIR)/test_vector-vector.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libutils_la_SOURCES) $(test_quotes_SOURCES) \ $(test_vector_SOURCES) DIST_SOURCES = $(libutils_la_SOURCES) $(test_quotes_SOURCES) \ $(test_vector_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll EXTRA_DIST = windows-errors.txt noinst_LTLIBRARIES = libutils.la libutils_la_SOURCES = \ cleanup.c \ cleanup-nbdkit.c \ cleanup.h \ const-string-vector.h \ device-size.c \ environ.c \ exit-with-parent.c \ exit-with-parent.h \ full-rw.c \ quote.c \ nbdkit-string.h \ string-vector.h \ utils.c \ utils.h \ vector.c \ vector.h \ windows-compat.h \ windows-compat.c \ windows-errors.c \ $(NULL) libutils_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/replacements \ $(NULL) libutils_la_CFLAGS = \ $(WARNINGS_CFLAGS) \ $(PTHREAD_CFLAGS) \ $(NULL) libutils_la_LIBADD = \ $(PTHREAD_LIBS) \ $(NULL) # Generate the code to map Winsock errors to errno codes. BUILT_SOURCES = windows-errors.c test_quotes_SOURCES = test-quotes.c quote.c utils.h test_quotes_CPPFLAGS = \ -I$(srcdir) \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ $(NULL) test_quotes_CFLAGS = $(WARNINGS_CFLAGS) test_quotes_LDADD = \ $(top_builddir)/common/replacements/libcompat.la \ $(NULL) test_vector_SOURCES = test-vector.c vector.c vector.h bench.h test_vector_CPPFLAGS = \ -I$(srcdir) \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ $(NULL) test_vector_CFLAGS = $(WARNINGS_CFLAGS) test_vector_LDADD = \ $(top_builddir)/common/replacements/libcompat.la \ $(NULL) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/utils/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libutils.la: $(libutils_la_OBJECTS) $(libutils_la_DEPENDENCIES) $(EXTRA_libutils_la_DEPENDENCIES) $(AM_V_CCLD)$(libutils_la_LINK) $(libutils_la_OBJECTS) $(libutils_la_LIBADD) $(LIBS) test-quotes$(EXEEXT): $(test_quotes_OBJECTS) $(test_quotes_DEPENDENCIES) $(EXTRA_test_quotes_DEPENDENCIES) @rm -f test-quotes$(EXEEXT) $(AM_V_CCLD)$(test_quotes_LINK) $(test_quotes_OBJECTS) $(test_quotes_LDADD) $(LIBS) test-vector$(EXEEXT): $(test_vector_OBJECTS) $(test_vector_DEPENDENCIES) $(EXTRA_test_vector_DEPENDENCIES) @rm -f test-vector$(EXEEXT) $(AM_V_CCLD)$(test_vector_LINK) $(test_vector_OBJECTS) $(test_vector_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-cleanup-nbdkit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-cleanup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-device-size.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-environ.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-exit-with-parent.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-full-rw.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-quote.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-vector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-windows-compat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutils_la-windows-errors.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_quotes-quote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_quotes-test-quotes.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vector-test-vector.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vector-vector.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libutils_la-cleanup.lo: cleanup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-cleanup.lo -MD -MP -MF $(DEPDIR)/libutils_la-cleanup.Tpo -c -o libutils_la-cleanup.lo `test -f 'cleanup.c' || echo '$(srcdir)/'`cleanup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-cleanup.Tpo $(DEPDIR)/libutils_la-cleanup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cleanup.c' object='libutils_la-cleanup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-cleanup.lo `test -f 'cleanup.c' || echo '$(srcdir)/'`cleanup.c libutils_la-cleanup-nbdkit.lo: cleanup-nbdkit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-cleanup-nbdkit.lo -MD -MP -MF $(DEPDIR)/libutils_la-cleanup-nbdkit.Tpo -c -o libutils_la-cleanup-nbdkit.lo `test -f 'cleanup-nbdkit.c' || echo '$(srcdir)/'`cleanup-nbdkit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-cleanup-nbdkit.Tpo $(DEPDIR)/libutils_la-cleanup-nbdkit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cleanup-nbdkit.c' object='libutils_la-cleanup-nbdkit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-cleanup-nbdkit.lo `test -f 'cleanup-nbdkit.c' || echo '$(srcdir)/'`cleanup-nbdkit.c libutils_la-device-size.lo: device-size.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-device-size.lo -MD -MP -MF $(DEPDIR)/libutils_la-device-size.Tpo -c -o libutils_la-device-size.lo `test -f 'device-size.c' || echo '$(srcdir)/'`device-size.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-device-size.Tpo $(DEPDIR)/libutils_la-device-size.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device-size.c' object='libutils_la-device-size.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-device-size.lo `test -f 'device-size.c' || echo '$(srcdir)/'`device-size.c libutils_la-environ.lo: environ.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-environ.lo -MD -MP -MF $(DEPDIR)/libutils_la-environ.Tpo -c -o libutils_la-environ.lo `test -f 'environ.c' || echo '$(srcdir)/'`environ.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-environ.Tpo $(DEPDIR)/libutils_la-environ.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='environ.c' object='libutils_la-environ.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-environ.lo `test -f 'environ.c' || echo '$(srcdir)/'`environ.c libutils_la-exit-with-parent.lo: exit-with-parent.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-exit-with-parent.lo -MD -MP -MF $(DEPDIR)/libutils_la-exit-with-parent.Tpo -c -o libutils_la-exit-with-parent.lo `test -f 'exit-with-parent.c' || echo '$(srcdir)/'`exit-with-parent.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-exit-with-parent.Tpo $(DEPDIR)/libutils_la-exit-with-parent.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exit-with-parent.c' object='libutils_la-exit-with-parent.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-exit-with-parent.lo `test -f 'exit-with-parent.c' || echo '$(srcdir)/'`exit-with-parent.c libutils_la-full-rw.lo: full-rw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-full-rw.lo -MD -MP -MF $(DEPDIR)/libutils_la-full-rw.Tpo -c -o libutils_la-full-rw.lo `test -f 'full-rw.c' || echo '$(srcdir)/'`full-rw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-full-rw.Tpo $(DEPDIR)/libutils_la-full-rw.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='full-rw.c' object='libutils_la-full-rw.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-full-rw.lo `test -f 'full-rw.c' || echo '$(srcdir)/'`full-rw.c libutils_la-quote.lo: quote.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-quote.lo -MD -MP -MF $(DEPDIR)/libutils_la-quote.Tpo -c -o libutils_la-quote.lo `test -f 'quote.c' || echo '$(srcdir)/'`quote.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-quote.Tpo $(DEPDIR)/libutils_la-quote.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quote.c' object='libutils_la-quote.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-quote.lo `test -f 'quote.c' || echo '$(srcdir)/'`quote.c libutils_la-utils.lo: utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-utils.lo -MD -MP -MF $(DEPDIR)/libutils_la-utils.Tpo -c -o libutils_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-utils.Tpo $(DEPDIR)/libutils_la-utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='libutils_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c libutils_la-vector.lo: vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-vector.lo -MD -MP -MF $(DEPDIR)/libutils_la-vector.Tpo -c -o libutils_la-vector.lo `test -f 'vector.c' || echo '$(srcdir)/'`vector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-vector.Tpo $(DEPDIR)/libutils_la-vector.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vector.c' object='libutils_la-vector.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-vector.lo `test -f 'vector.c' || echo '$(srcdir)/'`vector.c libutils_la-windows-compat.lo: windows-compat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-windows-compat.lo -MD -MP -MF $(DEPDIR)/libutils_la-windows-compat.Tpo -c -o libutils_la-windows-compat.lo `test -f 'windows-compat.c' || echo '$(srcdir)/'`windows-compat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-windows-compat.Tpo $(DEPDIR)/libutils_la-windows-compat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-compat.c' object='libutils_la-windows-compat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-windows-compat.lo `test -f 'windows-compat.c' || echo '$(srcdir)/'`windows-compat.c libutils_la-windows-errors.lo: windows-errors.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -MT libutils_la-windows-errors.lo -MD -MP -MF $(DEPDIR)/libutils_la-windows-errors.Tpo -c -o libutils_la-windows-errors.lo `test -f 'windows-errors.c' || echo '$(srcdir)/'`windows-errors.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutils_la-windows-errors.Tpo $(DEPDIR)/libutils_la-windows-errors.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-errors.c' object='libutils_la-windows-errors.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutils_la_CPPFLAGS) $(CPPFLAGS) $(libutils_la_CFLAGS) $(CFLAGS) -c -o libutils_la-windows-errors.lo `test -f 'windows-errors.c' || echo '$(srcdir)/'`windows-errors.c test_quotes-test-quotes.o: test-quotes.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -MT test_quotes-test-quotes.o -MD -MP -MF $(DEPDIR)/test_quotes-test-quotes.Tpo -c -o test_quotes-test-quotes.o `test -f 'test-quotes.c' || echo '$(srcdir)/'`test-quotes.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_quotes-test-quotes.Tpo $(DEPDIR)/test_quotes-test-quotes.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-quotes.c' object='test_quotes-test-quotes.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -c -o test_quotes-test-quotes.o `test -f 'test-quotes.c' || echo '$(srcdir)/'`test-quotes.c test_quotes-test-quotes.obj: test-quotes.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -MT test_quotes-test-quotes.obj -MD -MP -MF $(DEPDIR)/test_quotes-test-quotes.Tpo -c -o test_quotes-test-quotes.obj `if test -f 'test-quotes.c'; then $(CYGPATH_W) 'test-quotes.c'; else $(CYGPATH_W) '$(srcdir)/test-quotes.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_quotes-test-quotes.Tpo $(DEPDIR)/test_quotes-test-quotes.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-quotes.c' object='test_quotes-test-quotes.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -c -o test_quotes-test-quotes.obj `if test -f 'test-quotes.c'; then $(CYGPATH_W) 'test-quotes.c'; else $(CYGPATH_W) '$(srcdir)/test-quotes.c'; fi` test_quotes-quote.o: quote.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -MT test_quotes-quote.o -MD -MP -MF $(DEPDIR)/test_quotes-quote.Tpo -c -o test_quotes-quote.o `test -f 'quote.c' || echo '$(srcdir)/'`quote.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_quotes-quote.Tpo $(DEPDIR)/test_quotes-quote.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quote.c' object='test_quotes-quote.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -c -o test_quotes-quote.o `test -f 'quote.c' || echo '$(srcdir)/'`quote.c test_quotes-quote.obj: quote.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -MT test_quotes-quote.obj -MD -MP -MF $(DEPDIR)/test_quotes-quote.Tpo -c -o test_quotes-quote.obj `if test -f 'quote.c'; then $(CYGPATH_W) 'quote.c'; else $(CYGPATH_W) '$(srcdir)/quote.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_quotes-quote.Tpo $(DEPDIR)/test_quotes-quote.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quote.c' object='test_quotes-quote.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_quotes_CPPFLAGS) $(CPPFLAGS) $(test_quotes_CFLAGS) $(CFLAGS) -c -o test_quotes-quote.obj `if test -f 'quote.c'; then $(CYGPATH_W) 'quote.c'; else $(CYGPATH_W) '$(srcdir)/quote.c'; fi` test_vector-test-vector.o: test-vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -MT test_vector-test-vector.o -MD -MP -MF $(DEPDIR)/test_vector-test-vector.Tpo -c -o test_vector-test-vector.o `test -f 'test-vector.c' || echo '$(srcdir)/'`test-vector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vector-test-vector.Tpo $(DEPDIR)/test_vector-test-vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-vector.c' object='test_vector-test-vector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -c -o test_vector-test-vector.o `test -f 'test-vector.c' || echo '$(srcdir)/'`test-vector.c test_vector-test-vector.obj: test-vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -MT test_vector-test-vector.obj -MD -MP -MF $(DEPDIR)/test_vector-test-vector.Tpo -c -o test_vector-test-vector.obj `if test -f 'test-vector.c'; then $(CYGPATH_W) 'test-vector.c'; else $(CYGPATH_W) '$(srcdir)/test-vector.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vector-test-vector.Tpo $(DEPDIR)/test_vector-test-vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-vector.c' object='test_vector-test-vector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -c -o test_vector-test-vector.obj `if test -f 'test-vector.c'; then $(CYGPATH_W) 'test-vector.c'; else $(CYGPATH_W) '$(srcdir)/test-vector.c'; fi` test_vector-vector.o: vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -MT test_vector-vector.o -MD -MP -MF $(DEPDIR)/test_vector-vector.Tpo -c -o test_vector-vector.o `test -f 'vector.c' || echo '$(srcdir)/'`vector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vector-vector.Tpo $(DEPDIR)/test_vector-vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vector.c' object='test_vector-vector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -c -o test_vector-vector.o `test -f 'vector.c' || echo '$(srcdir)/'`vector.c test_vector-vector.obj: vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -MT test_vector-vector.obj -MD -MP -MF $(DEPDIR)/test_vector-vector.Tpo -c -o test_vector-vector.obj `if test -f 'vector.c'; then $(CYGPATH_W) 'vector.c'; else $(CYGPATH_W) '$(srcdir)/vector.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vector-vector.Tpo $(DEPDIR)/test_vector-vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vector.c' object='test_vector-vector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_vector_CPPFLAGS) $(CPPFLAGS) $(test_vector_CFLAGS) $(CFLAGS) -c -o test_vector-vector.obj `if test -f 'vector.c'; then $(CYGPATH_W) 'vector.c'; else $(CYGPATH_W) '$(srcdir)/vector.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-quotes.log: test-quotes$(EXEEXT) @p='test-quotes$(EXEEXT)'; \ b='test-quotes'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-vector.log: test-vector$(EXEEXT) @p='test-vector$(EXEEXT)'; \ b='test-vector'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libutils_la-cleanup-nbdkit.Plo -rm -f ./$(DEPDIR)/libutils_la-cleanup.Plo -rm -f ./$(DEPDIR)/libutils_la-device-size.Plo -rm -f ./$(DEPDIR)/libutils_la-environ.Plo -rm -f ./$(DEPDIR)/libutils_la-exit-with-parent.Plo -rm -f ./$(DEPDIR)/libutils_la-full-rw.Plo -rm -f ./$(DEPDIR)/libutils_la-quote.Plo -rm -f ./$(DEPDIR)/libutils_la-utils.Plo -rm -f ./$(DEPDIR)/libutils_la-vector.Plo -rm -f ./$(DEPDIR)/libutils_la-windows-compat.Plo -rm -f ./$(DEPDIR)/libutils_la-windows-errors.Plo -rm -f ./$(DEPDIR)/test_quotes-quote.Po -rm -f ./$(DEPDIR)/test_quotes-test-quotes.Po -rm -f ./$(DEPDIR)/test_vector-test-vector.Po -rm -f ./$(DEPDIR)/test_vector-vector.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libutils_la-cleanup-nbdkit.Plo -rm -f ./$(DEPDIR)/libutils_la-cleanup.Plo -rm -f ./$(DEPDIR)/libutils_la-device-size.Plo -rm -f ./$(DEPDIR)/libutils_la-environ.Plo -rm -f ./$(DEPDIR)/libutils_la-exit-with-parent.Plo -rm -f ./$(DEPDIR)/libutils_la-full-rw.Plo -rm -f ./$(DEPDIR)/libutils_la-quote.Plo -rm -f ./$(DEPDIR)/libutils_la-utils.Plo -rm -f ./$(DEPDIR)/libutils_la-vector.Plo -rm -f ./$(DEPDIR)/libutils_la-windows-compat.Plo -rm -f ./$(DEPDIR)/libutils_la-windows-errors.Plo -rm -f ./$(DEPDIR)/test_quotes-quote.Po -rm -f ./$(DEPDIR)/test_quotes-test-quotes.Po -rm -f ./$(DEPDIR)/test_vector-test-vector.Po -rm -f ./$(DEPDIR)/test_vector-vector.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check check-am install install-am install-exec \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile windows-errors.c: windows-errors.txt @rm -f $@ $@-t @echo '/* Generated from windows-errors.txt */' > $@-t @echo '#include ' >> $@-t @echo '#ifdef WIN32' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo '#include ' >> $@-t @echo 'int' >> $@-t @echo 'translate_winsock_error (const char *fn, int err) {' >> $@-t # Always log the original error. @echo ' nbdkit_debug ("%s: winsock error %d", fn, err);' >> $@-t @echo ' switch (err) {' >> $@-t @$(SED) -e '/^#/d' \ -e '/^$$/d' \ -e 's/\(.*\)[[:space:]][[:space:]]*\(.*\)/#if defined(\1) \&\& defined(\2)\n\ case \1: return \2;\n\ \#endif/' \ < $< >> $@-t @echo ' default:' >> $@-t @echo ' return err > 10000 && err < 10025 ? err - 10000 : EINVAL;' >> $@-t @echo ' }' >> $@-t @echo '}' >> $@-t @echo '#endif /* WIN32 */' >> $@-t mv $@-t $@ chmod -w $@ bench: test-vector NBDKIT_BENCH=1 ./test-vector # 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: nbdkit-1.42.2/common/utils/cleanup.c0000644000175000017500000000353714534316443012776 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include "cleanup.h" void cleanup_free (void *ptr) { free (* (void **) ptr); } void cleanup_mutex_unlock (pthread_mutex_t **ptr) { int r = pthread_mutex_unlock (*ptr); assert (!r); } void cleanup_rwlock_unlock (pthread_rwlock_t **ptr) { int r = pthread_rwlock_unlock (*ptr); assert (!r); } nbdkit-1.42.2/common/utils/cleanup-nbdkit.c0000644000175000017500000000340214534316443014236 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include "cleanup.h" #include "nbdkit-filter.h" void cleanup_extents_free (struct nbdkit_extents **ptr) { nbdkit_extents_free (*ptr); } void cleanup_exports_free (struct nbdkit_exports **ptr) { nbdkit_exports_free (*ptr); } nbdkit-1.42.2/common/utils/cleanup.h0000644000175000017500000001021014534316443012765 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_CLEANUP_H #define NBDKIT_CLEANUP_H #ifdef __cplusplus extern "C" { #endif #include #include #include "unique-name.h" /* Work around clang bug: https://bugs.llvm.org/show_bug.cgi?id=43482 */ #ifdef __clang__ #define CLANG_UNUSED_VARIABLE_WORKAROUND __attribute__ ((__unused__)) #else #define CLANG_UNUSED_VARIABLE_WORKAROUND #endif /* cleanup.c */ extern void cleanup_free (void *ptr); #define CLEANUP_FREE __attribute__ ((cleanup (cleanup_free))) extern void cleanup_mutex_unlock (pthread_mutex_t **ptr); #define CLEANUP_MUTEX_UNLOCK __attribute__ ((cleanup (cleanup_mutex_unlock))) #define ACQUIRE_LOCK_FOR_CURRENT_SCOPE(mutex) \ ACQUIRE_LOCK_FOR_CURRENT_SCOPE_1 ((mutex), NBDKIT_UNIQUE_NAME (_lock)) #define ACQUIRE_LOCK_FOR_CURRENT_SCOPE_1(mutex, lock) \ CLEANUP_MUTEX_UNLOCK pthread_mutex_t *lock = mutex; \ do { \ int _r = pthread_mutex_lock (lock); \ assert (!_r); \ } while (0) extern void cleanup_rwlock_unlock (pthread_rwlock_t **ptr); #define CLEANUP_RWLOCK_UNLOCK __attribute__ ((cleanup (cleanup_rwlock_unlock))) #define ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE(rwlock) \ ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE_1 ((rwlock), NBDKIT_UNIQUE_NAME (_lock)) #define ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE_1(rwlock, lock) \ CLEANUP_RWLOCK_UNLOCK pthread_rwlock_t *lock = rwlock; \ do { \ int _r = pthread_rwlock_wrlock (lock); \ assert (!_r); \ } while (0) #define ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE(rwlock) \ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE_1 ((rwlock), NBDKIT_UNIQUE_NAME (_lock)) #define ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE_1(rwlock, lock) \ CLEANUP_RWLOCK_UNLOCK pthread_rwlock_t *lock = rwlock; \ do { \ int _r = pthread_rwlock_rdlock (lock); \ assert (!_r); \ } while (0) /* cleanup-nbdkit.c */ struct nbdkit_extents; extern void cleanup_extents_free (struct nbdkit_extents **ptr); #define CLEANUP_EXTENTS_FREE __attribute__ ((cleanup (cleanup_extents_free))) struct nbdkit_exports; extern void cleanup_exports_free (struct nbdkit_exports **ptr); #define CLEANUP_EXPORTS_FREE __attribute__ ((cleanup (cleanup_exports_free))) #ifdef __cplusplus } /* extern "C" */ #endif #endif /* NBDKIT_CLEANUP_H */ nbdkit-1.42.2/common/utils/const-string-vector.h0000644000175000017500000000353614534316443015305 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Extensible list of const strings. The implementation uses vector.h. */ #ifndef CONST_STRING_VECTOR_H #define CONST_STRING_VECTOR_H #include "vector.h" DEFINE_VECTOR_TYPE (const_string_vector, const char *); /* This frees only the array. */ #define CLEANUP_FREE_CONST_STRING_VECTOR \ __attribute__ ((cleanup (const_string_vector_reset))) #endif /* CONST_STRING_VECTOR_H */ nbdkit-1.42.2/common/utils/device-size.c0000644000175000017500000001367614623341243013556 /* nbdkit * Copyright Red Hat * * This is based on code from util-linux/lib/blkdev.c which is * distributed under a compatible license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #ifndef WIN32 #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_DISK_H #include /* for Darwin and FreeBSD */ #endif #ifdef HAVE_SYS_DISKLABEL_H #include /* for FreeBSD */ #endif #ifdef HAVE_LINUX_FS_H #include /* for BLKGETSIZE{64,} on Linux */ #endif #include "utils.h" static int64_t find_size_by_seeking (int fd); static long valid_offset (int fd, int64_t offset); /* Calculate the size of file or block device 'fd'. * * If 'statbuf' is non-NULL, it should contain the result of a * previous call to fstat(2). Otherwise, this function may need to * call fstat. It may need to seek on the file descriptor or use * ioctl. * * NB: In general this function requires O_RDONLY/O_RDWR access to * block devices, because otherwise the find_size_by_seeking method * doesn't work. * * On error, sets errno and returns -1. */ int64_t device_size (int fd, const struct stat *statbuf_from_caller) { const struct stat *sb; struct stat statbuf; #if defined(DKIOCGETBLOCKCOUNT) || defined(BLKGETSIZE64) uint64_t u64; #endif if (statbuf_from_caller != NULL) sb = statbuf_from_caller; else { if (fstat (fd, &statbuf) == -1) return -1; sb = &statbuf; } /* Assume st_size works for regular files. */ if (S_ISREG (sb->st_mode)) return sb->st_size; /* Error for anything else which is not a block device. */ else if (!S_ISBLK (sb->st_mode)) { errno = ENOTBLK; return -1; } /* Apple Darwin */ #ifdef DKIOCGETBLOCKCOUNT if (ioctl (fd, DKIOCGETBLOCKCOUNT, &u64) >= 0) { u64 <<= 9; return u64; } #endif /* Linux */ #ifdef BLKGETSIZE64 if (ioctl (fd, BLKGETSIZE64, &u64) >= 0) return u64; #endif #ifdef BLKGETSIZE unsigned long ul; if (ioctl (fd, BLKGETSIZE, &ul) >= 0) return (uint64_t)ul << 9; #endif /* FreeBSD */ #ifdef DIOCGMEDIASIZE off_t off; if (ioctl (fd, DIOCGMEDIASIZE, &off) >= 0) return off; #endif /* Fall back to seeking. */ return find_size_by_seeking (fd); } /* The two functions below were copied from util-linux and it's not * obvious what it does or how it works, so ... * * The aim of this function is to be a fallback to find the size of a * block device by seeking to the end. We used to use lseek(SEEK_END) * for this, but that isn't portable to some BSDs. * * It starts by setting [low, high] to [0, 1024] and checking if the * high offset (1024) is valid, where "valid" means is seekable and * you can read a byte from that offset. If valid, it tries again * with [1024, 2048], [2048, 4096], doubling each time. * * When the high offset is no longer valid, we enter the second loop * with a [low, high] range where we know the end of the disk must be * >= low and < high. The second loop does a binary search to find * the end of the disk. */ static int64_t find_size_by_seeking (int fd) { int64_t high, low = 0; /* Find range. */ for (high = 1024; valid_offset (fd, high); ) { if (high == INT64_MAX) { errno = EFBIG; return -1; } low = high; if (high >= INT64_MAX/2) high = INT64_MAX; else high *= 2; } /* Binary search in >= low, < high. */ while (low < high - 1) { int64_t mid = (low + high) / 2; if (valid_offset (fd, mid)) low = mid; else high = mid; } /* This is in the original code, but what is it for? I initially * thought it was meant to reset the seek offset to 0, but it * actually sets it to 1. Is that a mistake? Or does it do * something else? XXX */ valid_offset (fd, 0); /* Return the size, which is last offset + 1. */ return low + 1; } static long valid_offset (int fd, int64_t offset) { char ch; ssize_t r; if (lseek (fd, offset, SEEK_SET) < 0) return 0; /* The original code in util-linux just checks for < 1, but that's * wrong. If the file descriptor is not open for reading * (ie. O_WRONLY) then this fails with EBADF, resulting in * calculating an apparent size of 1. Assert fail if we see EBADF * here as it's a programming error. */ r = read (fd, &ch, 1); assert (r != -1 || errno != EBADF); if (r < 1) return 0; return 1; } #endif /* !WIN32 */ nbdkit-1.42.2/common/utils/environ.c0000644000175000017500000000647614534316443013034 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "utils.h" #include "string-vector.h" /* Copy an environ. Also this allows you to add (key, value) pairs to * the environ through the varargs NULL-terminated list. Returns NULL * if the copy or allocation failed. */ char ** copy_environ (char **env, ...) { string_vector ret = empty_vector; size_t i, len; char *s; va_list argp; const char *key, *value; /* Copy the existing keys into the new vector. */ for (i = 0; env[i] != NULL; ++i) { s = strdup (env[i]); if (s == NULL) { nbdkit_error ("strdup: %m"); goto error; } if (string_vector_append (&ret, s) == -1) { nbdkit_error ("realloc: %m"); goto error; } } /* Add the new keys. */ va_start (argp, env); while ((key = va_arg (argp, const char *)) != NULL) { value = va_arg (argp, const char *); if (asprintf (&s, "%s=%s", key, value) == -1) { nbdkit_error ("asprintf: %m"); va_end (argp); goto error; } /* Search for key in the existing environment. It's O(n^2) ... */ len = strlen (key); for (i = 0; i < ret.len; ++i) { if (strncmp (key, ret.ptr[i], len) == 0 && ret.ptr[i][len] == '=') { /* Replace the existing key. */ free (ret.ptr[i]); ret.ptr[i] = s; goto found; } } /* Else, append a new key. */ if (string_vector_append (&ret, s) == -1) { nbdkit_error ("realloc: %m"); va_end (argp); free (s); goto error; } found: ; } va_end (argp); /* Append a NULL pointer. */ if (string_vector_append (&ret, NULL) == -1) { nbdkit_error ("realloc: %m"); goto error; } /* Return the list of strings. */ return ret.ptr; error: string_vector_empty (&ret); return NULL; } nbdkit-1.42.2/common/utils/exit-with-parent.c0000644000175000017500000001004114534316443014544 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Implement the --exit-with-parent feature on operating systems which * support it. */ #include #include #include #include #ifdef HAVE_SYS_PRCTL_H #include #endif #ifdef HAVE_SYS_PROCCTL_H #include #endif #if defined (HAVE_SYS_PRCTL_H) && defined (PR_SET_PDEATHSIG) /* For Linux >= 2.1.57. */ int set_exit_with_parent (void) { return prctl (PR_SET_PDEATHSIG, SIGTERM); } bool can_exit_with_parent (void) { return true; } #elif defined (HAVE_SYS_PROCCTL_H) && defined (PROC_PDEATHSIG_CTL) /* For FreeBSD >= 11.2 */ int set_exit_with_parent (void) { const int sig = SIGTERM; return procctl (P_PID, 0, PROC_PDEATHSIG_CTL, (void*) &sig); } bool can_exit_with_parent (void) { return true; } #elif defined (__APPLE__) /* For macOS. */ #include #include #include #include #include "nbdkit-plugin.h" static void * exit_with_parent_loop (void *vp) { const pid_t ppid = getppid (); int fd; struct kevent kev, res[1]; int r; nbdkit_debug ("macOS: --exit-with-parent: " "registering exit with parent for ppid %d", (int) ppid); /* Register the kevent to wait for ppid to exit. */ fd = kqueue (); if (fd == -1) { nbdkit_error ("exit_with_parent_loop: kqueue: %m"); return NULL; } EV_SET (&kev, ppid, EVFILT_PROC, EV_ADD|EV_ENABLE, NOTE_EXIT, 0, NULL); if (kevent (fd, &kev, 1, NULL, 0, NULL) == -1) { nbdkit_error ("exit_with_parent_loop: kevent: %m"); close (fd); return NULL; } /* Wait for the kevent to happen. */ r = kevent (fd, 0, 0, res, 1, NULL); if (r == 1 && res[0].ident == ppid) { /* Shut down the whole process when the parent dies. */ nbdkit_debug ("macOS: --exit-with-parent: " "exit because parent process died"); nbdkit_shutdown (); } return NULL; } int set_exit_with_parent (void) { int r; pthread_attr_t attrs; pthread_t exit_with_parent_thread; /* We have to block waiting for kevent, so that requires that we * start a background thread. */ pthread_attr_init (&attrs); pthread_attr_setdetachstate (&attrs, PTHREAD_CREATE_DETACHED); r = pthread_create (&exit_with_parent_thread, NULL, exit_with_parent_loop, NULL); if (r != 0) { errno = r; return -1; } return 0; } bool can_exit_with_parent (void) { return true; } #else /* any platform that doesn't support this function */ int set_exit_with_parent (void) { abort (); } bool can_exit_with_parent (void) { return false; } #endif nbdkit-1.42.2/common/utils/exit-with-parent.h0000644000175000017500000000352514534316443014562 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_EXIT_WITH_PARENT_H #define NBDKIT_EXIT_WITH_PARENT_H #include /* Test if the feature is available on the platform. */ extern bool can_exit_with_parent (void); /* --exit-with-parent: kill the current process if the parent exits. * This may return -1 on error. */ extern int set_exit_with_parent (void); #endif /* NBDKIT_EXIT_WITH_PARENT_H */ nbdkit-1.42.2/common/utils/full-rw.c0000644000175000017500000000457414534316443012741 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* These functions are like pread(2)/pwrite(2) but they always read or * write the full amount, or fail. */ #include #include #include #include #include #include "pread.h" #include "pwrite.h" ssize_t full_pread (int fd, void *buf, size_t count, off_t offset) { ssize_t ret = 0, r; while (count > 0) { r = pread (fd, buf, count, offset); if (r == -1) return -1; if (r == 0) { /* Presumably the caller wasn't expecting end-of-file here, so * return an error. */ errno = EIO; return -1; } ret += r; offset += r; count -= r; } return ret; } ssize_t full_pwrite (int fd, const void *buf, size_t count, off_t offset) { ssize_t ret = 0, r; while (count > 0) { r = pwrite (fd, buf, count, offset); if (r == -1) return -1; ret += r; offset += r; count -= r; } return ret; } nbdkit-1.42.2/common/utils/quote.c0000644000175000017500000001034714534316443012501 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include "ascii-ctype.h" #include "hexdigit.h" /* Print str to fp, shell quoting if necessary. This comes from * libguestfs, but was written by me so I'm relicensing it to a BSD * license for nbdkit. */ void shell_quote (const char *str, FILE *fp) { /* Note possible bug in this list (XXX): * https://www.redhat.com/archives/libguestfs/2019-February/msg00036.html */ const char *safe_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_=,:/"; size_t i, len; /* If the string consists only of safe characters, output it as-is. */ len = strlen (str); if (len > 0 && len == strspn (str, safe_chars)) { fputs (str, fp); return; } /* Double-quote the string. */ fputc ('"', fp); for (i = 0; i < len; ++i) { switch (str[i]) { case '$': case '`': case '\\': case '"': fputc ('\\', fp); /*FALLTHROUGH*/ default: fputc (str[i], fp); } } fputc ('"', fp); } /* Print str to fp, URI quoting if necessary. * The resulting string is safe for use in a URI path or query component, * and can be passed through the shell without further quoting. */ void uri_quote (const char *str, FILE *fp) { /* safe_chars contains the RFC 3986 unreserved characters plus '/'. */ const char *safe_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_~/"; size_t i, len; /* If the string consists only of safe characters, output it as-is. */ len = strlen (str); if (len == strspn (str, safe_chars)) { fputs (str, fp); return; } for (i = 0; i < len; ++i) { if (strchr (safe_chars, str[i])) fputc (str[i], fp); else fprintf (fp, "%%%02X", str[i] & 0xff); } } /* Print str to fp, quoting in a way similar to C strings, for example * '\n' -> "\n". * * Note that we do not emit quotes around the string, and double * quotes within the string are not escaped. */ void c_string_quote (const char *str, FILE *fp) { size_t i; char c; for (i = 0; c = str[i], c != '\0'; ++i) { switch (c) { case '\\': fputc ('\\', fp); fputc ('\\', fp); break; case '\a': fputc ('\\', fp); fputc ('a', fp); break; case '\b': fputc ('\\', fp); fputc ('b', fp); break; case '\f': fputc ('\\', fp); fputc ('f', fp); break; case '\n': fputc ('\\', fp); fputc ('n', fp); break; case '\r': fputc ('\\', fp); fputc ('r', fp); break; case '\t': fputc ('\\', fp); fputc ('t', fp); break; case '\v': fputc ('\\', fp); fputc ('v', fp); break; default: if (ascii_isprint (c)) fputc (c, fp); else { fputc ('\\', fp); fputc ('x', fp); fputc (hexchar (c >> 4), fp); fputc (hexchar (c), fp); } } } } nbdkit-1.42.2/common/utils/nbdkit-string.h0000644000175000017500000000335014534316443014124 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Extensible string. The implementation uses vector.h. */ #ifndef NBDKIT_STRING_H #define NBDKIT_STRING_H #include "vector.h" DEFINE_VECTOR_TYPE (string, char); #define CLEANUP_FREE_STRING __attribute__ ((cleanup (string_reset))) #endif /* NBDKIT_STRING_H */ nbdkit-1.42.2/common/utils/string-vector.h0000644000175000017500000000350614534316443014156 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Extensible list of strings. The implementation uses vector.h. */ #ifndef STRING_VECTOR_H #define STRING_VECTOR_H #include "vector.h" DEFINE_POINTER_VECTOR_TYPE (string_vector, char *); /* This frees both the array and the strings. */ #define CLEANUP_FREE_STRING_VECTOR \ __attribute__ ((cleanup (string_vector_empty))) #endif /* STRING_VECTOR_H */ nbdkit-1.42.2/common/utils/utils.c0000644000175000017500000001437314676465664012530 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_WAIT_H #include #endif #include #include "ascii-ctype.h" #include "windows-compat.h" #ifndef WIN32 /* Convert exit status to nbd_error. If the exit status was nonzero * or another failure then -1 is returned. */ int exit_status_to_nbd_error (int status, const char *cmd) { if (WIFEXITED (status) && WEXITSTATUS (status) != 0) { nbdkit_error ("%s: command failed with exit code %d", cmd, WEXITSTATUS (status)); return -1; } else if (WIFSIGNALED (status)) { nbdkit_error ("%s: command was killed by signal %d", cmd, WTERMSIG (status)); return -1; } else if (WIFSTOPPED (status)) { nbdkit_error ("%s: command was stopped by signal %d", cmd, WSTOPSIG (status)); return -1; } return 0; } #else /* WIN32 */ /* This assumes we're using Win32 system(). See: * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/system-wsystem?view=vs-2019 */ int exit_status_to_nbd_error (int status, const char *cmd) { if (status == 0) return 0; nbdkit_error ("%s: command failed: errno = %d", cmd, errno); return -1; } #endif /* WIN32 */ #ifndef WIN32 /* Set the FD_CLOEXEC flag on the given fd, if it is non-negative. * On failure, close fd and return -1; on success, return fd. * * Note that this function should ONLY be used on platforms that lack * atomic CLOEXEC support during fd creation (such as Haiku in 2019); * when using it as a fallback path, you must also consider how to * prevent fd leaks to plugins that want to fork(). */ int set_cloexec (int fd) { #if (defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2 && \ defined HAVE_ACCEPT4) nbdkit_error ("prefer creating fds with CLOEXEC atomically set"); close (fd); errno = EBADF; return -1; #else # if !defined __APPLE__ && \ (defined SOCK_CLOEXEC || defined HAVE_MKOSTEMP || defined HAVE_PIPE2 || \ defined HAVE_ACCEPT4) # error "Unexpected: your system has incomplete atomic CLOEXEC support" # endif int f; int err; if (fd == -1) return -1; f = fcntl (fd, F_GETFD); if (f == -1 || fcntl (fd, F_SETFD, f | FD_CLOEXEC) == -1) { err = errno; nbdkit_error ("fcntl: %m"); close (fd); errno = err; return -1; } return fd; #endif } #else /* WIN32 */ int set_cloexec (int fd) { return fd; } #endif /* WIN32 */ #ifndef WIN32 /* Set the O_NONBLOCK flag on the given fd, if it is non-negative. * On failure, close fd and return -1; on success, return fd. */ int set_nonblock (int fd) { int f; int err; if (fd == -1) return -1; f = fcntl (fd, F_GETFL); if (f == -1 || fcntl (fd, F_SETFL, f | O_NONBLOCK) == -1) { err = errno; nbdkit_error ("fcntl: %m"); close (fd); errno = err; return -1; } return fd; } #else /* WIN32 */ int set_nonblock (int fd) { return fd; } #endif /* WIN32 */ #ifndef WIN32 char * make_temporary_directory (void) { char template[] = "/tmp/nbdkitXXXXXX"; if (mkdtemp (template) == NULL) return NULL; return strdup (template); } #else /* WIN32 */ char * make_temporary_directory (void) { char tmppath[MAX_PATH]; char tmpname[MAX_PATH]; DWORD ret; ret = GetTempPath (MAX_PATH, tmppath); if (ret > MAX_PATH || ret == 0) { fprintf (stderr, "mkdtemp: GetTempPath: %lu\n", GetLastError ()); return NULL; } ret = GetTempFileName (tmppath, TEXT ("nbdkit"), 0, tmpname); if (!ret) { fprintf (stderr, "mkdtemp: GetTempFileName: %lu\n", GetLastError ()); return NULL; } /* The above function actually creates the file, so we must remove * it before creating the directory. Not ideal because it leaves a * small window for exploitation (XXX). */ unlink (tmpname); if (mkdir (tmpname) == -1) { fprintf (stderr, "mkdtemp: mkdir: %s: %lu\n", tmpname, GetLastError ()); return NULL; } return strdup (tmpname); } #endif /* WIN32 */ /* Returns true if this is a valid shell variable name. While shell * variables aren't environment variables, for this I used the * definition in "POSIX section 8.1 Environment Variable Definition", * but also allowing lowercase. See also * https://stackoverflow.com/questions/2821043 */ bool is_shell_variable (const char *name) { size_t i, len; len = strlen (name); if (len == 0) return false; /* Cannot start with a digit. */ if (ascii_isdigit (name[0])) return false; /* Must contain only ASCII alphanumeric and underscore. */ for (i = 0; i < len; ++i) { if (ascii_isalnum (name[i]) || name[i] == '_') continue; return false; } return true; } nbdkit-1.42.2/common/utils/utils.h0000644000175000017500000000451614676465664012533 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_UTILS_H #define NBDKIT_UTILS_H #include extern void shell_quote (const char *str, FILE *fp); extern void uri_quote (const char *str, FILE *fp); extern void c_string_quote (const char *str, FILE *fp); extern bool is_shell_variable (const char *name); extern int exit_status_to_nbd_error (int status, const char *cmd); extern int set_cloexec (int fd); extern int set_nonblock (int fd); extern char **copy_environ (char **env, ...) __attribute__ ((__sentinel__)); extern char *make_temporary_directory (void); extern ssize_t full_pread (int fd, void *buf, size_t count, off_t offset); extern ssize_t full_pwrite (int fd, const void *buf, size_t count, off_t offset); #ifndef WIN32 #include #include extern int64_t device_size (int fd, const struct stat *statbuf); #endif #endif /* NBDKIT_UTILS_H */ nbdkit-1.42.2/common/utils/vector.c0000644000175000017500000001142414623341243012636 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include "checked-overflow.h" #include "posix_memalign.h" #include "sysconf.h" #include "vector.h" static int calculate_capacity (struct generic_vector *v, size_t n, size_t itemsize, size_t *newcap_r, size_t *newbytes_r, bool exactly) { size_t reqcap, reqbytes, newcap, newbytes, t; /* New capacity requested. We must allocate this minimum (or fail). * reqcap = v->cap + n * reqbytes = reqcap * itemsize */ if (ADD_OVERFLOW (v->cap, n, &reqcap) || MUL_OVERFLOW (reqcap, itemsize, &reqbytes)) { errno = ENOMEM; return -1; } /* However for the sake of optimization, scale buffer by 3/2 so that * repeated reservations don't call realloc often. * newcap = v->cap + (v->cap + 1) / 2 * newbytes = newcap * itemsize */ if (exactly || ADD_OVERFLOW (v->cap, 1u, &t) || ADD_OVERFLOW (v->cap, t/2, &newcap) || MUL_OVERFLOW (newcap, itemsize, &newbytes) || newbytes < reqbytes) { /* If that either overflows or is less than the minimum requested, * fall back to the requested capacity. */ newcap = reqcap; newbytes = reqbytes; } *newcap_r = newcap; *newbytes_r = newbytes; return 0; } int generic_vector_reserve (struct generic_vector *v, size_t n, size_t itemsize, bool exactly) { void *newptr; size_t newcap, newbytes; if (calculate_capacity (v, n, itemsize, &newcap, &newbytes, exactly) == -1) return -1; newptr = realloc (v->ptr, newbytes); if (newptr == NULL) return -1; v->ptr = newptr; v->cap = newcap; return 0; } /* Always allocates a buffer which is page aligned (both base and size). */ int generic_vector_reserve_page_aligned (struct generic_vector *v, size_t n, size_t itemsize) { int r; void *newptr; size_t newcap, newbytes; long pagesize; size_t extra, extra_items; pagesize = sysconf (_SC_PAGESIZE); assert (pagesize > 1); assert (pagesize % itemsize == 0); if (calculate_capacity (v, n, itemsize, &newcap, &newbytes, true) == -1) return -1; /* If the new size (in bytes) is not a full page then we have to * round up to the next page. */ extra = newbytes & (pagesize - 1); if (extra > 0) { extra_items = (pagesize - extra) / itemsize; if (ADD_OVERFLOW (newcap, extra_items, &newcap) || ADD_OVERFLOW (newbytes, extra_items * itemsize, &newbytes)) { errno = ENOMEM; return -1; } } if ((r = posix_memalign (&newptr, pagesize, newbytes)) != 0) { errno = r; return -1; } /* How much to copy here? * * vector_reserve always makes the buffer larger so we don't have to * deal with the case of a shrinking buffer. * * Like the underlying realloc we do not have to zero the newly * reserved elements. * * However (like realloc) we have to copy the existing elements even * those that are not allocated and only reserved (between 'len' and * 'cap'). * * The spec of vector is not clear on the last two points, but * existing code depends on this undocumented behaviour. */ memcpy (newptr, v->ptr, v->cap * itemsize); free (v->ptr); v->ptr = newptr; v->cap = newcap; return 0; } nbdkit-1.42.2/common/utils/vector.h0000644000175000017500000003655714623341243012661 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Simple implementation of a vector. * * Appending to the end is cheap. Inserting in the middle is more * expensive. The vector can be a list of anything, eg. ints, * structs, pointers. * * The vector is implemented as a struct with three fields: * * struct { * *ptr; Pointer to array of items. * size_t len; Number of valid items (ptr[0] .. ptr[len-1]). * size_t cap; Capacity, size of the array allocated. * }; * typedef struct ; * * Note you can just access the struct fields directly. That is * intentional, they are not private! * * When defining a vector type you give the to use for the new * vector type, and the of each element: * * DEFINE_VECTOR_TYPE (, ); * * This also defines functions called "_reserve", * "_append", etc. * * _reserve (&vector, n) reserves n additional elements beyond * the current capacity. This is a wrapper around "realloc" and might * fail (returning -1). If it succeeds (returning 0) then you are * allowed to call _append (&vector, elem) up to n times and it * will not fail. * * _append (&vector, elem) appends the new element at the end of * the array (at ptr[len]), increasing the length. This may need to * reallocate the array if there is not sufficient capacity. * * _insert and _remove insert and remove single elements * in the middle of the array. _insert may have to extend the * array, so it may fail, while _remove can never fail. * * There are various other methods, see the macros below. * * For example, you could define a list of ints as: * * DEFINE_VECTOR_TYPE (int_vector, int); * int_vector myints = empty_vector; * * where "myints.ptr[]" will be an array of ints and "myints.len" will * be the number of ints. There are no get/set accessors. To iterate * over myints you can use the ".ptr" field directly: * * for (size_t i = 0; i < myints.len; ++i) * printf ("%d\n", myints.ptr[i]); * * Initializing with "empty_vector", or assigning the compound literal * "(int_vector)empty_vector", sets .ptr = NULL and .len = 0 * * Because the implementation uses realloc, the .ptr array may move, * so you should not save the address of array elements. * * There are predefined types in "string-vector.h" and * "const-string-vector.h" for storing lists of strings. */ #ifndef NBDKIT_VECTOR_H #define NBDKIT_VECTOR_H #include #include #include #include "compiler-macros.h" #include "static-assert.h" #ifdef __clang__ #pragma clang diagnostic ignored "-Wunused-function" #pragma clang diagnostic ignored "-Wduplicate-decl-specifier" #endif #define DEFINE_VECTOR_TYPE(name, type) \ struct name { \ type *ptr; /* Pointer to array of items. */ \ size_t len; /* Number of valid items in the array. */ \ size_t cap; /* Maximum number of items. */ \ }; \ typedef struct name name; \ \ /* Reserve n elements at the end of the vector. Note space is \ * allocated and capacity is increased, but the vector length is \ * not increased and the new elements are not initialized. \ */ \ static inline int __attribute__ ((__unused__)) \ name##_reserve (name *v, size_t n) \ { \ return generic_vector_reserve ((struct generic_vector *)v, n, \ sizeof (type), false); \ } \ \ /* Same as _reserve, but reserve exactly this number of elements \ * without any overhead. Useful if you know ahead of time that you \ * will never need to extend the vector. \ */ \ static inline int __attribute__ ((__unused__)) \ name##_reserve_exactly (name *v, size_t n) \ { \ return generic_vector_reserve ((struct generic_vector *)v, \ n, sizeof (type), true); \ } \ \ /* Same as _reserve, but the allocation will be page aligned. Note \ * that the machine page size must be divisible by sizeof (type). \ */ \ static inline int __attribute__ ((__unused__)) \ name##_reserve_page_aligned (name *v, size_t n) \ { \ return generic_vector_reserve_page_aligned ((struct generic_vector *)v, \ n, sizeof (type)); \ } \ \ /* Insert at i'th element. i=0 => beginning i=len => append */ \ static inline int __attribute__ ((__unused__)) \ name##_insert (name *v, type elem, size_t i) \ { \ assert (i <= v->len); \ if (v->len >= v->cap) { \ if (name##_reserve (v, 1) == -1) return -1; \ } \ memmove (&v->ptr[i+1], &v->ptr[i], (v->len-i) * sizeof (elem)); \ v->ptr[i] = elem; \ v->len++; \ return 0; \ } \ \ /* Append a new element to the end of the vector. */ \ static inline int __attribute__ ((__unused__)) \ name##_append (name *v, type elem) \ { \ return name##_insert (v, elem, v->len); \ } \ \ /* Remove i'th element. i=0 => beginning i=len-1 => end */ \ static inline void __attribute__ ((__unused__)) \ name##_remove (name *v, size_t i) \ { \ assert (i < v->len); \ memmove (&v->ptr[i], &v->ptr[i+1], (v->len-i-1) * sizeof (type)); \ v->len--; \ } \ \ /* Remove all elements and deallocate the vector. */ \ static inline void __attribute__ ((__unused__)) \ name##_reset (name *v) \ { \ free (v->ptr); \ v->ptr = NULL; \ v->len = v->cap = 0; \ } \ \ /* Iterate over the vector, calling f() on each element. */ \ static inline void __attribute__ ((__unused__)) \ name##_iter (name *v, void (*f) (type elem)) \ { \ size_t i; \ for (i = 0; i < v->len; ++i) \ f (v->ptr[i]); \ } \ \ /* Sort the elements of the vector. */ \ static inline void __attribute__ ((__unused__)) \ name##_sort (name *v, \ int (*compare) (const type *p1, const type *p2)) \ { \ qsort (v->ptr, v->len, sizeof (type), (void *) compare); \ } \ \ /* Search for an exactly matching element in the vector using a \ * binary search. Returns a pointer to the element or NULL. \ */ \ static inline type * __attribute__ ((__unused__)) \ name##_search (const name *v, const void *key, \ int (*compare) (const void *key, const type *v)) \ { \ return bsearch (key, v->ptr, v->len, sizeof (type), \ (void *) compare); \ } \ \ /* Make a new vector with the same elements. */ \ static inline int __attribute__ ((__unused__)) \ name##_duplicate (name *v, name *copy) \ { \ /* Note it's allowed for v and copy to be the same pointer. */ \ type *vptr = v->ptr; \ type *newptr; \ size_t len = v->len * sizeof (type); \ \ newptr = malloc (len); \ if (newptr == NULL) return -1; \ memcpy (newptr, vptr, len); \ copy->ptr = newptr; \ copy->len = copy->cap = v->len; \ return 0; \ } \ \ /* End with duplicate declaration, so callers must supply ';'. */ \ struct name #define empty_vector { .ptr = NULL, .len = 0, .cap = 0 } /* This macro should only be used if: * - the vector contains pointers, and * - the pointed-to objects are: * - neither const- nor volatile-qualified, and * - allocated with malloc() or equivalent. */ #define ADD_VECTOR_EMPTY_METHOD(name) \ /* Call free() on each element of the vector, then reset the vector. \ */ \ static inline void __attribute__ ((__unused__)) \ name##_empty (name *v) \ { \ size_t i; \ for (i = 0; i < v->len; ++i) { \ STATIC_ASSERT (TYPE_IS_POINTER (v->ptr[i]), \ _vector_contains_pointers); \ free (v->ptr[i]); \ } \ name##_reset (v); \ } \ \ /* Force callers to supply ';'. */ \ struct name /* Convenience macro tying together DEFINE_VECTOR_TYPE() and * ADD_VECTOR_EMPTY_METHOD(). Inherit and forward the requirement for a * trailing semicolon from ADD_VECTOR_EMPTY_METHOD() to the caller. */ #define DEFINE_POINTER_VECTOR_TYPE(name, type) \ DEFINE_VECTOR_TYPE (name, type); \ ADD_VECTOR_EMPTY_METHOD (name) struct generic_vector { void *ptr; size_t len; size_t cap; }; extern int generic_vector_reserve (struct generic_vector *v, size_t n, size_t itemsize, bool exactly); extern int generic_vector_reserve_page_aligned (struct generic_vector *v, size_t n, size_t itemsize); #endif /* NBDKIT_VECTOR_H */ nbdkit-1.42.2/common/utils/windows-compat.h0000644000175000017500000001245614534316443014327 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_WINDOWS_COMPAT_H #define NBDKIT_WINDOWS_COMPAT_H #ifdef WIN32 #include #include #include #include #include /* Note that this is part of Windows 10, but not yet available in * mingw-w64. */ #ifdef HAVE_AFUNIX_H #include #else /* This is the same as the definition in common/include/unix-path-max.h * so we should be fine here even if the other file was included. */ #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 #endif struct sockaddr_un { ADDRESS_FAMILY sun_family; char sun_path[UNIX_PATH_MAX]; }; #endif /* !HAVE_AFUNIX_H */ /* Windows doesn't have O_CLOEXEC, but it also doesn't have file * descriptors that can be inherited across exec. Similarly for * O_NOCTTY. */ #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif #ifndef O_NOCTTY #define O_NOCTTY 0 #endif /* Windows lacks certain errnos, so replace them here as * best we can. */ #ifndef EBADMSG #define EBADMSG EPROTO #endif #ifndef ESHUTDOWN #define ESHUTDOWN ECONNABORTED #endif /* Windows uses non-standard names for shutdown(how). */ #ifndef SHUT_WR #define SHUT_WR SD_SEND #define SHUT_RDWR SD_BOTH #endif /* This generated function translates Winsock errors into errno codes. */ extern int translate_winsock_error (const char *fn, int err); /* Add wrappers around the Winsock syscalls that nbdkit uses. */ extern int win_accept (int fd, struct sockaddr *addr, socklen_t *len); extern int win_bind (int fd, const struct sockaddr *addr, socklen_t len); extern int win_closesocket (int fd); extern int win_getpeername (int fd, struct sockaddr *addr, socklen_t *len); extern int win_listen (int fd, int backlog); extern int win_getsockopt (int fd, int level, int optname, void *optval, socklen_t *optlen); extern int win_recv (int fd, void *buf, size_t len, int flags); extern int win_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen); extern int win_socket (int domain, int type, int protocol); extern int win_send (int fd, const void *buf, size_t len, int flags); #define accept win_accept #define bind win_bind #define closesocket win_closesocket #define getpeername win_getpeername #define listen win_listen #define getsockopt win_getsockopt #define recv win_recv #define setsockopt win_setsockopt #define socket win_socket #define send win_send /* Windows has strange names for these functions. */ #define dup _dup #define dup2 _dup2 /* setenv replacement. */ #define setenv(k, v, replace) _putenv_s ((k), (v)); /* Unfortunately quite commonly used at the moment. Make it a common * macro so we can easily find places which need porting. * * Note: Don't use this for things which can never work on Windows * (eg. Unix socket support). Those should just give regular errors. */ #define NOT_IMPLEMENTED_ON_WINDOWS(feature) \ do { \ fprintf (stderr, "nbdkit: %s is not implemented for Windows.\n", feature); \ fprintf (stderr, "You can help by contributing to the Windows port,\n"); \ fprintf (stderr, "see nbdkit README in the source for how to\n"); \ fprintf (stderr, "contribute.\n"); \ exit (EXIT_FAILURE); \ } while (0) #else /* !WIN32 */ /* Windows doesn't have a generic function for closing anything, * instead you have to call closesocket on a SOCKET object. We would * like to #define close to point to the Windows alternative above, * but that's not possible because it breaks things like * backend->close. So instead the server code must call closesocket() * on anything that might be a socket. */ #define closesocket close #endif /* !WIN32 */ #endif /* NBDKIT_WINDOWS_COMPAT_H */ nbdkit-1.42.2/common/utils/windows-compat.c0000644000175000017500000001202414534316443014311 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #ifdef WIN32 #include #include #include #include #include #include "windows-compat.h" #undef accept #undef bind #undef closesocket #undef getpeername #undef listen #undef getsockopt #undef recv #undef setsockopt #undef socket #undef send #define GET_SOCKET_FROM_FD(fd) \ SOCKET sk = _get_osfhandle (fd); \ if (sk == INVALID_SOCKET) { \ errno = EBADF; \ return -1; \ } /* Sockets are non-blocking by default. Make them blocking. This * introduces a bunch of caveats, see: * http://www.sockets.com/winsock.htm#Overview_BlockingNonBlocking */ static int set_blocking (SOCKET sk) { u_long arg = 0; if (ioctlsocket (sk, FIONBIO, &arg) < 0) { errno = translate_winsock_error ("ioctlsocket", WSAGetLastError ()); return -1; } return 0; } int win_accept (int fd, struct sockaddr *addr, socklen_t *len) { SOCKET new_sk; GET_SOCKET_FROM_FD (fd); new_sk = accept (sk, addr, len); if (new_sk == INVALID_SOCKET) { errno = translate_winsock_error ("accept", WSAGetLastError ()); return -1; } if (set_blocking (new_sk) == -1) return -1; return _open_osfhandle ((intptr_t) new_sk, O_RDWR|O_BINARY); } int win_bind (int fd, const struct sockaddr *addr, socklen_t len) { GET_SOCKET_FROM_FD (fd); if (bind (sk, addr, len) < 0) { errno = translate_winsock_error ("bind", WSAGetLastError ()); return -1; } return 0; } int win_closesocket (int fd) { GET_SOCKET_FROM_FD (fd); if (closesocket (sk) < 0) { errno = translate_winsock_error ("closesocket", WSAGetLastError ()); return -1; } return 0; } int win_getpeername (int fd, struct sockaddr *addr, socklen_t *len) { GET_SOCKET_FROM_FD (fd); if (getpeername (sk, addr, len) < 0) { errno = translate_winsock_error ("getpeername", WSAGetLastError ()); return -1; } return 0; } int win_listen (int fd, int backlog) { GET_SOCKET_FROM_FD (fd); if (listen (sk, backlog) < 0) { errno = translate_winsock_error ("listen", WSAGetLastError ()); return -1; } return 0; } int win_getsockopt (int fd, int level, int optname, void *optval, socklen_t *optlen) { GET_SOCKET_FROM_FD (fd); if (getsockopt (sk, level, optname, optval, optlen) < 0) { errno = translate_winsock_error ("getsockopt", WSAGetLastError ()); return -1; } return 0; } int win_recv (int fd, void *buf, size_t len, int flags) { int r; GET_SOCKET_FROM_FD (fd); r = recv (sk, buf, len, flags); if (r < 0) { errno = translate_winsock_error ("recv", WSAGetLastError ()); return -1; } return r; } int win_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen) { GET_SOCKET_FROM_FD (fd); if (setsockopt (sk, level, optname, optval, optlen) < 0) { errno = translate_winsock_error ("setsockopt", WSAGetLastError ()); return -1; } return 0; } int win_socket (int domain, int type, int protocol) { SOCKET sk; sk = WSASocket (domain, type, protocol, NULL, 0, 0); if (sk == INVALID_SOCKET) { errno = translate_winsock_error ("socket", WSAGetLastError ()); return -1; } if (set_blocking (sk) == -1) return -1; return _open_osfhandle ((intptr_t) sk, O_RDWR|O_BINARY); } int win_send (int fd, const void *buf, size_t len, int flags) { int r; GET_SOCKET_FROM_FD (fd); r = send (sk, buf, len, flags); if (r < 0) { errno = translate_winsock_error ("send", WSAGetLastError ()); return -1; } return r; } #endif /* WIN32 */ nbdkit-1.42.2/common/utils/windows-errors.c0000444000175000017500000001352514771245505014352 /* Generated from windows-errors.txt */ #include #ifdef WIN32 #include #include #include #include int translate_winsock_error (const char *fn, int err) { nbdkit_debug ("%s: winsock error %d", fn, err); switch (err) { #if defined(WSA_INVALID_HANDLE) && defined(EBADF) case WSA_INVALID_HANDLE: return EBADF; #endif #if defined(WSA_NOT_ENOUGH_MEMORY) && defined(ENOMEM) case WSA_NOT_ENOUGH_MEMORY: return ENOMEM; #endif #if defined(WSA_INVALID_PARAMETER) && defined(EINVAL) case WSA_INVALID_PARAMETER: return EINVAL; #endif #if defined(WSA_OPERATION_ABORTED) && defined(ECONNABORTED) case WSA_OPERATION_ABORTED: return ECONNABORTED; #endif #if defined(WSA_IO_INCOMPLETE) && defined(EWOULDBLOCK) case WSA_IO_INCOMPLETE: return EWOULDBLOCK; #endif #if defined(WSA_IO_PENDING ) && defined(EWOULDBLOCK) case WSA_IO_PENDING : return EWOULDBLOCK; #endif #if defined(WSAEINTR ) && defined(EINTR) case WSAEINTR : return EINTR; #endif #if defined(WSAEBADF ) && defined(EBADF) case WSAEBADF : return EBADF; #endif #if defined(WSAEACCES ) && defined(EACCES) case WSAEACCES : return EACCES; #endif #if defined(WSAEFAULT ) && defined(EFAULT) case WSAEFAULT : return EFAULT; #endif #if defined(WSAEINVAL ) && defined(EINVAL) case WSAEINVAL : return EINVAL; #endif #if defined(WSAEMFILE ) && defined(EMFILE) case WSAEMFILE : return EMFILE; #endif #if defined(WSAEWOULDBLOCK ) && defined(EWOULDBLOCK) case WSAEWOULDBLOCK : return EWOULDBLOCK; #endif #if defined(WSAEINPROGRESS ) && defined(EINPROGRESS) case WSAEINPROGRESS : return EINPROGRESS; #endif #if defined(WSAEALREADY ) && defined(EALREADY) case WSAEALREADY : return EALREADY; #endif #if defined(WSAENOTSOCK ) && defined(ENOTSOCK) case WSAENOTSOCK : return ENOTSOCK; #endif #if defined(WSAEDESTADDRREQ ) && defined(EDESTADDRREQ) case WSAEDESTADDRREQ : return EDESTADDRREQ; #endif #if defined(WSAEMSGSIZE ) && defined(EMSGSIZE) case WSAEMSGSIZE : return EMSGSIZE; #endif #if defined(WSAEPROTOTYPE ) && defined(EPROTOTYPE) case WSAEPROTOTYPE : return EPROTOTYPE; #endif #if defined(WSAENOPROTOOPT ) && defined(ENOPROTOOPT) case WSAENOPROTOOPT : return ENOPROTOOPT; #endif #if defined(WSAEPROTONOSUPPORT) && defined(EPROTONOSUPPORT) case WSAEPROTONOSUPPORT: return EPROTONOSUPPORT; #endif #if defined(WSAESOCKTNOSUPPORT) && defined(ESOCKTNOSUPPORT) case WSAESOCKTNOSUPPORT: return ESOCKTNOSUPPORT; #endif #if defined(WSAEOPNOTSUPP ) && defined(EOPNOTSUPP) case WSAEOPNOTSUPP : return EOPNOTSUPP; #endif #if defined(WSAEPFNOSUPPORT ) && defined(EPFNOSUPPORT) case WSAEPFNOSUPPORT : return EPFNOSUPPORT; #endif #if defined(WSAEAFNOSUPPORT ) && defined(EAFNOSUPPORT) case WSAEAFNOSUPPORT : return EAFNOSUPPORT; #endif #if defined(WSAEADDRINUSE ) && defined(EADDRINUSE) case WSAEADDRINUSE : return EADDRINUSE; #endif #if defined(WSAEADDRNOTAVAIL) && defined(EADDRNOTAVAIL) case WSAEADDRNOTAVAIL: return EADDRNOTAVAIL; #endif #if defined(WSAENETDOWN ) && defined(ENETDOWN) case WSAENETDOWN : return ENETDOWN; #endif #if defined(WSAENETUNREACH ) && defined(ENETUNREACH) case WSAENETUNREACH : return ENETUNREACH; #endif #if defined(WSAENETRESET ) && defined(ENETRESET) case WSAENETRESET : return ENETRESET; #endif #if defined(WSAECONNABORTED ) && defined(ECONNABORTED) case WSAECONNABORTED : return ECONNABORTED; #endif #if defined(WSAECONNRESET ) && defined(ECONNRESET) case WSAECONNRESET : return ECONNRESET; #endif #if defined(WSAENOBUFS ) && defined(ENOBUFS) case WSAENOBUFS : return ENOBUFS; #endif #if defined(WSAEISCONN ) && defined(EISCONN) case WSAEISCONN : return EISCONN; #endif #if defined(WSAENOTCONN ) && defined(ENOTCONN) case WSAENOTCONN : return ENOTCONN; #endif #if defined(WSAESHUTDOWN ) && defined(ESHUTDOWN) case WSAESHUTDOWN : return ESHUTDOWN; #endif #if defined(WSAETOOMANYREFS ) && defined(ETOOMANYREFS) case WSAETOOMANYREFS : return ETOOMANYREFS; #endif #if defined(WSAETIMEDOUT ) && defined(ETIMEDOUT) case WSAETIMEDOUT : return ETIMEDOUT; #endif #if defined(WSAECONNREFUSED ) && defined(ECONNREFUSED) case WSAECONNREFUSED : return ECONNREFUSED; #endif #if defined(WSAELOOP ) && defined(ELOOP) case WSAELOOP : return ELOOP; #endif #if defined(WSAENAMETOOLONG ) && defined(ENAMETOOLONG) case WSAENAMETOOLONG : return ENAMETOOLONG; #endif #if defined(WSAEHOSTDOWN ) && defined(EHOSTDOWN) case WSAEHOSTDOWN : return EHOSTDOWN; #endif #if defined(WSAEHOSTUNREACH ) && defined(EHOSTUNREACH) case WSAEHOSTUNREACH : return EHOSTUNREACH; #endif #if defined(WSAENOTEMPTY ) && defined(ENOTEMPTY) case WSAENOTEMPTY : return ENOTEMPTY; #endif #if defined(WSAEPROCLIM ) && defined(EMFILE) case WSAEPROCLIM : return EMFILE; #endif #if defined(WSAEUSERS ) && defined(EUSERS) case WSAEUSERS : return EUSERS; #endif #if defined(WSAEDQUOT ) && defined(EDQUOT) case WSAEDQUOT : return EDQUOT; #endif #if defined(WSAESTALE ) && defined(ESTALE) case WSAESTALE : return ESTALE; #endif #if defined(WSAEREMOTE ) && defined(EREMOTE) case WSAEREMOTE : return EREMOTE; #endif #if defined(WSASYSNOTREADY ) && defined(EINVAL) case WSASYSNOTREADY : return EINVAL; #endif #if defined(WSAVERNOTSUPPORTED) && defined(EINVAL) case WSAVERNOTSUPPORTED: return EINVAL; #endif #if defined(WSANOTINITIALISED) && defined(EINVAL) case WSANOTINITIALISED: return EINVAL; #endif #if defined(WSAEDISCON ) && defined(ESHUTDOWN) case WSAEDISCON : return ESHUTDOWN; #endif #if defined(WSAENOMORE ) && defined(ESHUTDOWN) case WSAENOMORE : return ESHUTDOWN; #endif #if defined(WSAECANCELLED ) && defined(ECANCELED) case WSAECANCELLED : return ECANCELED; #endif default: return err > 10000 && err < 10025 ? err - 10000 : EINVAL; } } #endif /* WIN32 */ nbdkit-1.42.2/common/utils/test-quotes.c0000644000175000017500000000645514534316443013646 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Unit tests of utils quoting code. */ #include #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include #include "array-size.h" #include "utils.h" #ifdef HAVE_OPEN_MEMSTREAM static bool test (const char *orig, const char *fnname, void (*fn) (const char *, FILE *), const char *exp) { char *str = NULL; size_t str_len = 0; FILE *fp; fp = open_memstream (&str, &str_len); assert (fp); fn (orig, fp); if (fclose (fp) == EOF) assert (false); if (str_len == 0 && !str) str = strdup (""); assert (str); if (strcmp (str, exp)) { fprintf (stderr, "%s failed, got '%s' expected '%s'\n", fnname, str, exp); free (str); return true; } free (str); return false; } int main (void) { struct { const char *orig; const char *shell; const char *uri; } tests[] = { { "a-b_c.0", "a-b_c.0", "a-b_c.0" }, { "/Safe/Path", "/Safe/Path", "/Safe/Path" }, { "a~b", "\"a~b\"", "a~b" }, { "", "\"\"", "" }, { "a=b", "a=b", "a%3Db" }, /* XXX shell wrong if used as argv[0] */ { "a;b", "\"a;b\"", "a%3Bb" }, { "a b", "\"a b\"", "a%20b" }, { "a%b", "\"a%b\"", "a%25b" }, { "a'b\"c$d`e\\f", "\"a'b\\\"c\\$d\\`e\\\\f\"", "a%27b%22c%24d%60e%5Cf" }, }; size_t i; bool fail = false; for (i = 0; i < ARRAY_SIZE (tests); i++) { fail |= test (tests[i].orig, "shell_quote", shell_quote, tests[i].shell); fail |= test (tests[i].orig, "uri_quote", uri_quote, tests[i].uri); } return fail ? EXIT_FAILURE : EXIT_SUCCESS; } #else /* !OPEN_MEMSTREAM */ int main (int argc, char *argv[]) { fprintf (stderr, "%s: test skipped because no support for open_memstream\n", argv[0]); exit (77); } #endif /* !OPEN_MEMSTREAM */ nbdkit-1.42.2/common/utils/test-vector.c0000644000175000017500000001531314623341243013614 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include "bench.h" #include "const-string-vector.h" #include "nbdkit-string.h" #include "string-vector.h" #include "vector.h" #define APPENDS 1000000 DEFINE_VECTOR_TYPE (int64_vector, int64_t); DEFINE_VECTOR_TYPE (uint32_vector, uint32_t); static int compare (const int64_t *a, const int64_t *b) { return (*a > *b) - (*a < *b); } static void test_int64_vector (void) { int64_vector v = empty_vector; size_t i; int64_t tmp, *p; for (i = 0; i < 10; ++i) { int r = int64_vector_insert (&v, i, 0); assert (r == 0); } for (i = 0; i < 10; ++i) assert (v.ptr[i] == 9 - i); int64_vector_sort (&v, compare); for (i = 0; i < 10; ++i) assert (v.ptr[i] == i); int64_vector_remove (&v, 1); assert (v.len == 9); assert (v.ptr[1] == 2); tmp = 10; p = int64_vector_search (&v, &tmp, (void*) compare); assert (p == NULL); tmp = 8; p = int64_vector_search (&v, &tmp, (void*) compare); assert (p == &v.ptr[7]); free (v.ptr); } static void test_string_concat (string *s, const char *append) { const size_t len = strlen (append); size_t i; int r; r = string_reserve (s, len); assert (r == 0); /* The contract is that after calling string_reserve with 'n', we * can append up to 'n' items to the vector without failing. */ for (i = 0; i < len; ++i) { r = string_append (s, append[i]); assert (r == 0); } } static void test_string (void) { string s = empty_vector; int r; char nul = 0; test_string_concat (&s, "hello"); test_string_concat (&s, " world"); r = string_append (&s, nul); assert (r == 0); assert (strcmp (s.ptr, "hello world") == 0); assert (s.len == 12); /* hello + space + world + \0 */ free (s.ptr); } /* Same as above, but using string_reserve_exactly. */ static void test_string_concat_exactly (string *s, const char *append) { const size_t len = strlen (append); size_t i; int r; r = string_reserve_exactly (s, len); assert (r == 0); /* The contract is that after calling string_reserve with 'n', we * can append up to 'n' items to the vector without failing. */ for (i = 0; i < len; ++i) { r = string_append (s, append[i]); assert (r == 0); } } static void test_string_exactly (void) { string s = empty_vector; int r; char nul = 0; test_string_concat_exactly (&s, "hello"); test_string_concat_exactly (&s, " world"); r = string_append (&s, nul); assert (r == 0); assert (strcmp (s.ptr, "hello world") == 0); assert (s.len == 12); /* hello + space + world + \0 */ free (s.ptr); } static void test_string_vector (void) { CLEANUP_FREE_STRING_VECTOR string_vector v = empty_vector; size_t i; int r; for (i = 0; i < 10; ++i) { char *s; r = asprintf (&s, "number %zu", i); assert (r >= 0); r = string_vector_append (&v, s); assert (r == 0); } /* NULL-terminate the strings. */ r = string_vector_append (&v, NULL); assert (r == 0); /* Now print them. */ for (i = 0; v.ptr[i] != NULL; ++i) printf ("%s\n", v.ptr[i]); assert (i == 10); } static void test_const_string_vector (void) { CLEANUP_FREE_CONST_STRING_VECTOR const_string_vector v = empty_vector; size_t i; int r; r = const_string_vector_append (&v, "abc"); assert (r >= 0); r = const_string_vector_append (&v, "def"); assert (r >= 0); r = const_string_vector_append (&v, "ghi"); assert (r >= 0); r = const_string_vector_append (&v, "jkl"); assert (r >= 0); /* NULL-terminate the strings. */ r = const_string_vector_append (&v, NULL); assert (r == 0); /* Now print them. */ for (i = 0; v.ptr[i] != NULL; ++i) printf ("%s\n", v.ptr[i]); assert (i == 4); } /* Test size_t overflow. */ static void test_overflow (void) { string s = empty_vector; int r; /* It should be impossible to reserve SIZE_MAX - epsilon. */ r = string_reserve (&s, SIZE_MAX - 10000); assert (r == -1); assert (errno == ENOMEM); } static void bench_reserve (void) { uint32_vector v = empty_vector; struct bench b; uint32_t i; bench_start (&b); uint32_vector_reserve (&v, APPENDS); for (i = 0; i < APPENDS; i++) { uint32_vector_append (&v, i); } bench_stop (&b); assert (v.ptr[APPENDS-1] == APPENDS-1); free (v.ptr); printf ("bench_reserve: %d appends in %.6f s\n", APPENDS, bench_sec (&b)); } static void bench_append (void) { uint32_vector v = empty_vector; struct bench b; uint32_t i; bench_start (&b); for (i = 0; i < APPENDS; i++) { uint32_vector_append (&v, i); } bench_stop (&b); assert (v.ptr[APPENDS - 1] == APPENDS - 1); free (v.ptr); printf ("bench_append: %d appends in %.6f s\n", APPENDS, bench_sec (&b)); } int main (int argc, char *argv[]) { const char *s; bool bench; s = getenv ("NBDKIT_BENCH"); bench = s && strcmp (s, "1") == 0; if (!bench) { /* Do normal tests. */ test_int64_vector (); test_string (); test_string_exactly (); test_string_vector (); test_const_string_vector (); test_overflow (); } else { /* Do benchmarks. */ bench_reserve (); bench_append (); } return 0; } nbdkit-1.42.2/common/utils/bench.h0000644000175000017500000000421014534316443012420 /* libnbd * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef LIBNBD_BENCH_H #define LIBNBD_BENCH_H #include #define MICROSECONDS 1000000 struct bench { struct timeval start, stop; }; static inline void bench_start (struct bench *b) { gettimeofday (&b->start, NULL); } static inline void bench_stop (struct bench *b) { gettimeofday (&b->stop, NULL); } static inline double bench_sec (struct bench *b) { struct timeval dt; dt.tv_sec = b->stop.tv_sec - b->start.tv_sec; dt.tv_usec = b->stop.tv_usec - b->start.tv_usec; if (dt.tv_usec < 0) { dt.tv_sec -= 1; dt.tv_usec += MICROSECONDS; } return ((double)dt.tv_sec * MICROSECONDS + dt.tv_usec) / MICROSECONDS; } #endif /* LIBNBD_BENCH_H */ nbdkit-1.42.2/common/utils/windows-errors.txt0000644000175000017500000000664014534316443014746 # Winsock error to errno code mapping. # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # The main reference is: # https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 # This was originally written by hand, but I also referenced libvirt's # and Gnulib's choices of mappings. WSA_INVALID_HANDLE EBADF WSA_NOT_ENOUGH_MEMORY ENOMEM WSA_INVALID_PARAMETER EINVAL WSA_OPERATION_ABORTED ECONNABORTED # These two are only kind of correct. WSA_IO_INCOMPLETE EWOULDBLOCK WSA_IO_PENDING EWOULDBLOCK WSAEINTR EINTR WSAEBADF EBADF WSAEACCES EACCES WSAEFAULT EFAULT WSAEINVAL EINVAL WSAEMFILE EMFILE WSAEWOULDBLOCK EWOULDBLOCK WSAEINPROGRESS EINPROGRESS WSAEALREADY EALREADY WSAENOTSOCK ENOTSOCK WSAEDESTADDRREQ EDESTADDRREQ WSAEMSGSIZE EMSGSIZE WSAEPROTOTYPE EPROTOTYPE WSAENOPROTOOPT ENOPROTOOPT WSAEPROTONOSUPPORT EPROTONOSUPPORT WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT WSAEOPNOTSUPP EOPNOTSUPP WSAEPFNOSUPPORT EPFNOSUPPORT WSAEAFNOSUPPORT EAFNOSUPPORT WSAEADDRINUSE EADDRINUSE WSAEADDRNOTAVAIL EADDRNOTAVAIL WSAENETDOWN ENETDOWN WSAENETUNREACH ENETUNREACH WSAENETRESET ENETRESET WSAECONNABORTED ECONNABORTED WSAECONNRESET ECONNRESET WSAENOBUFS ENOBUFS WSAEISCONN EISCONN WSAENOTCONN ENOTCONN WSAESHUTDOWN ESHUTDOWN WSAETOOMANYREFS ETOOMANYREFS WSAETIMEDOUT ETIMEDOUT WSAECONNREFUSED ECONNREFUSED WSAELOOP ELOOP WSAENAMETOOLONG ENAMETOOLONG WSAEHOSTDOWN EHOSTDOWN WSAEHOSTUNREACH EHOSTUNREACH WSAENOTEMPTY ENOTEMPTY # This really means "too many processes" but this is the closest I could find. WSAEPROCLIM EMFILE WSAEUSERS EUSERS WSAEDQUOT EDQUOT WSAESTALE ESTALE WSAEREMOTE EREMOTE # The next three are respectively: Didn't call WSAStartup, Winsock # version is unsupported, and WSAStartup failed. WSASYSNOTREADY EINVAL WSAVERNOTSUPPORTED EINVAL WSANOTINITIALISED EINVAL WSAEDISCON ESHUTDOWN WSAENOMORE ESHUTDOWN WSAECANCELLED ECANCELED # There are a bunch more after this but they all seem pretty obscure. # Unknown errors are mapped to EIO and a debug message is printed so # we have the original error. nbdkit-1.42.2/common/allocators/0000755000175000017500000000000014771247241012260 5nbdkit-1.42.2/common/allocators/Makefile.am0000644000175000017500000000401514534316443014232 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk noinst_LTLIBRARIES = liballocators.la liballocators_la_SOURCES = \ allocator.c \ allocator.h \ allocator-internal.h \ malloc.c \ sparse.c \ zstd.c \ $(NULL) liballocators_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ $(NULL) liballocators_la_CFLAGS = $(WARNINGS_CFLAGS) liballocators_la_LIBADD = if HAVE_LIBZSTD liballocators_la_CFLAGS += $(LIBZSTD_CFLAGS) liballocators_la_LIBADD += $(LIBZSTD_LIBS) endif nbdkit-1.42.2/common/allocators/Makefile.in0000644000175000017500000007404014771245445014256 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_LIBZSTD_TRUE@am__append_1 = $(LIBZSTD_CFLAGS) @HAVE_LIBZSTD_TRUE@am__append_2 = $(LIBZSTD_LIBS) subdir = common/allocators ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = @HAVE_LIBZSTD_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) liballocators_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__objects_1 = am_liballocators_la_OBJECTS = liballocators_la-allocator.lo \ liballocators_la-malloc.lo liballocators_la-sparse.lo \ liballocators_la-zstd.lo $(am__objects_1) liballocators_la_OBJECTS = $(am_liballocators_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = liballocators_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(liballocators_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/liballocators_la-allocator.Plo \ ./$(DEPDIR)/liballocators_la-malloc.Plo \ ./$(DEPDIR)/liballocators_la-sparse.Plo \ ./$(DEPDIR)/liballocators_la-zstd.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liballocators_la_SOURCES) DIST_SOURCES = $(liballocators_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll noinst_LTLIBRARIES = liballocators.la liballocators_la_SOURCES = \ allocator.c \ allocator.h \ allocator-internal.h \ malloc.c \ sparse.c \ zstd.c \ $(NULL) liballocators_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ $(NULL) liballocators_la_CFLAGS = $(WARNINGS_CFLAGS) $(am__append_1) liballocators_la_LIBADD = $(am__append_2) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/allocators/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/allocators/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } liballocators.la: $(liballocators_la_OBJECTS) $(liballocators_la_DEPENDENCIES) $(EXTRA_liballocators_la_DEPENDENCIES) $(AM_V_CCLD)$(liballocators_la_LINK) $(liballocators_la_OBJECTS) $(liballocators_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liballocators_la-allocator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liballocators_la-malloc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liballocators_la-sparse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liballocators_la-zstd.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< liballocators_la-allocator.lo: allocator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -MT liballocators_la-allocator.lo -MD -MP -MF $(DEPDIR)/liballocators_la-allocator.Tpo -c -o liballocators_la-allocator.lo `test -f 'allocator.c' || echo '$(srcdir)/'`allocator.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liballocators_la-allocator.Tpo $(DEPDIR)/liballocators_la-allocator.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='allocator.c' object='liballocators_la-allocator.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -c -o liballocators_la-allocator.lo `test -f 'allocator.c' || echo '$(srcdir)/'`allocator.c liballocators_la-malloc.lo: malloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -MT liballocators_la-malloc.lo -MD -MP -MF $(DEPDIR)/liballocators_la-malloc.Tpo -c -o liballocators_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liballocators_la-malloc.Tpo $(DEPDIR)/liballocators_la-malloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc.c' object='liballocators_la-malloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -c -o liballocators_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c liballocators_la-sparse.lo: sparse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -MT liballocators_la-sparse.lo -MD -MP -MF $(DEPDIR)/liballocators_la-sparse.Tpo -c -o liballocators_la-sparse.lo `test -f 'sparse.c' || echo '$(srcdir)/'`sparse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liballocators_la-sparse.Tpo $(DEPDIR)/liballocators_la-sparse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sparse.c' object='liballocators_la-sparse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -c -o liballocators_la-sparse.lo `test -f 'sparse.c' || echo '$(srcdir)/'`sparse.c liballocators_la-zstd.lo: zstd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -MT liballocators_la-zstd.lo -MD -MP -MF $(DEPDIR)/liballocators_la-zstd.Tpo -c -o liballocators_la-zstd.lo `test -f 'zstd.c' || echo '$(srcdir)/'`zstd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liballocators_la-zstd.Tpo $(DEPDIR)/liballocators_la-zstd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zstd.c' object='liballocators_la-zstd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liballocators_la_CPPFLAGS) $(CPPFLAGS) $(liballocators_la_CFLAGS) $(CFLAGS) -c -o liballocators_la-zstd.lo `test -f 'zstd.c' || echo '$(srcdir)/'`zstd.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/liballocators_la-allocator.Plo -rm -f ./$(DEPDIR)/liballocators_la-malloc.Plo -rm -f ./$(DEPDIR)/liballocators_la-sparse.Plo -rm -f ./$(DEPDIR)/liballocators_la-zstd.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/liballocators_la-allocator.Plo -rm -f ./$(DEPDIR)/liballocators_la-malloc.Plo -rm -f ./$(DEPDIR)/liballocators_la-sparse.Plo -rm -f ./$(DEPDIR)/liballocators_la-zstd.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/allocators/allocator.c0000644000175000017500000001055414534316443014327 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "allocator.h" #include "allocator-internal.h" #include "strndup.h" #include "vector.h" /* The list of registered allocators. */ DEFINE_VECTOR_TYPE (allocator_list, const struct allocator_functions *); static allocator_list allocators = empty_vector; void register_allocator (const struct allocator_functions *f) { if (allocator_list_append (&allocators, f) == -1) { perror ("realloc"); exit (EXIT_FAILURE); } } static void free_key_value (struct key_value kv) { free (kv.key); free (kv.value); } static void free_allocator_parameters (allocator_parameters *params) { allocator_parameters_iter (params, free_key_value); free (params->ptr); } /* The type may be followed by parameters "type,key=value[,...]" */ static int parse_parameters (const char *type, size_t *type_len, allocator_parameters *params) { size_t i, j, len; *type_len = strcspn (type, ","); nbdkit_debug ("allocator: %*s", (int) *type_len, type); /* Split the parameters. */ for (i = *type_len; type[i] == ',';) { struct key_value kv; i++; len = strcspn (&type[i], ","); if (len == 0) { i++; continue; } j = strcspn (&type[i], "="); if (j == 0) { nbdkit_error ("invalid allocator parameter"); free_allocator_parameters (params); return -1; } if (j < len) { kv.key = strndup (&type[i], j); kv.value = strndup (&type[i+j+1], len-j-1); } else { kv.key = strndup (&type[i], len); kv.value = strdup ("1"); } if (kv.key == NULL || kv.value == NULL) { nbdkit_error ("strdup: %m"); free (kv.key); free (kv.value); free_allocator_parameters (params); return -1; } nbdkit_debug ("allocator parameter: %s=%s", kv.key, kv.value); if (allocator_parameters_append (params, kv) == -1) { nbdkit_error ("realloc: %m"); free_allocator_parameters (params); return -1; } i += len; } return 0; } struct allocator * create_allocator (const char *type, bool debug) { struct allocator *ret = NULL; allocator_parameters params = empty_vector; size_t i, type_len; if (parse_parameters (type, &type_len, ¶ms) == -1) return NULL; /* See if we can find the allocator. */ for (i = 0; i < allocators.len; ++i) { if (strncmp (type, allocators.ptr[i]->type, type_len) == 0) { ret = allocators.ptr[i]->create (¶ms); break; } } if (ret == NULL) nbdkit_error ("unknown allocator \"%s\"", type); /* Free the parameters allocated above. */ free_allocator_parameters (¶ms); if (ret) { ret->debug = debug; ret->f = allocators.ptr[i]; } return ret; } void cleanup_free_allocator (struct allocator **ap) { struct allocator *a = *ap; if (a && a->f) a->f->free (a); } nbdkit-1.42.2/common/allocators/allocator.h0000644000175000017500000001313114534316443014326 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* This defines the generic allocator interface used by * nbdkit-memory-plugin (and elsewhere) allocator=. It is * implemented by specific allocators such as sparse.c. * * All allocators have an implicit size and grow when required. * * All allocators do their own locking if required. */ #ifndef NBDKIT_ALLOCATOR_H #define NBDKIT_ALLOCATOR_H #include #include struct nbdkit_extents; struct allocator_functions { /* Allocator type (eg. "sparse"). * This does not include the parameters. */ const char *type; /* Preferred block size. */ uint32_t preferred; /* Private function called to create an allocator. It should return * a new struct which is at least as large as struct allocator. It * may have extra fields for the specific allocator to use. */ struct allocator *(*create) (const void *); /* Free the allocator instance. */ void (*free) (struct allocator *a); /* Set the size hint. The size hint is used in various ways by some * allocators, and ignored by others. * * The sparse and zstd array allocators ignore the size hint. * * The malloc allocator uses it to reserve the expected size of disk * in memory (especially important if using mlock so we fail during * start-up if there's not enough RAM). * * Note this does not set or enforce the virtual size of the disk, * nor does it implement bounds checking. */ int (*set_size_hint) (struct allocator *a, uint64_t size) __attribute__ ((__nonnull__ (1))); /* Read bytes from [offset, offset+count-1] and copy into buf. */ int (*read) (struct allocator *a, void *buf, uint64_t count, uint64_t offset) __attribute__ ((__nonnull__ (1, 2))); /* Write bytes from buf to [offset, offset+count-1]. Because this * can allocate memory, it can fail (returning -1). */ int (*write) (struct allocator *a, const void *buf, uint64_t count, uint64_t offset) __attribute__ ((__nonnull__ (1, 2))); /* Fill range [offset, offset+count-1] with a single byte ‘c’. * If c == '\0', this is the same as .zero below. */ int (*fill) (struct allocator *a, char c, uint64_t count, uint64_t offset) __attribute__ ((__nonnull__ (1))); /* Zero range [offset, offset+count-1]. For all allocators zero and * trim are the same operation. */ int (*zero) (struct allocator *a, uint64_t count, uint64_t offset) __attribute__ ((__nonnull__ (1))); /* Blit (copy) between two allocators. Copy count bytes from * a1.[offset1, offset1+count-1] to a2.[offset2, offset2+count-1]. * * Note you have to call the destination blit function, ie: * a2->blit (a1, a2, ...) * * It's permitted for the allocators to have different types. * However you cannot use this to copy within a single allocator * (because of locks), ie. a1 must != a2. */ int (*blit) (struct allocator *a1, struct allocator *a2, uint64_t count, uint64_t offset1, uint64_t offset2) __attribute__ ((__nonnull__ (1, 2))); /* Return information about allocated pages and holes. */ int (*extents) (struct allocator *a, uint64_t count, uint64_t offset, struct nbdkit_extents *extents) __attribute__ ((__nonnull__ (1, 4))); }; struct allocator { const struct allocator_functions *f; /* Debug flag. */ bool debug; }; /* Create a new allocator, usually from the type passed in the * allocator= parameter on the nbdkit command line (but you can * also create your own internal allocators this way). * * The debug parameter can be attached to a plugin-specific -D option * to provide extra debugging. * * Note that the type pointer is copied to the first field of the * returned struct allocator, so it must be statically allocated (or * at least live as long as the allocator). * * On error, calls nbdkit_error and returns NULL. */ extern struct allocator *create_allocator (const char *type, bool debug) __attribute__ ((__nonnull__ (1))); #define CLEANUP_FREE_ALLOCATOR \ __attribute__ ((cleanup (cleanup_free_allocator))) extern void cleanup_free_allocator (struct allocator **ap); #endif /* NBDKIT_ALLOCATOR_H */ nbdkit-1.42.2/common/allocators/allocator-internal.h0000644000175000017500000000342314534316443016143 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_ALLOCATOR_INTERNAL_H #define NBDKIT_ALLOCATOR_INTERNAL_H #include "vector.h" struct key_value { char *key, *value; }; DEFINE_VECTOR_TYPE (allocator_parameters, struct key_value); extern void register_allocator (const struct allocator_functions *); #endif /* NBDKIT_ALLOCATOR_INTERNAL_H */ nbdkit-1.42.2/common/allocators/malloc.c0000644000175000017500000002060114534316443013610 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #ifdef HAVE_SYS_MMAN_H #include #endif #include #include #include "cleanup.h" #include "vector.h" #include "allocator.h" #include "allocator-internal.h" /* This allocator implements a direct-mapped non-sparse RAM disk using * malloc, with optional mlock. */ DEFINE_VECTOR_TYPE (bytearray, uint8_t); struct m_alloc { struct allocator a; /* Must come first. */ bool use_mlock; /* Byte array (vector) implementing the direct-mapped disk. Note we * don't use the .size field. Accesses must be protected by the * lock since writes may try to extend the array. */ pthread_rwlock_t lock; bytearray ba; }; static void m_alloc_free (struct allocator *a) { struct m_alloc *ma = (struct m_alloc *) a; if (ma) { free (ma->ba.ptr); pthread_rwlock_destroy (&ma->lock); free (ma); } } /* Extend the underlying bytearray if needed. */ static int extend_without_mlock (struct m_alloc *ma, uint64_t new_size) { size_t old_size, n; if (ma->ba.cap < new_size) { old_size = ma->ba.cap; n = new_size - ma->ba.cap; if (bytearray_reserve (&ma->ba, n) == -1) { nbdkit_error ("realloc: %m"); return -1; } /* Initialize the newly allocated memory to 0. */ memset (ma->ba.ptr + old_size, 0, n); } return 0; } #ifdef HAVE_MLOCK static int extend_with_mlock (struct m_alloc *ma, uint64_t new_size) { size_t old_size, n; if (ma->ba.cap < new_size) { old_size = ma->ba.cap; n = new_size - ma->ba.cap; #ifdef HAVE_MUNLOCK /* Since the memory might be moved by realloc, we must unlock the * original array. */ if (ma->use_mlock && ma->ba.ptr != NULL) munlock (ma->ba.ptr, ma->ba.cap); #endif if (bytearray_reserve_page_aligned (&ma->ba, n) == -1) { nbdkit_error ("realloc: %m"); return -1; } /* Initialize the newly allocated memory to 0. */ memset (ma->ba.ptr + old_size, 0, n); if (mlock (ma->ba.ptr, ma->ba.cap) == -1) { nbdkit_error ("allocator=malloc: mlock: %m"); return -1; } } return 0; } #endif /* HAVE_MLOCK */ static int extend (struct m_alloc *ma, uint64_t new_size) { ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&ma->lock); #ifdef HAVE_MLOCK if (ma->use_mlock) return extend_with_mlock (ma, new_size); #endif return extend_without_mlock (ma, new_size); } static int m_alloc_set_size_hint (struct allocator *a, uint64_t size_hint) { struct m_alloc *ma = (struct m_alloc *) a; return extend (ma, size_hint); } static int m_alloc_read (struct allocator *a, void *buf, uint64_t count, uint64_t offset) { struct m_alloc *ma = (struct m_alloc *) a; ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&ma->lock); /* Avoid reading beyond the end of the allocated array. Return * zeroes for that part. */ if (offset >= ma->ba.cap) memset (buf, 0, count); else if (offset + count > ma->ba.cap) { memcpy (buf, ma->ba.ptr + offset, ma->ba.cap - offset); memset (buf + ma->ba.cap - offset, 0, offset + count - ma->ba.cap); } else memcpy (buf, ma->ba.ptr + offset, count); return 0; } static int m_alloc_write (struct allocator *a, const void *buf, uint64_t count, uint64_t offset) { struct m_alloc *ma = (struct m_alloc *) a; if (extend (ma, offset+count) == -1) return -1; /* This is correct: Even though we are writing, we only need to * acquire the read lock here. The write lock applies to changing * the metadata and it was acquired if we called extend(). */ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&ma->lock); memcpy (ma->ba.ptr + offset, buf, count); return 0; } static int m_alloc_fill (struct allocator *a, char c, uint64_t count, uint64_t offset) { struct m_alloc *ma = (struct m_alloc *) a; if (extend (ma, offset+count) == -1) return -1; /* See comment in m_alloc_write. */ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&ma->lock); memset (ma->ba.ptr + offset, c, count); return 0; } static int m_alloc_zero (struct allocator *a, uint64_t count, uint64_t offset) { struct m_alloc *ma = (struct m_alloc *) a; ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&ma->lock); /* Try to avoid extending the array, since the unallocated part * always reads as zero. */ if (offset < ma->ba.cap) { if (offset + count > ma->ba.cap) memset (ma->ba.ptr + offset, 0, ma->ba.cap - offset); else memset (ma->ba.ptr + offset, 0, count); } return 0; } static int m_alloc_blit (struct allocator *a1, struct allocator *a2, uint64_t count, uint64_t offset1, uint64_t offset2) { struct m_alloc *ma2 = (struct m_alloc *) a2; assert (a1 != a2); assert (strcmp (a2->f->type, "malloc") == 0); if (extend (ma2, offset2+count) == -1) return -1; /* See comment in m_alloc_write. */ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&ma2->lock); return a1->f->read (a1, ma2->ba.ptr + offset2, count, offset1); } static int m_alloc_extents (struct allocator *a, uint64_t count, uint64_t offset, struct nbdkit_extents *extents) { /* Always fully allocated. XXX In theory we could detect zeroes * quite quickly and return that information, allowing the client to * avoid reads. However we'd probably want to store a bitmap of * which sectors we are known to have written to, and that * complicates the implementation quite a lot. */ return nbdkit_add_extent (extents, offset, count, 0); } struct allocator * m_alloc_create (const void *paramsv) { const allocator_parameters *params = paramsv; struct m_alloc *ma; bool use_mlock = false; size_t i; /* Parse the optional mlock=true|false parameter. */ for (i = 0; i < params->len; ++i) { if (strcmp (params->ptr[i].key, "mlock") == 0) { int r = nbdkit_parse_bool (params->ptr[i].value); if (r == -1) return NULL; use_mlock = r; #ifndef HAVE_MLOCK if (use_mlock) { nbdkit_error ("mlock is not supported on this platform"); return NULL; } #endif } else { nbdkit_error ("allocator=malloc: unknown parameter %s", params->ptr[i].key); return NULL; } } ma = calloc (1, sizeof *ma); if (ma == NULL) { nbdkit_error ("calloc: %m"); return NULL; } ma->use_mlock = use_mlock; pthread_rwlock_init (&ma->lock, NULL); ma->ba = (bytearray) empty_vector; return (struct allocator *) ma; } static struct allocator_functions functions = { .type = "malloc", .preferred = 512, /* Not really any, so return a general default. */ .create = m_alloc_create, .free = m_alloc_free, .set_size_hint = m_alloc_set_size_hint, .read = m_alloc_read, .write = m_alloc_write, .fill = m_alloc_fill, .zero = m_alloc_zero, .blit = m_alloc_blit, .extents = m_alloc_extents, }; static void register_malloc (void) __attribute__ ((constructor)); static void register_malloc (void) { register_allocator (&functions); } nbdkit-1.42.2/common/allocators/sparse.c0000644000175000017500000004202014534316443013635 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include "cleanup.h" #include "iszero.h" #include "vector.h" #include "allocator.h" #include "allocator-internal.h" /* This allocator implements a sparse array of any size up to 2â¶Â³-1 * bytes. * * The array reads as zeroes until something is written. * * The implementation aims to be reasonably efficient for ordinary * sized disks, while permitting huge (but sparse) disks for testing. * Everything allocated has to be stored in memory. There is no * temporary file backing. */ /* Two level directory for the sparse array. * * nbdkit supports disk sizes up to 2â¶Â³-1. The aim of the sparse * array is to support up to 63 bit images for testing, although it * won't necessarily be efficient for that use. However it should * also be efficient for more reasonable sized disks. * * Although the CPU implements effectively the same kind of data * structure (page tables) there are some advantages of reimplementing * this: * * 1. Support for 32 bit (or even 64 bit since the virtual memory * address space on 64 bit machines is not 63 bits in size). * * 2. In Linux, overcommit defaults prevent use of virtual memory as a * sparse array without intrusive system configuration changes. * * 3. Could choose a page size which is more appropriate for disk * images, plus some architectures have much larger page sizes than * others making behaviour inconsistent across arches. * * To achieve this we use a B-Tree-like structure. The L1 directory * contains an ordered, non-overlapping, non-contiguous list of * (offset, pointer to L2 directory). * * Updating the L1 directory requires a linear scan but that operation * should be very rare. Because the L1 directory is stored in order * of offset, we can use an efficient binary search for lookups. * * Each L1 directory entry can address up to SPARSE_PAGE*L2_SIZE bytes * in the virtual disk image. With the current parameters this is * 128MB, which is enough for a 100MB image to fit into a single L1 * directory, or a 10GB image to fit into 80 L1 entries. The page * pointers in the L2 directory can be NULL (meaning no page / all * zeroes). * * ┌────────────────────┠* │ L1 directory │ ┌────────────────────┠* │ offset, entry 0 ─────────▶ | L2 directory | * │ offset, entry 1 │ | page 0 ─────────▶ page * │ offset, entry 2 │ │ page 1 ─────────▶ page * │ ... │ │ page 2 ─────────▶ page * └────────────────────┘ │ ... │ * │ page L2_SIZE-1 ─────────▶ page * └────────────────────┘ */ #define SPARSE_PAGE 32768 #define L2_SIZE 4096 struct l2_entry { void *page; /* Pointer to page (array of SPARSE_PAGE bytes).*/ }; struct l1_entry { uint64_t offset; /* Virtual offset of this entry. */ struct l2_entry *l2_dir; /* Pointer to L2 directory (L2_SIZE entries). */ }; DEFINE_VECTOR_TYPE (l1_dir, struct l1_entry); struct sparse_array { struct allocator a; /* Must come first. */ /* The shared (read) lock must be held if you just want to access * the data without modifying any of the L1/L2 metadata or * allocating or freeing any page. * * To modify the L1/L2 metadata including allocating or freeing any * page you must hold the exclusive (write) lock. * * Because POSIX rwlocks are not upgradable this presents a problem. * We solve it below by speculatively performing the request while * holding the shared lock, but if we run into an operation that * needs to update the metadata, we restart the entire request * holding the exclusive lock. */ pthread_rwlock_t lock; l1_dir l1_dir; /* L1 directory. */ }; /* Free L1 and/or L2 directories. */ static void free_l2_dir (struct l2_entry *l2_dir) { size_t i; for (i = 0; i < L2_SIZE; ++i) free (l2_dir[i].page); free (l2_dir); } static void sparse_array_free (struct allocator *a) { struct sparse_array *sa = (struct sparse_array *) a; size_t i; if (sa) { for (i = 0; i < sa->l1_dir.len; ++i) free_l2_dir (sa->l1_dir.ptr[i].l2_dir); free (sa->l1_dir.ptr); pthread_rwlock_destroy (&sa->lock); free (sa); } } static int sparse_array_set_size_hint (struct allocator *a, uint64_t size) { /* Ignored. */ return 0; } /* Comparison function used when searching through the L1 directory. */ static int compare_l1_offsets (const void *offsetp, const struct l1_entry *e) { const uint64_t offset = *(uint64_t *)offsetp; if (offset < e->offset) return -1; if (offset >= e->offset + SPARSE_PAGE*L2_SIZE) return 1; return 0; } /* Insert an entry in the L1 directory, keeping it ordered by offset. * This involves an expensive linear scan but should be very rare. */ static int insert_l1_entry (struct sparse_array *sa, const struct l1_entry *entry) { size_t i; for (i = 0; i < sa->l1_dir.len; ++i) { if (entry->offset < sa->l1_dir.ptr[i].offset) { /* Insert new entry before i'th directory entry. */ if (l1_dir_insert (&sa->l1_dir, *entry, i) == -1) { nbdkit_error ("realloc: %m"); return -1; } if (sa->a.debug) nbdkit_debug ("%s: inserted new L1 entry for %" PRIu64 " at l1_dir.ptr[%zu]", __func__, entry->offset, i); return 0; } /* This should never happens since each entry in the the L1 * directory is supposed to be unique. */ assert (entry->offset != sa->l1_dir.ptr[i].offset); } /* Insert new entry at the end. */ if (l1_dir_append (&sa->l1_dir, *entry) == -1) { nbdkit_error ("realloc: %m"); return -1; } if (sa->a.debug) nbdkit_debug ("%s: inserted new L1 entry for %" PRIu64 " at end of l1_dir", __func__, entry->offset); return 0; } /* Look up a virtual offset, returning the address of the offset, the * count of bytes to the end of the page, and a pointer to the L2 * directory entry containing the page pointer. * * If the create flag is set then a new page and/or directory will be * allocated if necessary. Use this flag when writing. * * NULL may be returned normally if the page is not mapped (meaning it * reads as zero). However if the create flag is set and NULL is * returned, this indicates an error. */ static void * lookup (struct sparse_array *sa, uint64_t offset, bool create, uint64_t *remaining, struct l2_entry **l2_entry) { struct l1_entry *entry; struct l2_entry *l2_dir; uint64_t o; void *page; struct l1_entry new_entry; *remaining = SPARSE_PAGE - (offset & (SPARSE_PAGE-1)); again: /* Search the L1 directory. */ entry = l1_dir_search (&sa->l1_dir, &offset, compare_l1_offsets); if (sa->a.debug) { if (entry) nbdkit_debug ("%s: search L1 dir: entry found: offset %" PRIu64, __func__, entry->offset); else nbdkit_debug ("%s: search L1 dir: no entry found", __func__); } if (entry) { l2_dir = entry->l2_dir; /* Which page in the L2 directory? */ o = (offset - entry->offset) / SPARSE_PAGE; if (l2_entry) *l2_entry = &l2_dir[o]; page = l2_dir[o].page; if (!page && create) { /* No page allocated. Allocate one if creating. */ page = calloc (SPARSE_PAGE, 1); if (page == NULL) { nbdkit_error ("calloc: %m"); return NULL; } l2_dir[o].page = page; } if (!page) return NULL; else return page + (offset & (SPARSE_PAGE-1)); } /* No L1 directory entry found. */ if (!create) return NULL; /* No L1 directory entry, and we're creating, so we need to allocate * a new L1 directory entry and insert it in the L1 directory, and * allocate the L2 directory with NULL page pointers. Then we can * repeat the above search to create the page. */ new_entry.offset = offset & ~(SPARSE_PAGE*L2_SIZE-1); new_entry.l2_dir = calloc (L2_SIZE, sizeof (struct l2_entry)); if (new_entry.l2_dir == NULL) { nbdkit_error ("calloc: %m"); return NULL; } if (insert_l1_entry (sa, &new_entry) == -1) { free (new_entry.l2_dir); return NULL; } goto again; } static int sparse_array_read (struct allocator *a, void *buf, uint64_t count, uint64_t offset) { struct sparse_array *sa = (struct sparse_array *) a; /* Because reads never modify any metadata, it is always safe to * only hold the shared (read) lock. */ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&sa->lock); uint64_t n; void *p; while (count > 0) { p = lookup (sa, offset, false, &n, NULL); if (n > count) n = count; if (p == NULL) memset (buf, 0, n); else memcpy (buf, p, n); buf += n; count -= n; offset += n; } return 0; } #define RESTART_EXCLUSIVE -2 static int do_write (bool exclusive, struct sparse_array *sa, const void *buf, uint64_t count, uint64_t offset) { uint64_t n; void *p; while (count > 0) { if (!exclusive) { /* If we only hold the shared lock, try it without allocating. */ p = lookup (sa, offset, false, &n, NULL); if (p == NULL) return RESTART_EXCLUSIVE; } else { p = lookup (sa, offset, true, &n, NULL); if (p == NULL) return -1; } if (n > count) n = count; memcpy (p, buf, n); buf += n; count -= n; offset += n; } return 0; } static int sparse_array_write (struct allocator *a, const void *buf, uint64_t count, uint64_t offset) { struct sparse_array *sa = (struct sparse_array *) a; int r; /* First try the write with the shared (read) lock held. */ { ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&sa->lock); r = do_write (false, sa, buf, count, offset); } /* If that failed because we need the exclusive lock, restart. */ if (r == RESTART_EXCLUSIVE) { ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&sa->lock); r = do_write (true, sa, buf, count, offset); } return r; } static int sparse_array_zero (struct allocator *a, uint64_t count, uint64_t offset); static int sparse_array_fill (struct allocator *a, char c, uint64_t count, uint64_t offset) { struct sparse_array *sa = (struct sparse_array *) a; uint64_t n; void *p; if (c == 0) return sparse_array_zero (a, count, offset); /* Since fill is never called on a hot path, use the exclusive lock. */ ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&sa->lock); while (count > 0) { p = lookup (sa, offset, true, &n, NULL); if (p == NULL) return -1; if (n > count) n = count; memset (p, c, n); count -= n; offset += n; } return 0; } static int do_zero (bool exclusive, struct sparse_array *sa, uint64_t count, uint64_t offset) { uint64_t n; void *p; struct l2_entry *l2_entry; while (count > 0) { p = lookup (sa, offset, false, &n, &l2_entry); if (n > count) n = count; if (p) { if (n < SPARSE_PAGE) memset (p, 0, n); else assert (p == l2_entry->page); /* If the whole page is now zero, free it. */ if (n >= SPARSE_PAGE || is_zero (l2_entry->page, SPARSE_PAGE)) { if (!exclusive) return RESTART_EXCLUSIVE; if (sa->a.debug) nbdkit_debug ("%s: freeing zero page at offset %" PRIu64, __func__, offset); free (l2_entry->page); l2_entry->page = NULL; } } count -= n; offset += n; } return 0; } static int sparse_array_zero (struct allocator *a, uint64_t count, uint64_t offset) { struct sparse_array *sa = (struct sparse_array *) a; int r; /* First try the zero with the shared (read) lock held. */ { ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&sa->lock); r = do_zero (false, sa, count, offset); } /* If that failed because we need the exclusive lock, restart. */ if (r == RESTART_EXCLUSIVE) { ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&sa->lock); r = do_zero (true, sa, count, offset); } return r; } static int sparse_array_blit (struct allocator *a1, struct allocator *a2, uint64_t count, uint64_t offset1, uint64_t offset2) { struct sparse_array *sa2 = (struct sparse_array *) a2; /* Since blit is never called on a hot path, use the exclusive lock. */ ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&sa2->lock); uint64_t n; void *p; struct l2_entry *l2_entry; assert (a1 != a2); assert (strcmp (a2->f->type, "sparse") == 0); while (count > 0) { p = lookup (sa2, offset2, true, &n, &l2_entry); if (p == NULL) return -1; if (n > count) n = count; /* Read the source allocator (a1) directly to p which points into * the right place in sa2. */ if (a1->f->read (a1, p, n, offset1) == -1) return -1; /* If the whole page is now zero, free it. */ if (is_zero (l2_entry->page, SPARSE_PAGE)) { if (sa2->a.debug) nbdkit_debug ("%s: freeing zero page at offset %" PRIu64, __func__, offset2); free (l2_entry->page); l2_entry->page = NULL; } count -= n; offset1 += n; offset2 += n; } return 0; } static int sparse_array_extents (struct allocator *a, uint64_t count, uint64_t offset, struct nbdkit_extents *extents) { struct sparse_array *sa = (struct sparse_array *) a; /* Reading extents never modifies any metadata, so it is always safe * to only hold the shared (read) lock. */ ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE (&sa->lock); uint64_t n; uint32_t type; void *p; while (count > 0) { p = lookup (sa, offset, false, &n, NULL); /* Work out the type of this extent. */ if (p == NULL) /* No backing page, so it's a hole. */ type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; else { if (is_zero (p, n)) /* A backing page and it's all zero, it's a zero extent. */ type = NBDKIT_EXTENT_ZERO; else /* Normal allocated data. */ type = 0; } if (nbdkit_add_extent (extents, offset, n, type) == -1) return -1; if (n > count) n = count; count -= n; offset += n; } return 0; } static struct allocator * sparse_array_create (const void *paramsv) { const allocator_parameters *params = paramsv; struct sparse_array *sa; if (params->len > 0) { nbdkit_error ("allocator=sparse does not take extra parameters"); return NULL; } sa = calloc (1, sizeof *sa); if (sa == NULL) { nbdkit_error ("calloc: %m"); return NULL; } pthread_rwlock_init (&sa->lock, NULL); return (struct allocator *) sa; } static struct allocator_functions functions = { .type = "sparse", .preferred = SPARSE_PAGE, .create = sparse_array_create, .free = sparse_array_free, .set_size_hint = sparse_array_set_size_hint, .read = sparse_array_read, .write = sparse_array_write, .fill = sparse_array_fill, .zero = sparse_array_zero, .blit = sparse_array_blit, .extents = sparse_array_extents, }; static void register_sparse_array (void) __attribute__ ((constructor)); static void register_sparse_array (void) { register_allocator (&functions); } nbdkit-1.42.2/common/allocators/zstd.c0000644000175000017500000004100514534316443013326 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include "cleanup.h" #include "iszero.h" #include "vector.h" #include "allocator.h" #include "allocator-internal.h" #ifdef HAVE_LIBZSTD #include /* This is derived from the sparse array implementation - see * common/allocators/sparse.c for details of how it works. * * TO DO: * * (1) We can avoid decompressing a page if we know we are going to * write over / trim / zero the whole page. * * (2) Locking is correct but very naive. It should be possible to * take much more fine-grained locks. * * (3) Better stats: Can we iterate over the page table in order to * find the ratio of uncompressed : compressed? * * Once some optimizations are made it would be worth profiling to * find the hot spots. */ #define ZSTD_PAGE 32768 #define L2_SIZE 4096 struct l2_entry { void *page; /* Pointer to compressed data. */ }; struct l1_entry { uint64_t offset; /* Virtual offset of this entry. */ struct l2_entry *l2_dir; /* Pointer to L2 directory (L2_SIZE entries). */ }; DEFINE_VECTOR_TYPE (l1_dir, struct l1_entry); struct zstd_array { struct allocator a; /* Must come first. */ pthread_mutex_t lock; l1_dir l1_dir; /* L1 directory. */ /* Compression context and decompression stream. We use the * streaming API for decompression because it allows us to * decompress without storing the compressed size, so we need a * streaming object. But in fact decompression context and stream * are the same thing since zstd 1.3.0. * * If we ever get serious about making this allocator work well * multi-threaded [at the moment the locking is too course-grained], * then the zstd documentation recommends creating a context per * thread. */ ZSTD_CCtx *zcctx; ZSTD_DStream *zdstrm; /* Collect stats when we compress a page. */ uint64_t stats_uncompressed_bytes; uint64_t stats_compressed_bytes; }; /* Free L1 and/or L2 directories. */ static void free_l2_dir (struct l2_entry *l2_dir) { size_t i; for (i = 0; i < L2_SIZE; ++i) free (l2_dir[i].page); free (l2_dir); } static void zstd_array_free (struct allocator *a) { struct zstd_array *za = (struct zstd_array *) a; size_t i; if (za) { if (za->stats_compressed_bytes > 0) nbdkit_debug ("zstd: compression ratio: %g : 1", (double) za->stats_uncompressed_bytes / za->stats_compressed_bytes); ZSTD_freeCCtx (za->zcctx); ZSTD_freeDStream (za->zdstrm); for (i = 0; i < za->l1_dir.len; ++i) free_l2_dir (za->l1_dir.ptr[i].l2_dir); free (za->l1_dir.ptr); pthread_mutex_destroy (&za->lock); free (za); } } static int zstd_array_set_size_hint (struct allocator *a, uint64_t size) { /* Ignored. */ return 0; } /* Comparison function used when searching through the L1 directory. */ static int compare_l1_offsets (const void *offsetp, const struct l1_entry *e) { const uint64_t offset = *(uint64_t *)offsetp; if (offset < e->offset) return -1; if (offset >= e->offset + ZSTD_PAGE*L2_SIZE) return 1; return 0; } /* Insert an entry in the L1 directory, keeping it ordered by offset. * This involves an expensive linear scan but should be very rare. */ static int insert_l1_entry (struct zstd_array *za, const struct l1_entry *entry) { size_t i; for (i = 0; i < za->l1_dir.len; ++i) { if (entry->offset < za->l1_dir.ptr[i].offset) { /* Insert new entry before i'th directory entry. */ if (l1_dir_insert (&za->l1_dir, *entry, i) == -1) { nbdkit_error ("realloc: %m"); return -1; } if (za->a.debug) nbdkit_debug ("%s: inserted new L1 entry for %" PRIu64 " at l1_dir.ptr[%zu]", __func__, entry->offset, i); return 0; } /* This should never happens since each entry in the the L1 * directory is supposed to be unique. */ assert (entry->offset != za->l1_dir.ptr[i].offset); } /* Insert new entry at the end. */ if (l1_dir_append (&za->l1_dir, *entry) == -1) { nbdkit_error ("realloc: %m"); return -1; } if (za->a.debug) nbdkit_debug ("%s: inserted new L1 entry for %" PRIu64 " at end of l1_dir", __func__, entry->offset); return 0; } /* Look up a virtual offset. * * If the L2 page is mapped then this uncompresses the page into the * caller's buffer (of size ZSTD_PAGE), returning the address of the * offset, the count of bytes to the end of the page, and a pointer to * the L2 directory entry containing the page pointer. * * If the L2 page is not mapped this clears the caller's buffer, also * returning the pointer. * * To read data you don't need to do anything else. * * To write data, after updating the buffer, you must subsequently * call compress() below. * * This function cannot return an error. */ static void * lookup_decompress (struct zstd_array *za, uint64_t offset, void *buf, uint64_t *remaining, struct l2_entry **l2_entry) { struct l1_entry *entry; struct l2_entry *l2_dir; uint64_t o; void *page; *remaining = ZSTD_PAGE - (offset & (ZSTD_PAGE-1)); /* Search the L1 directory. */ entry = l1_dir_search (&za->l1_dir, &offset, compare_l1_offsets); if (za->a.debug) { if (entry) nbdkit_debug ("%s: search L1 dir: entry found: offset %" PRIu64, __func__, entry->offset); else nbdkit_debug ("%s: search L1 dir: no entry found", __func__); } if (entry) { l2_dir = entry->l2_dir; /* Which page in the L2 directory? */ o = (offset - entry->offset) / ZSTD_PAGE; if (l2_entry) *l2_entry = &l2_dir[o]; page = l2_dir[o].page; if (page) { /* Decompress the page into the user buffer. We assume this can * never fail since the only pages we decompress are ones we * have compressed. We use the streaming API because the normal * ZSTD_decompressDCtx function requires the compressed size, * whereas the streaming API does not. */ ZSTD_inBuffer inb = { .src = page, .size = SIZE_MAX, .pos = 0 }; ZSTD_outBuffer outb = { .dst = buf, .size = ZSTD_PAGE, .pos = 0 }; ZSTD_initDStream (za->zdstrm); while (outb.pos < outb.size) ZSTD_decompressStream (za->zdstrm, &outb, &inb); assert (outb.pos == ZSTD_PAGE); } else memset (buf, 0, ZSTD_PAGE); return buf + (offset & (ZSTD_PAGE-1)); } /* No L1 directory entry found. */ memset (buf, 0, ZSTD_PAGE); return buf + (offset & (ZSTD_PAGE-1)); } /* Compress a page back after modifying it. * * This replaces a L2 page with a new version compressed from the * modified user buffer. * * It may fail, calling nbdkit_error and returning -1. */ static int compress (struct zstd_array *za, uint64_t offset, void *buf) { struct l1_entry *entry; struct l2_entry *l2_dir; uint64_t o; void *page; struct l1_entry new_entry; size_t n; again: /* Search the L1 directory. */ entry = l1_dir_search (&za->l1_dir, &offset, compare_l1_offsets); if (za->a.debug) { if (entry) nbdkit_debug ("%s: search L1 dir: entry found: offset %" PRIu64, __func__, entry->offset); else nbdkit_debug ("%s: search L1 dir: no entry found", __func__); } if (entry) { l2_dir = entry->l2_dir; /* Which page in the L2 directory? */ o = (offset - entry->offset) / ZSTD_PAGE; free (l2_dir[o].page); l2_dir[o].page = NULL; /* Allocate a new page. */ n = ZSTD_compressBound (ZSTD_PAGE); page = malloc (n); if (page == NULL) { nbdkit_error ("malloc: %m"); return -1; } n = ZSTD_compressCCtx (za->zcctx, page, n, buf, ZSTD_PAGE, ZSTD_CLEVEL_DEFAULT); if (ZSTD_isError (n)) { nbdkit_error ("ZSTD_compressCCtx: %s", ZSTD_getErrorName (n)); return -1; } page = realloc (page, n); assert (page != NULL); l2_dir[o].page = page; za->stats_uncompressed_bytes += ZSTD_PAGE; za->stats_compressed_bytes += n; return 0; } /* No L1 directory entry, so we need to allocate a new L1 directory * entry and insert it in the L1 directory, and allocate the L2 * directory with NULL page pointers. Then we can repeat the above * search to create the page. */ new_entry.offset = offset & ~(ZSTD_PAGE*L2_SIZE-1); new_entry.l2_dir = calloc (L2_SIZE, sizeof (struct l2_entry)); if (new_entry.l2_dir == NULL) { nbdkit_error ("calloc: %m"); return -1; } if (insert_l1_entry (za, &new_entry) == -1) { free (new_entry.l2_dir); return -1; } goto again; } static int zstd_array_read (struct allocator *a, void *buf, uint64_t count, uint64_t offset) { struct zstd_array *za = (struct zstd_array *) a; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za->lock); CLEANUP_FREE void *tbuf = NULL; uint64_t n; void *p; tbuf = malloc (ZSTD_PAGE); if (tbuf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za, offset, tbuf, &n, NULL); if (n > count) n = count; memcpy (buf, p, n); buf += n; count -= n; offset += n; } return 0; } static int zstd_array_write (struct allocator *a, const void *buf, uint64_t count, uint64_t offset) { struct zstd_array *za = (struct zstd_array *) a; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za->lock); CLEANUP_FREE void *tbuf = NULL; uint64_t n; void *p; tbuf = malloc (ZSTD_PAGE); if (tbuf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za, offset, tbuf, &n, NULL); if (n > count) n = count; memcpy (p, buf, n); if (compress (za, offset, tbuf) == -1) return -1; buf += n; count -= n; offset += n; } return 0; } static int zstd_array_zero (struct allocator *a, uint64_t count, uint64_t offset); static int zstd_array_fill (struct allocator *a, char c, uint64_t count, uint64_t offset) { struct zstd_array *za = (struct zstd_array *) a; CLEANUP_FREE void *tbuf = NULL; uint64_t n; void *p; if (c == 0) { zstd_array_zero (a, count, offset); return 0; } ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za->lock); tbuf = malloc (ZSTD_PAGE); if (tbuf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za, offset, tbuf, &n, NULL); if (n > count) n = count; memset (p, c, n); if (compress (za, offset, tbuf) == -1) return -1; count -= n; offset += n; } return 0; } static int zstd_array_zero (struct allocator *a, uint64_t count, uint64_t offset) { struct zstd_array *za = (struct zstd_array *) a; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za->lock); CLEANUP_FREE void *tbuf = NULL; uint64_t n; void *p; struct l2_entry *l2_entry = NULL; tbuf = malloc (ZSTD_PAGE); if (tbuf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za, offset, tbuf, &n, &l2_entry); if (n > count) n = count; memset (p, 0, n); if (l2_entry && l2_entry->page) { /* If the whole page is now zero, free it. */ if (n >= ZSTD_PAGE || is_zero (l2_entry->page, ZSTD_PAGE)) { if (za->a.debug) nbdkit_debug ("%s: freeing zero page at offset %" PRIu64, __func__, offset); free (l2_entry->page); l2_entry->page = NULL; } else { if (compress (za, offset, tbuf) == -1) return -1; } } count -= n; offset += n; } return 0; } static int zstd_array_blit (struct allocator *a1, struct allocator *a2, uint64_t count, uint64_t offset1, uint64_t offset2) { struct zstd_array *za2 = (struct zstd_array *) a2; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za2->lock); CLEANUP_FREE void *tbuf = NULL; uint64_t n; void *p; assert (a1 != a2); assert (strcmp (a2->f->type, "zstd") == 0); tbuf = malloc (ZSTD_PAGE); if (tbuf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za2, offset2, tbuf, &n, NULL); if (n > count) n = count; /* Read the source allocator (a1) directly to p which points into * the right place in za2. */ if (a1->f->read (a1, p, n, offset1) == -1) return -1; if (compress (za2, offset2, tbuf) == -1) return -1; count -= n; offset1 += n; offset2 += n; } return 0; } static int zstd_array_extents (struct allocator *a, uint64_t count, uint64_t offset, struct nbdkit_extents *extents) { struct zstd_array *za = (struct zstd_array *) a; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&za->lock); CLEANUP_FREE void *buf = NULL; uint64_t n; uint32_t type; void *p; struct l2_entry *l2_entry; buf = malloc (ZSTD_PAGE); if (buf == NULL) { nbdkit_error ("malloc: %m"); return -1; } while (count > 0) { p = lookup_decompress (za, offset, buf, &n, &l2_entry); /* Work out the type of this extent. */ if (l2_entry->page == NULL) /* No backing page, so it's a hole. */ type = NBDKIT_EXTENT_HOLE | NBDKIT_EXTENT_ZERO; else { if (is_zero (p, n)) /* A backing page and it's all zero, it's a zero extent. */ type = NBDKIT_EXTENT_ZERO; else /* Normal allocated data. */ type = 0; } if (nbdkit_add_extent (extents, offset, n, type) == -1) return -1; if (n > count) n = count; count -= n; offset += n; } return 0; } struct allocator * zstd_array_create (const void *paramsv) { const allocator_parameters *params = paramsv; struct zstd_array *za; if (params->len > 0) { nbdkit_error ("allocator=zstd does not take extra parameters"); return NULL; } za = calloc (1, sizeof *za); if (za == NULL) { nbdkit_error ("calloc: %m"); return NULL; } pthread_mutex_init (&za->lock, NULL); za->zcctx = ZSTD_createCCtx (); if (za->zcctx == NULL) { nbdkit_error ("ZSTD_createCCtx: %m"); free (za); return NULL; } za->zdstrm = ZSTD_createDStream (); if (za->zdstrm == NULL) { nbdkit_error ("ZSTD_createDStream: %m"); ZSTD_freeCCtx (za->zcctx); free (za); return NULL; } za->stats_uncompressed_bytes = za->stats_compressed_bytes = 0; return (struct allocator *) za; } static struct allocator_functions functions = { .type = "zstd", .preferred = ZSTD_PAGE, .create = zstd_array_create, .free = zstd_array_free, .set_size_hint = zstd_array_set_size_hint, .read = zstd_array_read, .write = zstd_array_write, .fill = zstd_array_fill, .zero = zstd_array_zero, .blit = zstd_array_blit, .extents = zstd_array_extents, }; static void register_zstd_array (void) __attribute__ ((constructor)); static void register_zstd_array (void) { register_allocator (&functions); } #endif /* !HAVE_LIBZSTD */ nbdkit-1.42.2/common/bitmap/0000755000175000017500000000000014771247241011371 5nbdkit-1.42.2/common/bitmap/Makefile.am0000644000175000017500000000402114623341243013333 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk noinst_LTLIBRARIES = libbitmap.la libbitmap_la_SOURCES = \ bitmap.c \ bitmap.h \ $(NULL) libbitmap_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ $(NULL) libbitmap_la_CFLAGS = $(WARNINGS_CFLAGS) # Unit tests. TESTS = test-bitmap check_PROGRAMS = test-bitmap test_bitmap_SOURCES = test-bitmap.c bitmap.c bitmap.h test_bitmap_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ $(NULL) test_bitmap_CFLAGS = $(WARNINGS_CFLAGS) nbdkit-1.42.2/common/bitmap/Makefile.in0000644000175000017500000013067114771245445013372 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test-bitmap$(EXEEXT) check_PROGRAMS = test-bitmap$(EXEEXT) subdir = common/bitmap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbitmap_la_LIBADD = am__objects_1 = am_libbitmap_la_OBJECTS = libbitmap_la-bitmap.lo $(am__objects_1) libbitmap_la_OBJECTS = $(am_libbitmap_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libbitmap_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libbitmap_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_bitmap_OBJECTS = test_bitmap-test-bitmap.$(OBJEXT) \ test_bitmap-bitmap.$(OBJEXT) test_bitmap_OBJECTS = $(am_test_bitmap_OBJECTS) test_bitmap_LDADD = $(LDADD) test_bitmap_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_bitmap_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbitmap_la-bitmap.Plo \ ./$(DEPDIR)/test_bitmap-bitmap.Po \ ./$(DEPDIR)/test_bitmap-test-bitmap.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbitmap_la_SOURCES) $(test_bitmap_SOURCES) DIST_SOURCES = $(libbitmap_la_SOURCES) $(test_bitmap_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll noinst_LTLIBRARIES = libbitmap.la libbitmap_la_SOURCES = \ bitmap.c \ bitmap.h \ $(NULL) libbitmap_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ $(NULL) libbitmap_la_CFLAGS = $(WARNINGS_CFLAGS) test_bitmap_SOURCES = test-bitmap.c bitmap.c bitmap.h test_bitmap_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ $(NULL) test_bitmap_CFLAGS = $(WARNINGS_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/bitmap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/bitmap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbitmap.la: $(libbitmap_la_OBJECTS) $(libbitmap_la_DEPENDENCIES) $(EXTRA_libbitmap_la_DEPENDENCIES) $(AM_V_CCLD)$(libbitmap_la_LINK) $(libbitmap_la_OBJECTS) $(libbitmap_la_LIBADD) $(LIBS) test-bitmap$(EXEEXT): $(test_bitmap_OBJECTS) $(test_bitmap_DEPENDENCIES) $(EXTRA_test_bitmap_DEPENDENCIES) @rm -f test-bitmap$(EXEEXT) $(AM_V_CCLD)$(test_bitmap_LINK) $(test_bitmap_OBJECTS) $(test_bitmap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbitmap_la-bitmap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bitmap-bitmap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bitmap-test-bitmap.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libbitmap_la-bitmap.lo: bitmap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbitmap_la_CPPFLAGS) $(CPPFLAGS) $(libbitmap_la_CFLAGS) $(CFLAGS) -MT libbitmap_la-bitmap.lo -MD -MP -MF $(DEPDIR)/libbitmap_la-bitmap.Tpo -c -o libbitmap_la-bitmap.lo `test -f 'bitmap.c' || echo '$(srcdir)/'`bitmap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbitmap_la-bitmap.Tpo $(DEPDIR)/libbitmap_la-bitmap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bitmap.c' object='libbitmap_la-bitmap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbitmap_la_CPPFLAGS) $(CPPFLAGS) $(libbitmap_la_CFLAGS) $(CFLAGS) -c -o libbitmap_la-bitmap.lo `test -f 'bitmap.c' || echo '$(srcdir)/'`bitmap.c test_bitmap-test-bitmap.o: test-bitmap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -MT test_bitmap-test-bitmap.o -MD -MP -MF $(DEPDIR)/test_bitmap-test-bitmap.Tpo -c -o test_bitmap-test-bitmap.o `test -f 'test-bitmap.c' || echo '$(srcdir)/'`test-bitmap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bitmap-test-bitmap.Tpo $(DEPDIR)/test_bitmap-test-bitmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-bitmap.c' object='test_bitmap-test-bitmap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -c -o test_bitmap-test-bitmap.o `test -f 'test-bitmap.c' || echo '$(srcdir)/'`test-bitmap.c test_bitmap-test-bitmap.obj: test-bitmap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -MT test_bitmap-test-bitmap.obj -MD -MP -MF $(DEPDIR)/test_bitmap-test-bitmap.Tpo -c -o test_bitmap-test-bitmap.obj `if test -f 'test-bitmap.c'; then $(CYGPATH_W) 'test-bitmap.c'; else $(CYGPATH_W) '$(srcdir)/test-bitmap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bitmap-test-bitmap.Tpo $(DEPDIR)/test_bitmap-test-bitmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-bitmap.c' object='test_bitmap-test-bitmap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -c -o test_bitmap-test-bitmap.obj `if test -f 'test-bitmap.c'; then $(CYGPATH_W) 'test-bitmap.c'; else $(CYGPATH_W) '$(srcdir)/test-bitmap.c'; fi` test_bitmap-bitmap.o: bitmap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -MT test_bitmap-bitmap.o -MD -MP -MF $(DEPDIR)/test_bitmap-bitmap.Tpo -c -o test_bitmap-bitmap.o `test -f 'bitmap.c' || echo '$(srcdir)/'`bitmap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bitmap-bitmap.Tpo $(DEPDIR)/test_bitmap-bitmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bitmap.c' object='test_bitmap-bitmap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -c -o test_bitmap-bitmap.o `test -f 'bitmap.c' || echo '$(srcdir)/'`bitmap.c test_bitmap-bitmap.obj: bitmap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -MT test_bitmap-bitmap.obj -MD -MP -MF $(DEPDIR)/test_bitmap-bitmap.Tpo -c -o test_bitmap-bitmap.obj `if test -f 'bitmap.c'; then $(CYGPATH_W) 'bitmap.c'; else $(CYGPATH_W) '$(srcdir)/bitmap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bitmap-bitmap.Tpo $(DEPDIR)/test_bitmap-bitmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bitmap.c' object='test_bitmap-bitmap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bitmap_CPPFLAGS) $(CPPFLAGS) $(test_bitmap_CFLAGS) $(CFLAGS) -c -o test_bitmap-bitmap.obj `if test -f 'bitmap.c'; then $(CYGPATH_W) 'bitmap.c'; else $(CYGPATH_W) '$(srcdir)/bitmap.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-bitmap.log: test-bitmap$(EXEEXT) @p='test-bitmap$(EXEEXT)'; \ b='test-bitmap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbitmap_la-bitmap.Plo -rm -f ./$(DEPDIR)/test_bitmap-bitmap.Po -rm -f ./$(DEPDIR)/test_bitmap-test-bitmap.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbitmap_la-bitmap.Plo -rm -f ./$(DEPDIR)/test_bitmap-bitmap.Po -rm -f ./$(DEPDIR)/test_bitmap-test-bitmap.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/bitmap/bitmap.c0000644000175000017500000000667314534316443012743 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "bitmap.h" #include "rounding.h" #include "nextnonzero.h" int bitmap_resize (struct bitmap *bm, uint64_t new_size) { uint8_t *new_bitmap; const size_t old_bm_size = bm->size; uint64_t new_bm_size_u64; size_t new_bm_size; new_bm_size_u64 = DIV_ROUND_UP (new_size, bm->blksize * UINT64_C (8) / bm->bpb); if (new_bm_size_u64 > SIZE_MAX) { nbdkit_error ("bitmap too large for this architecture"); return -1; } new_bm_size = (size_t) new_bm_size_u64; if (new_bm_size > 0) { new_bitmap = realloc (bm->bitmap, new_bm_size); if (new_bitmap == NULL) { nbdkit_error ("realloc: %m"); return -1; } } else { free (bm->bitmap); new_bitmap = NULL; } bm->bitmap = new_bitmap; bm->size = new_bm_size; if (old_bm_size < new_bm_size) memset (&bm->bitmap[old_bm_size], 0, new_bm_size-old_bm_size); nbdkit_debug ("bitmap resized to %zu bytes", new_bm_size); return 0; } int64_t bitmap_next (const struct bitmap *bm, uint64_t blk) { uint64_t limit = bm->size * bm->ibpb; const uint8_t *p; /* Align to the next byte boundary. */ for (; blk < limit && (blk & (bm->ibpb-1)) != 0; ++blk) { if (bitmap_get_blk (bm, blk, 0) != 0) return blk; } if (blk == limit) return -1; /* Now we're at a byte boundary we can use a fast string function to * find the next non-zero byte. */ p = &bm->bitmap[blk >> (3 - bm->bitshift)]; p = (const uint8_t *) next_non_zero ((const char *) p, &bm->bitmap[bm->size] - p); if (p == NULL) return -1; /* Now check the non-zero byte to find out which bit (ie. block) is set. */ blk = (p - bm->bitmap) << (3 - bm->bitshift); for (; blk < limit; ++blk) { if (bitmap_get_blk (bm, blk, 0) != 0) return blk; } /* Should never be reached. */ abort (); } nbdkit-1.42.2/common/bitmap/bitmap.h0000644000175000017500000001366614534316443012750 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* This is a very simple structure for creating a bitmap associated * with a virtual disk. 1, 2, 4 or 8 bits can be associated with each * block of the disk. You can choose the number of bits and block * size when creating the bitmap. Entries in the bitmap are * initialized to 0. */ #ifndef NBDKIT_BITMAP_H #define NBDKIT_BITMAP_H #include #include #include #include #include "ispowerof2.h" /* This is the bitmap structure. */ struct bitmap { unsigned blksize; /* Block size. */ uint8_t bpb; /* Bits per block (1, 2, 4, 8 only). */ /* bpb = 1 << bitshift ibpb = 8 / bpb 1 0 8 2 1 4 4 2 2 8 3 1 */ uint8_t bitshift, ibpb; uint8_t *bitmap; /* The bitmap. */ size_t size; /* Size of bitmap in bytes. */ }; static inline void __attribute__ ((__nonnull__ (1))) bitmap_init (struct bitmap *bm, unsigned blocksize, unsigned bpb) { assert (is_power_of_2 (blocksize)); bm->blksize = blocksize; /* bpb can be 1, 2, 4 or 8 only. */ bm->bpb = bpb; switch (bpb) { case 1: bm->bitshift = 0; break; case 2: bm->bitshift = 1; break; case 4: bm->bitshift = 2; break; case 8: bm->bitshift = 3; break; default: abort (); } bm->ibpb = 8/bpb; bm->bitmap = NULL; bm->size = 0; } /* Only frees the bitmap itself, since it is assumed that the struct * bitmap is statically allocated. */ static inline void bitmap_free (struct bitmap *bm) { if (bm) free (bm->bitmap); } /* Resize the bitmap to the virtual disk size in bytes. * Returns -1 on error, setting nbdkit_error. */ extern int bitmap_resize (struct bitmap *bm, uint64_t new_size) __attribute__ ((__nonnull__ (1))); /* Clear the bitmap (set everything to zero). */ static inline void __attribute__ ((__nonnull__ (1))) bitmap_clear (struct bitmap *bm) { memset (bm->bitmap, 0, bm->size); } /* This macro calculates the byte offset in the bitmap and which * bit/mask we are addressing within that byte. * * bpb blk_offset blk_bit mask * 1 blk >> 3 0,1,2,...,7 any single bit * 2 blk >> 2 0, 2, 4 or 6 0x03, 0x0c, 0x30 or 0xc0 * 4 blk >> 1 0 or 4 0x0f or 0xf0 * 8 blk >> 0 always 0 always 0xff */ #define BITMAP_OFFSET_BIT_MASK(bm, blk) \ uint64_t blk_offset = (blk) >> (3 - (bm)->bitshift); \ unsigned blk_bit = (bm)->bpb * ((blk) & ((bm)->ibpb - 1)); \ unsigned mask = ((1 << (bm)->bpb) - 1) << blk_bit /* Return the bit(s) associated with the given block. * If the request is out of range, returns the default value. */ static inline unsigned __attribute__ ((__nonnull__ (1))) bitmap_get_blk (const struct bitmap *bm, uint64_t blk, unsigned default_) { BITMAP_OFFSET_BIT_MASK (bm, blk); if (blk_offset >= bm->size) { nbdkit_debug ("bitmap_get: block number is out of range"); return default_; } return (bm->bitmap[blk_offset] & mask) >> blk_bit; } /* As above but works with virtual disk offset in bytes. */ static inline unsigned __attribute__ ((__nonnull__ (1))) bitmap_get (const struct bitmap *bm, uint64_t offset, unsigned default_) { return bitmap_get_blk (bm, offset / bm->blksize, default_); } /* Set the bit(s) associated with the given block. * If out of range, it is ignored. */ static inline void __attribute__ ((__nonnull__ (1))) bitmap_set_blk (const struct bitmap *bm, uint64_t blk, unsigned v) { BITMAP_OFFSET_BIT_MASK (bm, blk); if (blk_offset >= bm->size) { nbdkit_debug ("bitmap_set: block number is out of range"); return; } bm->bitmap[blk_offset] &= ~mask; bm->bitmap[blk_offset] |= v << blk_bit; } /* As above bit works with virtual disk offset in bytes. */ static inline void __attribute__ ((__nonnull__ (1))) bitmap_set (const struct bitmap *bm, uint64_t offset, unsigned v) { return bitmap_set_blk (bm, offset / bm->blksize, v); } /* Iterate over blocks represented in the bitmap. */ #define bitmap_for(bm, /* uint64_t */ blknum) \ for ((blknum) = 0; (blknum) < (bm)->size * (bm)->ibpb; ++(blknum)) /* Find the next non-zero block in the bitmap, starting at ‘blk’. * Returns -1 if the bitmap is all zeroes from blk to the end of the * bitmap. */ extern int64_t bitmap_next (const struct bitmap *bm, uint64_t blk) __attribute__ ((__nonnull__ (1))); #endif /* NBDKIT_BITMAP_H */ nbdkit-1.42.2/common/bitmap/test-bitmap.c0000644000175000017500000001052714534316443013711 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Unit tests of the bitmap code. */ #include #include #include #include #include #include #include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include #include #include "array-size.h" #include "bitmap.h" static void test (int bpb, int blksize) { struct bitmap bm; const int nr_blocks = 1000; int blks[] = { 1, 2, 3, 10, 12, 90, 91, 92, 93, 94, 99, 800, 801, 802, 803, 902, 903, 905, 907, 911, 913, 917, 919, 923, 929, 999 }; unsigned v, vexp; size_t i, j; printf ("bpb = %d, blksize = %d\n", bpb, blksize); fflush (stdout); bitmap_init (&bm, blksize, bpb); if (bitmap_resize (&bm, nr_blocks * blksize) == -1) exit (EXIT_FAILURE); /* Set some bits at known block numbers. */ for (j = 0; j < ARRAY_SIZE (blks); ++j) { v = (j & 1) == 0 ? 1 : (1<&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = common/gpt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgpt_la_LIBADD = am__objects_1 = am_libgpt_la_OBJECTS = libgpt_la-efi-crc32.lo $(am__objects_1) libgpt_la_OBJECTS = $(am_libgpt_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libgpt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libgpt_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libgpt_la-efi-crc32.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libgpt_la_SOURCES) DIST_SOURCES = $(libgpt_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll noinst_LTLIBRARIES = libgpt.la libgpt_la_SOURCES = \ efi-crc32.c \ efi-crc32.h \ gpt.h \ $(NULL) libgpt_la_CFLAGS = $(WARNINGS_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/gpt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/gpt/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libgpt.la: $(libgpt_la_OBJECTS) $(libgpt_la_DEPENDENCIES) $(EXTRA_libgpt_la_DEPENDENCIES) $(AM_V_CCLD)$(libgpt_la_LINK) $(libgpt_la_OBJECTS) $(libgpt_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpt_la-efi-crc32.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libgpt_la-efi-crc32.lo: efi-crc32.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpt_la_CFLAGS) $(CFLAGS) -MT libgpt_la-efi-crc32.lo -MD -MP -MF $(DEPDIR)/libgpt_la-efi-crc32.Tpo -c -o libgpt_la-efi-crc32.lo `test -f 'efi-crc32.c' || echo '$(srcdir)/'`efi-crc32.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgpt_la-efi-crc32.Tpo $(DEPDIR)/libgpt_la-efi-crc32.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='efi-crc32.c' object='libgpt_la-efi-crc32.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpt_la_CFLAGS) $(CFLAGS) -c -o libgpt_la-efi-crc32.lo `test -f 'efi-crc32.c' || echo '$(srcdir)/'`efi-crc32.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libgpt_la-efi-crc32.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libgpt_la-efi-crc32.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/gpt/efi-crc32.c0000644000175000017500000001726314534316443012457 /* This code was taken from parted and indirectly from other sources * as you can see from the messages below. The license is compatible * with the permissive license used in nbdkit. - RWMJ 2018-09-16 */ /* * Dec 5, 2000 Matt Domsch * - Copied crc32.c from the linux/drivers/net/cipe directory. * - Now pass seed as an arg * - changed unsigned long to uint32_t, added #include * - changed len to be an unsigned long * - changed crc32val to be a register * - License remains unchanged! It's still GPL-compatable! */ /* ============================================================= */ /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */ /* code or tables extracted from it, as desired without restriction. */ /* */ /* First, the polynomial itself and its table of feedback terms. The */ /* polynomial is */ /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */ /* */ /* Note that we take it "backwards" and put the highest-order term in */ /* the lowest-order bit. The X^32 term is "implied"; the LSB is the */ /* X^31 term, etc. The X^0 term (usually shown as "+1") results in */ /* the MSB being 1. */ /* */ /* Note that the usual hardware shift register implementation, which */ /* is what we're using (we're merely optimizing it by doing eight-bit */ /* chunks at a time) shifts bits into the lowest-order term. In our */ /* implementation, that means shifting towards the right. Why do we */ /* do it this way? Because the calculated CRC must be transmitted in */ /* order from highest-order term to lowest-order term. UARTs transmit */ /* characters in order from LSB to MSB. By storing the CRC this way, */ /* we hand it to the UART in the order low-byte to high-byte; the UART */ /* sends each low-bit to hight-bit; and the result is transmission bit */ /* by bit from highest- to lowest-order term without requiring any bit */ /* shuffling on our part. Reception works similarly. */ /* */ /* The feedback terms table consists of 256, 32-bit entries. Notes: */ /* */ /* The table can be generated at runtime if desired; code to do so */ /* is shown later. It might not be obvious, but the feedback */ /* terms simply represent the results of eight shift/xor opera- */ /* tions for all combinations of data and CRC register values. */ /* */ /* The values must be right-shifted by eight bits by the "updcrc" */ /* logic; the shift must be unsigned (bring in zeroes). On some */ /* hardware you could probably optimize the shift in assembler by */ /* using byte-swap instructions. */ /* polynomial $edb88320 */ /* */ /* -------------------------------------------------------------------- */ #include #include #include #include "efi-crc32.h" static const uint32_t crc32_tab[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL }; /* Return a 32-bit CRC of the contents of the buffer. */ static uint32_t _efi_crc32 (const void *buf, size_t len, uint32_t seed) { size_t i; uint32_t crc32val; const unsigned char *s = buf; crc32val = seed; for (i = 0; i < len; i++) { crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8); } return crc32val; } uint32_t efi_crc32 (const void *buf, size_t len) { return _efi_crc32 (buf, len, ~0L) ^ ~0L; } nbdkit-1.42.2/common/gpt/efi-crc32.h0000644000175000017500000000325114534316443012454 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_EFI_CRC32_H #define NBDKIT_EFI_CRC32_H #include extern uint32_t efi_crc32 (const void *buf, size_t len) __attribute__ ((__nonnull__ (1))); #endif /* NBDKIT_EFI_CRC32_H */ nbdkit-1.42.2/common/gpt/gpt.h0000644000175000017500000000531014534316443011567 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_GPT_H #define NBDKIT_GPT_H struct gpt_header { char signature[8]; char revision[4]; uint32_t header_size; uint32_t crc; uint32_t reserved; uint64_t current_lba; uint64_t backup_lba; uint64_t first_usable_lba; uint64_t last_usable_lba; char guid[16]; uint64_t partition_entries_lba; uint32_t nr_partition_entries; uint32_t size_partition_entry; uint32_t crc_partitions; }; #define GPT_SIGNATURE "EFI PART" #define GPT_REVISION "\0\0\1\0" /* revision 1.0 */ struct gpt_entry { char partition_type_guid[16]; char unique_guid[16]; uint64_t first_lba; uint64_t last_lba; uint64_t attributes; char name[72]; /* UTF-16LE */ }; /* GPT_MIN_PARTITIONS is the minimum number of partitions and is * defined by the UEFI standard (assuming 512 byte sector size). * * In plugins such as the partitioning plugin, if we are requested to * allocate more than GPT_MIN_PARTITIONS then we increase the * partition table in chunks of this size. Note that clients may not * support > GPT_MIN_PARTITIONS. * * GPT_PT_ENTRY_SIZE is the minimum specified by the UEFI spec, but * increasing it is not useful. */ #define GPT_MIN_PARTITIONS 128 #define GPT_PT_ENTRY_SIZE 128 #endif /* NBDKIT_GPT_H */ nbdkit-1.42.2/common/regions/0000755000175000017500000000000014771247241011563 5nbdkit-1.42.2/common/regions/Makefile.am0000644000175000017500000000343314534316443013540 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk noinst_LTLIBRARIES = libregions.la libregions_la_SOURCES = \ regions.c \ regions.h \ $(NULL) libregions_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ $(NULL) libregions_la_CFLAGS = $(WARNINGS_CFLAGS) nbdkit-1.42.2/common/regions/Makefile.in0000644000175000017500000006301114771245446013556 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = common/regions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libregions_la_LIBADD = am__objects_1 = am_libregions_la_OBJECTS = libregions_la-regions.lo $(am__objects_1) libregions_la_OBJECTS = $(am_libregions_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libregions_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libregions_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libregions_la-regions.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libregions_la_SOURCES) DIST_SOURCES = $(libregions_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll noinst_LTLIBRARIES = libregions.la libregions_la_SOURCES = \ regions.c \ regions.h \ $(NULL) libregions_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ $(NULL) libregions_la_CFLAGS = $(WARNINGS_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/regions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/regions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libregions.la: $(libregions_la_OBJECTS) $(libregions_la_DEPENDENCIES) $(EXTRA_libregions_la_DEPENDENCIES) $(AM_V_CCLD)$(libregions_la_LINK) $(libregions_la_OBJECTS) $(libregions_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libregions_la-regions.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libregions_la-regions.lo: regions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libregions_la_CPPFLAGS) $(CPPFLAGS) $(libregions_la_CFLAGS) $(CFLAGS) -MT libregions_la-regions.lo -MD -MP -MF $(DEPDIR)/libregions_la-regions.Tpo -c -o libregions_la-regions.lo `test -f 'regions.c' || echo '$(srcdir)/'`regions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libregions_la-regions.Tpo $(DEPDIR)/libregions_la-regions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regions.c' object='libregions_la-regions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libregions_la_CPPFLAGS) $(CPPFLAGS) $(libregions_la_CFLAGS) $(CFLAGS) -c -o libregions_la-regions.lo `test -f 'regions.c' || echo '$(srcdir)/'`regions.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libregions_la-regions.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libregions_la-regions.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/common/regions/regions.c0000644000175000017500000001265614534316443013325 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include "isaligned.h" #include "regions.h" void init_regions (regions *rs) { *rs = (regions) empty_vector; } void free_regions (struct regions *rs) { /* We don't need to free the data since that is not owned by the * regions structure. */ free (rs->ptr); } /* Find the region corresponding to the given offset. Use region->end * to find the end of the region. */ static int compare_offset (const void *offsetp, const struct region *region) { const uint64_t offset = *(uint64_t *)offsetp; if (offset < region->start) return -1; if (offset > region->end) return 1; return 0; } const struct region * find_region (const regions *rs, uint64_t offset) { return regions_search (rs, &offset, compare_offset); } /* This is the low level function for constructing the list of * regions. It appends one region to the list, checking that the * invariants described above (about the regions being non-overlapping * and contiguous) is maintained. Note it is not possible to * construct regions out of order using this function. */ static int __attribute__ ((__nonnull__ (1))) append_one_region (regions *rs, struct region region) { /* The assertions in this function are meant to maintain the * invariant about the array as described at the top of this file. */ assert (region.start == virtual_size (rs)); assert (region.len > 0); assert (region.end >= region.start); assert (region.len == region.end - region.start + 1); if (regions_append (rs, region) == -1) { nbdkit_error ("realloc: %m"); return -1; } return 0; } static int append_padding (regions *rs, uint64_t alignment) { struct region region; assert (is_power_of_2 (alignment)); region.start = virtual_size (rs); if (IS_ALIGNED (region.start, alignment)) return 0; /* nothing to do */ region.end = (region.start & ~(alignment-1)) + alignment - 1; region.len = region.end - region.start + 1; region.type = region_zero; region.description = "padding"; return append_one_region (rs, region); } int append_region_va (regions *rs, const char *description, uint64_t len, uint64_t pre_aligment, uint64_t post_alignment, enum region_type type, va_list ap) { struct region region; /* Pre-alignment. */ if (pre_aligment != 0) { if (append_padding (rs, pre_aligment) == -1) return -1; assert (IS_ALIGNED (virtual_size (rs), pre_aligment)); } /* Main region. */ region.description = description; region.start = virtual_size (rs); region.len = len; region.end = region.start + region.len - 1; region.type = type; if (type == region_file) region.u.i = va_arg (ap, size_t); else if (type == region_data) region.u.data = va_arg (ap, const unsigned char *); if (append_one_region (rs, region) == -1) return -1; /* Post-alignment. */ if (post_alignment != 0) { if (append_padding (rs, post_alignment) == -1) return -1; assert (IS_ALIGNED (virtual_size (rs), post_alignment)); } return 0; } int append_region_len (regions *rs, const char *description, uint64_t len, uint64_t pre_aligment, uint64_t post_alignment, enum region_type type, ...) { va_list ap; int r; va_start (ap, type); r = append_region_va (rs, description, len, pre_aligment, post_alignment, type, ap); va_end (ap); return r; } int append_region_end (regions *rs, const char *description, uint64_t end, uint64_t pre_aligment, uint64_t post_alignment, enum region_type type, ...) { va_list ap; int r; uint64_t len; va_start (ap, type); len = end - virtual_size (rs) + 1; r = append_region_va (rs, description, len, pre_aligment, post_alignment, type, ap); va_end (ap); return r; } nbdkit-1.42.2/common/regions/regions.h0000644000175000017500000001135714534316443013327 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ #ifndef NBDKIT_REGIONS_H #define NBDKIT_REGIONS_H #include #include #include #include "vector.h" /* This defines a very simple structure used to define the virtual * disk in the partitioning and floppy plugins. * * We split the virtual disk into non-overlapping, contiguous regions. * These are stored in an array, ordered by address. * * Each region can be one of several types, referring to a backing * file, some data stored in memory, or zero padding. */ /* Region type. */ enum region_type { region_file, /* contents of the i'th file */ region_data, /* pointer to in-memory data */ region_zero, /* padding */ }; /* Region. */ struct region { uint64_t start, len, end; /* byte offsets; end = start + len - 1 */ enum region_type type; union { size_t i; /* region_file: i'th file */ const unsigned char *data; /* region_data: data */ } u; /* Optional name or description of this region. This is not used by * the regions code but can be added to regions to make debugging * easier. */ const char *description; }; /* Vector of struct region. */ DEFINE_VECTOR_TYPE (regions, struct region); extern void init_regions (regions *regions) __attribute__ ((__nonnull__ (1))); extern void free_regions (regions *regions) __attribute__ ((__nonnull__ (1))); /* Return the number of regions. */ static inline size_t __attribute__ ((__nonnull__ (1))) nr_regions (regions *rs) { return rs->len; } /* Return the virtual size of the disk. */ static inline int64_t __attribute__ ((__nonnull__ (1))) virtual_size (regions *rs) { if (rs->len == 0) return 0; else return rs->ptr[rs->len-1].end + 1; } /* Look up the region corresponding to the given offset. If the * offset is inside the disk image then this cannot return NULL. */ extern const struct region *find_region (const regions *regions, uint64_t offset) __attribute__ ((__nonnull__ (1))); /* Append one region of a given length, plus up to two optional * padding regions. * * pre_aligment (if != 0) describes the required alignment of this * region. A padding region of type region_zero is inserted before * the main region if required. * * post_alignment (if != 0) describes the required alignment after * this region. A padding region of type region_zero is inserted * after the main region if required. * * If type == region_file, it must be followed by u.i parameter. * If type == region_data, it must be followed by u.data parameter. */ extern int append_region_len (regions *regions, const char *description, uint64_t len, uint64_t pre_aligment, uint64_t post_alignment, enum region_type type, ...); /* Same as append_region_len (above) but instead of specifying the * size of the main region, specify the end byte as an offset. Note * the end byte is included in the region, it's is NOT the end+1 byte. */ extern int append_region_end (regions *regions, const char *description, uint64_t end, uint64_t pre_aligment, uint64_t post_alignment, enum region_type type, ...); #endif /* NBDKIT_REGIONS_H */ nbdkit-1.42.2/test-driver0000755000175000017500000001141714771245450010747 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: nbdkit-1.42.2/contrib/0000755000175000017500000000000014771247241010265 5nbdkit-1.42.2/contrib/Makefile.am0000644000175000017500000000345114534316443012242 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk if HAVE_LIBNBD noinst_PROGRAMS = sparseloadtest sparseloadtest_SOURCES = sparseloadtest.c sparseloadtest_CPPFLAGS = -I$(top_srcdir)/common/include sparseloadtest_CFLAGS = $(PTHREAD_CFLAGS) $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS) sparseloadtest_LDADD = $(LIBNBD_LIBS) sparseloadtest_LDFLAGS = $(PTHREAD_LIBS) endif HAVE_LIBNBD nbdkit-1.42.2/contrib/Makefile.in0000644000175000017500000006550614771245446012273 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_LIBNBD_TRUE@noinst_PROGRAMS = sparseloadtest$(EXEEXT) subdir = contrib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__sparseloadtest_SOURCES_DIST = sparseloadtest.c @HAVE_LIBNBD_TRUE@am_sparseloadtest_OBJECTS = \ @HAVE_LIBNBD_TRUE@ sparseloadtest-sparseloadtest.$(OBJEXT) sparseloadtest_OBJECTS = $(am_sparseloadtest_OBJECTS) am__DEPENDENCIES_1 = @HAVE_LIBNBD_TRUE@sparseloadtest_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = sparseloadtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(sparseloadtest_CFLAGS) $(CFLAGS) $(sparseloadtest_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/sparseloadtest-sparseloadtest.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sparseloadtest_SOURCES) DIST_SOURCES = $(am__sparseloadtest_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll @HAVE_LIBNBD_TRUE@sparseloadtest_SOURCES = sparseloadtest.c @HAVE_LIBNBD_TRUE@sparseloadtest_CPPFLAGS = -I$(top_srcdir)/common/include @HAVE_LIBNBD_TRUE@sparseloadtest_CFLAGS = $(PTHREAD_CFLAGS) $(WARNINGS_CFLAGS) $(LIBNBD_CFLAGS) @HAVE_LIBNBD_TRUE@sparseloadtest_LDADD = $(LIBNBD_LIBS) @HAVE_LIBNBD_TRUE@sparseloadtest_LDFLAGS = $(PTHREAD_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list sparseloadtest$(EXEEXT): $(sparseloadtest_OBJECTS) $(sparseloadtest_DEPENDENCIES) $(EXTRA_sparseloadtest_DEPENDENCIES) @rm -f sparseloadtest$(EXEEXT) $(AM_V_CCLD)$(sparseloadtest_LINK) $(sparseloadtest_OBJECTS) $(sparseloadtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparseloadtest-sparseloadtest.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< sparseloadtest-sparseloadtest.o: sparseloadtest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sparseloadtest_CPPFLAGS) $(CPPFLAGS) $(sparseloadtest_CFLAGS) $(CFLAGS) -MT sparseloadtest-sparseloadtest.o -MD -MP -MF $(DEPDIR)/sparseloadtest-sparseloadtest.Tpo -c -o sparseloadtest-sparseloadtest.o `test -f 'sparseloadtest.c' || echo '$(srcdir)/'`sparseloadtest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sparseloadtest-sparseloadtest.Tpo $(DEPDIR)/sparseloadtest-sparseloadtest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sparseloadtest.c' object='sparseloadtest-sparseloadtest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sparseloadtest_CPPFLAGS) $(CPPFLAGS) $(sparseloadtest_CFLAGS) $(CFLAGS) -c -o sparseloadtest-sparseloadtest.o `test -f 'sparseloadtest.c' || echo '$(srcdir)/'`sparseloadtest.c sparseloadtest-sparseloadtest.obj: sparseloadtest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sparseloadtest_CPPFLAGS) $(CPPFLAGS) $(sparseloadtest_CFLAGS) $(CFLAGS) -MT sparseloadtest-sparseloadtest.obj -MD -MP -MF $(DEPDIR)/sparseloadtest-sparseloadtest.Tpo -c -o sparseloadtest-sparseloadtest.obj `if test -f 'sparseloadtest.c'; then $(CYGPATH_W) 'sparseloadtest.c'; else $(CYGPATH_W) '$(srcdir)/sparseloadtest.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sparseloadtest-sparseloadtest.Tpo $(DEPDIR)/sparseloadtest-sparseloadtest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sparseloadtest.c' object='sparseloadtest-sparseloadtest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sparseloadtest_CPPFLAGS) $(CPPFLAGS) $(sparseloadtest_CFLAGS) $(CFLAGS) -c -o sparseloadtest-sparseloadtest.obj `if test -f 'sparseloadtest.c'; then $(CYGPATH_W) 'sparseloadtest.c'; else $(CYGPATH_W) '$(srcdir)/sparseloadtest.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/sparseloadtest-sparseloadtest.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/sparseloadtest-sparseloadtest.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/contrib/sparseloadtest.c0000644000175000017500000002627114534316443013414 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. */ /* Load nbdkit-memory-plugin + allocator=sparse * * This is better than fio for this plugin since it exercises * allocation and deallocation of pages and locking. * * To test a mainly read workload (90% reads, 10% writes, 10% trims): * ./contrib/sparseloadtest 4 90 * * To test a write-heavy workload (20% reads, 40% writes, 40% trims): * ./contrib/sparseloadtest 4 20 * * nbdkit is run from the current $PATH environment variable, so to * run the locally built nbdkit you should do: * * PATH=.:$PATH ./contrib/sparseloadtest [...] */ #include #include #include #include #include #include #include #include #include #include #include #include #include "random.h" #define SPARSE_PAGE 32768 /* See common/allocators/sparse.c */ #define L2_SIZE 4096 #define DISK_SIZE (4*L2_SIZE*SPARSE_PAGE) #define MAX_THREADS 16 #define DURATION 60 /* seconds */ #define MAX_IN_FLIGHT 64 #define MAX_REQUEST (128*1024) /* Should be larger than SPARSE_PAGE. */ static pid_t pid; static char sockfile[] = "/tmp/sockXXXXXX"; static char pidfile[] = "/tmp/pidXXXXXX"; static unsigned nr_threads; static double pc_read; /* % read operations. */ struct stats { size_t ops; size_t bytes; }; struct thread_data { pthread_t thread; int status; /* returned status from the thread */ struct nbd_handle *nbd; /* per-thread handle */ struct stats read_stats, write_stats, trim_stats; struct random_state state; }; static struct thread_data thread[MAX_THREADS]; static time_t start_t; struct command_data { struct stats *stats; size_t count; }; /* We don't care about the data that is read, so this is just a sink * buffer shared across all threads. */ static char sink[MAX_REQUEST]; static char wrbuf[MAX_REQUEST]; static void start_nbdkit (void); static void create_random_name (char *template); static void cleanup (void); static void *start_thread (void *); int main (int argc, char *argv[]) { unsigned i; int err; struct stats read_total = { 0 }; struct stats write_total = { 0 }; struct stats trim_total = { 0 }; if (argc != 3) { fprintf (stderr, "%s nr_threads percent_reads\n", argv[0]); exit (EXIT_FAILURE); } if (sscanf (argv[1], "%u", &nr_threads) != 1 || nr_threads == 0 || nr_threads > MAX_THREADS || sscanf (argv[2], "%lg", &pc_read) != 1 || pc_read <= 0 || pc_read > 100) { fprintf (stderr, "%s: incorrect parameters, read the source!\n", argv[0]); exit (EXIT_FAILURE); } start_nbdkit (); atexit (cleanup); /* Connect to nbdkit. */ for (i = 0; i < nr_threads; ++i) { struct nbd_handle *nbd = nbd_create (); if (nbd == NULL) { got_nbd_error: fprintf (stderr, "%s: thread %u: %s\n", argv[0], i, nbd_get_error ()); exit (EXIT_FAILURE); } if (nbd_connect_unix (nbd, sockfile) == -1) goto got_nbd_error; thread[i].nbd = nbd; } time (&start_t); /* Start threads. */ for (i = 0; i < nr_threads; ++i) { xsrandom (i+1, &thread[i].state); if (i == 0) { size_t j; for (j = 0; j < sizeof wrbuf; ++j) wrbuf[j] = xrandom (&thread[i].state); } err = pthread_create (&thread[i].thread, NULL, start_thread, &thread[i]); if (err != 0) { errno = err; perror ("pthread_create"); exit (EXIT_FAILURE); } } /* Wait for the threads to exit. */ for (i = 0; i < nr_threads; ++i) { err = pthread_join (thread[i].thread, NULL); if (err != 0) { errno = err; perror ("pthread_join"); exit (EXIT_FAILURE); } if (thread[i].status != 0) { fprintf (stderr, "%s: thread %u failed, see earlier errors\n", argv[0], i); exit (EXIT_FAILURE); } read_total.ops += thread[i].read_stats.ops; read_total.bytes += thread[i].read_stats.bytes; write_total.ops += thread[i].write_stats.ops; write_total.bytes += thread[i].write_stats.bytes; trim_total.ops += thread[i].trim_stats.ops; trim_total.bytes += thread[i].trim_stats.bytes; /* Drain the command queue just to avoid errors. These requests * don't count in the final totals. */ while (nbd_aio_in_flight (thread[i].nbd) > 0) { if (nbd_poll (thread[i].nbd, -1) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } } nbd_close (thread[i].nbd); } /* Print the throughput. */ printf ("READ: %.1f ops/s %.1f bytes/s\n", (double) read_total.ops / DURATION, (double) read_total.bytes / DURATION); printf ("WRITE: %.1f ops/s %.1f bytes/s\n", (double) write_total.ops / DURATION, (double) write_total.bytes / DURATION); printf ("TRIM: %.1f ops/s %.1f bytes/s\n", (double) trim_total.ops / DURATION, (double) trim_total.bytes / DURATION); printf ("TOTAL: %.1f ops/s %.1f bytes/s\n", (double) (read_total.ops + write_total.ops + trim_total.ops) / DURATION, (double) (read_total.bytes + write_total.bytes + trim_total.bytes) / DURATION); printf ("--\n"); printf ("%%read operations requested: %.1f%%, achieved: %.1f%%\n", pc_read, 100.0 * read_total.ops / (read_total.ops + write_total.ops + trim_total.ops)); printf ("%%write operations requested: %.1f%%, achieved: %.1f%%\n", (100 - pc_read) / 2, 100.0 * write_total.ops / (read_total.ops + write_total.ops + trim_total.ops)); printf ("%%trim operations requested: %.1f%%, achieved: %.1f%%\n", (100 - pc_read) / 2, 100.0 * trim_total.ops / (read_total.ops + write_total.ops + trim_total.ops)); exit (EXIT_SUCCESS); } static void cleanup (void) { if (pid > 0) { kill (pid, SIGTERM); unlink (sockfile); pid = 0; } } /* Start nbdkit. * * We cannot use systemd socket activation because we want to use * multi-conn. */ static void start_nbdkit (void) { char size[64]; int i; snprintf (size, sizeof size, "%d", DISK_SIZE); create_random_name (sockfile); create_random_name (pidfile); /* Start nbdkit. */ pid = fork (); if (pid == -1) { perror ("fork"); exit (EXIT_FAILURE); } if (pid == 0) { /* Child - nbdkit */ execlp ("nbdkit", "nbdkit", "--exit-with-parent", "-f", "-U", sockfile, "-P", pidfile, "memory", size, "allocator=sparse", NULL); perror ("execlp"); _exit (EXIT_FAILURE); } /* Wait for the pidfile to appear, indicating that nbdkit is ready. */ for (i = 0; i < 60; ++i) { if (access (pidfile, F_OK) == 0) break; sleep (1); } if (i == 60) { fprintf (stderr, "nbdkit did not start up, look for errors above\n"); exit (EXIT_FAILURE); } unlink (pidfile); } /* This is racy but it doesn't matter for a test. */ static void create_random_name (char *template) { int fd; fd = mkstemp (template); if (fd == -1) { perror (template); exit (EXIT_FAILURE); } close (fd); unlink (template); } static int cb (void *user_data, int *error) { struct command_data *data = user_data; if (*error != 0) { fprintf (stderr, "unexpected error in completion callback\n"); exit (EXIT_FAILURE); } data->stats->ops++; data->stats->bytes += data->count; free (data); return 1; /* retire the command */ } static void * start_thread (void *thread_data_vp) { struct thread_data *thread_data = thread_data_vp; struct nbd_handle *nbd = thread_data->nbd; time_t end_t; size_t total_ops; double pc_read_actual; uint64_t offset; size_t count; struct command_data *data; int64_t r; while (time (&end_t), end_t - start_t < DURATION) { /* Run the poll loop if there are too many requests in flight. */ while (nbd_aio_in_flight (nbd) >= MAX_IN_FLIGHT) { if (nbd_poll (nbd, -1) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } } /* Aim to send about pc_read% read operations, and an equal random * distribution of writes and trims. */ total_ops = thread_data->read_stats.ops + thread_data->write_stats.ops + thread_data->trim_stats.ops; if (total_ops == 0) pc_read_actual = 100; else pc_read_actual = 100 * (thread_data->read_stats.ops / (double) total_ops); offset = xrandom (&thread_data->state) & (DISK_SIZE - MAX_REQUEST); count = xrandom (&thread_data->state) & (MAX_REQUEST - 1); if (count == 0) count = 1; data = malloc (sizeof *data); /* freed in callback */ data->count = count; if (pc_read_actual < pc_read) { /* read op */ data->stats = &thread_data->read_stats; r = nbd_aio_pread (nbd, sink, count, offset, (nbd_completion_callback) { .callback = cb, .user_data = data, }, 0); } else { if (xrandom (&thread_data->state) & 1) { /* write op */ data->stats = &thread_data->write_stats; r = nbd_aio_pwrite (nbd, wrbuf, count, offset, (nbd_completion_callback) { .callback = cb, .user_data = data, }, 0); } else { /* trim op */ data->stats = &thread_data->trim_stats; r = nbd_aio_trim (nbd, count, offset, (nbd_completion_callback) { .callback = cb, .user_data = data, }, 0); } } if (r == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } } return NULL; } nbdkit-1.42.2/plugins/0000755000175000017500000000000014771247242010307 5nbdkit-1.42.2/plugins/Makefile.am0000644000175000017500000000302414534316443012257 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = plugins.syms SUBDIRS = $(plugins) nbdkit-1.42.2/plugins/Makefile.in0000644000175000017500000006111614771245447012306 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll EXTRA_DIST = plugins.syms SUBDIRS = $(plugins) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nbdkit-1.42.2/plugins/plugins.syms0000644000175000017500000000336714534316443012633 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # This linker script controls the visibility of symbols in plugins. # Plugins only need to export the "plugin_init" function and debug # flags. # # Use of this linker script is entirely optional. It's just for # hygiene. { global: plugin_init; *_debug_*; # Everything else is hidden. local: *; }; nbdkit-1.42.2/plugins/S3/0000755000175000017500000000000014771247241010573 5nbdkit-1.42.2/plugins/S3/Makefile.am0000644000175000017500000000411214534316443012543 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk source = S3.py EXTRA_DIST = \ $(source) \ nbdkit-S3-plugin.pod \ nbdkit.py \ $(NULL) if HAVE_PYTHON plugin_SCRIPTS = nbdkit-S3-plugin CLEANFILES += nbdkit-S3-plugin # We have to do the rewriting here to avoid stupid exec_prefix. nbdkit-S3-plugin: $(source) rm -f $@ $@-t $(SED) 's,\@sbindir\@,${sbindir},g' < $< > $@-t mv $@-t $@ chmod 0555 $@ if HAVE_POD man_MANS = nbdkit-S3-plugin.1 CLEANFILES += $(man_MANS) nbdkit-S3-plugin.1: nbdkit-S3-plugin.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD endif nbdkit-1.42.2/plugins/S3/Makefile.in0000644000175000017500000005763714771245447012610 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_PYTHON_TRUE@am__append_1 = nbdkit-S3-plugin @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@am__append_2 = $(man_MANS) subdir = plugins/S3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)" SCRIPTS = $(plugin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_1) \ $(am__append_2) source = S3.py EXTRA_DIST = \ $(source) \ nbdkit-S3-plugin.pod \ nbdkit.py \ $(NULL) @HAVE_PYTHON_TRUE@plugin_SCRIPTS = nbdkit-S3-plugin @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@man_MANS = nbdkit-S3-plugin.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/S3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/S3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginSCRIPTS: $(plugin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(plugin_SCRIPTS)'; test -n "$(plugindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(plugindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(plugindir)$$dir" || exit $$?; \ } \ ; done uninstall-pluginSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(plugin_SCRIPTS)'; test -n "$(plugindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(plugindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-pluginSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pluginSCRIPTS uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-pluginSCRIPTS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 \ uninstall-pluginSCRIPTS .PRECIOUS: Makefile # We have to do the rewriting here to avoid stupid exec_prefix. @HAVE_PYTHON_TRUE@nbdkit-S3-plugin: $(source) @HAVE_PYTHON_TRUE@ rm -f $@ $@-t @HAVE_PYTHON_TRUE@ $(SED) 's,\@sbindir\@,${sbindir},g' < $< > $@-t @HAVE_PYTHON_TRUE@ mv $@-t $@ @HAVE_PYTHON_TRUE@ chmod 0555 $@ @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@nbdkit-S3-plugin.1: nbdkit-S3-plugin.pod \ @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@@HAVE_PYTHON_TRUE@ $< # 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: nbdkit-1.42.2/plugins/S3/S3.py0000755000175000017500000006460214623341243011356 #!@sbindir@/nbdkit python # -*- python -*- # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. import base64 import errno import os import re import secrets import tempfile import threading from typing import Any, Dict, Optional, Union, List import unittest from contextlib import closing, contextmanager from io import BytesIO from unittest.mock import patch import boto3 from botocore.exceptions import ( ClientError, ReadTimeoutError, ConnectTimeoutError, ConnectionClosedError) import nbdkit API_VERSION = 2 BinaryData = Union[bytes, bytearray, memoryview] class Config: """Holds configuration data passed in by the user.""" def __init__(self) -> None: self.access_key = None self.secret_key = None self.session_token = None self.endpoint_url = None self.bucket_name = None self.key_name = None self.dev_size = None self.obj_size = None def set(self, key: str, value: str) -> None: """Set a configuration value.""" if key == "access-key" or key == "access_key": self.access_key = nbdkit.read_password(value).decode("ascii") elif key == "secret-key" or key == "secret_key": self.secret_key = nbdkit.read_password(value).decode("ascii") elif key == "session-token" or key == "session_token": self.session_token = nbdkit.read_password(value).decode("ascii") elif key == "endpoint-url" or key == "endpoint_url": self.endpoint_url = value elif key == "bucket": self.bucket_name = value elif key == "key": self.key_name = value elif key == 'size': self.dev_size = nbdkit.parse_size(value) elif key == 'object-size': self.obj_size = nbdkit.parse_size(value) else: raise RuntimeError("unknown parameter %s" % key) def validate(self) -> None: """Validate configuration settings.""" if self.bucket_name is None: raise RuntimeError("bucket parameter missing") if self.key_name is None: raise RuntimeError("key parameter missing") if (self.dev_size and not self.obj_size or self.obj_size and not self.dev_size): raise RuntimeError( "`size` and `object-size` parameters must always be " "specified together") if self.dev_size and self.dev_size % self.obj_size != 0: raise RuntimeError('`size` must be a multiple of `object-size`') def thread_model(): return nbdkit.THREAD_MODEL_PARALLEL def can_write(server): return cfg.obj_size is not None def can_multi_conn(server): return True def can_trim(server): return True def can_zero(server): return True def can_fast_zero(server): return True def can_cache(server): return nbdkit.CACHE_NONE def block_size(server): if not cfg.obj_size: # More or less arbitrary. return (1, 512*1024, 0xffffffff) # Should return (minimum, preferred, maximum) block size. We return the # same value for preferred and maximum because even though the plugin can # handle arbitrary large and small blocks, the performance penalty is # huge, and it is always preferable for the client to split up requests # as needed. At the same time, the minimum accessible block size is still # 1 byte. return (1, cfg.obj_size, cfg.obj_size) def can_fua(server): return nbdkit.FUA_NATIVE def can_flush(server): return True def config(key, value): cfg.set(key, value) def config_complete(): cfg.validate() def open(readonly): return Server() def get_size(server): return server.get_size() def pread(server, buf, offset, flags): try: return server.pread(buf, offset, flags) except (ReadTimeoutError, ConnectTimeoutError, ConnectionClosedError): nbdkit.debug('S3 connection timed out on pread()') nbdkit.set_error(errno.ETIMEDOUT) def pwrite(server, buf, offset, flags): try: return server.pwrite(buf, offset, flags) except (ReadTimeoutError, ConnectTimeoutError, ConnectionClosedError): nbdkit.debug('S3 connection timed out on write()') nbdkit.set_error(errno.ETIMEDOUT) def trim(server, size, offset, flags): try: return server.trim(size, offset, flags) except (ReadTimeoutError, ConnectTimeoutError, ConnectionClosedError): nbdkit.debug('S3 connection timed out on trim()') nbdkit.set_error(errno.ETIMEDOUT) def zero(server, size, offset, flags): try: return server.zero(size, offset, flags) except (ReadTimeoutError, ConnectTimeoutError, ConnectionClosedError): nbdkit.debug('S3 connection timed out on trim()') nbdkit.set_error(errno.ETIMEDOUT) def flush(server, flags): # Flush is implicitly done on every request. return class Server: """Handles NBD requests for one connection.""" def __init__(self) -> None: self.s3 = boto3.client( "s3", aws_access_key_id=cfg.access_key, aws_secret_access_key=cfg.secret_key, aws_session_token=cfg.session_token, endpoint_url=cfg.endpoint_url) def get_size(self) -> int: if cfg.dev_size: return cfg.dev_size try: resp = self.s3.head_object( Bucket=cfg.bucket_name, Key=cfg.key_name) except AttributeError: resp = self.s3.get_object( Bucket=cfg.bucket_name, Key=cfg.key_name) size = resp['ResponseMetadata']['HTTPHeaders']['content-length'] return int(size) def pread(self, buf: Union[bytearray, memoryview], offset: int, flags: int) -> None: to_read = len(buf) if not cfg.obj_size: buf[:] = self._get_object(cfg.key_name, size=to_read, off=offset) return read = 0 (blockno, block_offset) = divmod(offset, cfg.obj_size) while to_read > 0: key = f"{cfg.key_name}/{blockno:016x}" len_ = min(to_read, cfg.obj_size - block_offset) buf[read:read + len_] = self._get_object( key, size=len_, off=block_offset ) to_read -= len_ read += len_ blockno += 1 block_offset = 0 def _get_object(self, obj_name: str, size: int, off: int) -> bytes: """Read *size* bytes from *obj_name*, starting at *off*.""" try: resp = self.s3.get_object(Bucket=cfg.bucket_name, Key=obj_name, Range=f'bytes={off}-{off+size-1}') except ClientError as exc: if exc.response['Error']['Code'] == 'NoSuchKey': return bytearray(size) raise body = resp['Body'] with closing(body): buf = body.read() assert len(buf) == size, f'requested {size} bytes, got {len(buf)}' return buf def pwrite(self, buf: BinaryData, offset: int, flags: int) -> None: # We can ignore FUA flags, because every write is always flushed if not cfg.obj_size: raise RuntimeError('Unable to write in single-object mode') # memoryviews can be sliced without copying the data if not isinstance(buf, memoryview): buf = memoryview(buf) # Calculate block number and offset within the block for the # first byte that we need to write. (blockno1, block_offset1) = divmod(offset, cfg.obj_size) # Calculate block number of the last block that we have to # write to, and how many bytes we need to write into it. (blockno2, block_len2) = divmod(offset + len(buf), cfg.obj_size) # Special case: start and end is within the same one block if blockno1 == blockno2 and (block_offset1 != 0 or block_len2 != 0): nbdkit.debug(f"pwrite(): write at offset {offset} not aligned, " f"covers bytes {block_offset1} to {block_len2} of " f"block {blockno1}. Rewriting full block...") # We could separately fetch the prefix and suffix, but give that # we're always writing full blocks, it's likely that the latency of # two separate read requests would be much bigger than the savings # in volume. key = f'{cfg.key_name}/{blockno1:016x}' with obj_lock(key): fbuf = bytearray(self._get_object( key, size=cfg.obj_size, off=0)) fbuf[block_offset1:block_len2] = buf self._put_object(key, fbuf) return # First write is not aligned to first block if block_offset1: nbdkit.debug( f"pwrite(): write at offset {offset} not aligned, " f"starts {block_offset1} bytes into block {blockno1}. " "Rewriting full block...") key = f'{cfg.key_name}/{blockno1:016x}' with obj_lock(key): pre = self._get_object(key, size=block_offset1, off=0) len_ = cfg.obj_size - block_offset1 self._put_object(key, pre + buf[:len_]) buf = buf[len_:] blockno1 += 1 # Last write is not a full block if block_len2: nbdkit.debug(f"pwrite(): write at offset {offset} not aligned, " f"ends {cfg.obj_size-block_len2} bytes before block " f"{blockno2+1}. Rewriting full block...") key = f'{cfg.key_name}/{blockno2:016x}' with obj_lock(key): len_ = cfg.obj_size - block_len2 post = self._get_object(key, size=len_, off=block_len2) self._put_object(key, concat(buf[-block_len2:], post)) buf = buf[:-block_len2] off = 0 for blockno in range(blockno1, blockno2): key = f"{cfg.key_name}/{blockno:016x}" with obj_lock(key): nbdkit.debug(f"pwrite(): writing block {blockno}...") self._put_object(key, buf[off:off + cfg.obj_size]) off += cfg.obj_size def _put_object(self, obj_name: str, buf: BinaryData) -> None: """Write *buf* into *obj_name""" assert len(buf) == cfg.obj_size # Boto does not support reading from memoryviews :-( if isinstance(buf, memoryview): buf = buf.tobytes() self.s3.put_object(Bucket=cfg.bucket_name, Key=obj_name, Body=buf) def zero(self, size: int, offset: int, flags: int) -> None: nbdkit.debug(f'Processing zero(size={size}, off={offset})') if size == 0: return # Calculate block number and offset within the block for the # first byte that we need to write. (blockno1, block_offset1) = divmod(offset, cfg.obj_size) # Calculate block number of the last block that we have to # write to, and how many bytes we need to write into it. (blockno2, block_len2) = divmod(offset + size, cfg.obj_size) if blockno1 == blockno2: nbdkit.debug(f'Zeroing {size} bytes in block {blockno1} ' f'(offset {offset})') self.pwrite(bytearray(size), offset=offset, flags=0) return if block_offset1: len_ = cfg.obj_size - block_offset1 nbdkit.debug(f'Zeroing last {len_} bytes of block {blockno1} ' f'(offset {offset})') self.pwrite(bytearray(len_), offset=offset, flags=0) blockno1 += 1 if block_len2: off = cfg.obj_size * blockno2 nbdkit.debug(f'Zeroing first {block_len2-1} bytes of block ' f'{blockno2} (offset {off})') self.pwrite(bytearray(block_len2), offset=off, flags=0) self._delete_objects(blockno1, blockno2) def trim(self, size: int, offset: int, flags: int) -> None: nbdkit.debug(f'Processing trim(size={size}, off={offset})') if size == 0: return # Note, NBD protocol allows to round the offset up and size down to # meet internal alignment constraints. # Calculate block number and offset within the block for the # first byte that we need to trim. (blockno1, block_offset1) = divmod(offset, cfg.obj_size) if block_offset1 != 0: blockno1 += 1 # Calculate block number of the block following the last one that we # have to trim fully. (blockno2, _) = divmod(offset + size, cfg.obj_size) if blockno1 == blockno2: nbdkit.debug('nothing to delete') return self._delete_objects(blockno1, blockno2) def _delete_objects(self, first: int, last: int) -> None: """Delete objects *first* (inclusive) to *last* (exclusive)""" nbdkit.debug(f'Deleting objects {first} to {last}...') if first >= last: return if first == 0: start_after = '' else: start_after = f"{cfg.key_name}/{first-1:016x}" last_key = f"{cfg.key_name}/{last:016x}" to_delete = [] for key in self._list_objects(f"{cfg.key_name}/", start_after=start_after): if key >= last_key: break to_delete.append({'Key': key}) nbdkit.debug(f'Marking object {key} for removal') if len(to_delete) >= 1000: resp = self.s3.delete_objects(Bucket=cfg.bucket_name, Delete={ 'Objects': to_delete, 'Quiet': True}) if resp.get('Errors', None): raise RuntimeError( 'Failed to delete objects: %s' % resp['Errors']) del to_delete[:] if not to_delete: return resp = self.s3.delete_objects(Bucket=cfg.bucket_name, Delete={ 'Objects': to_delete, 'Quiet': True}) if resp.get('Errors', None): raise RuntimeError( 'Failed to delete objects: %s' % resp['Errors']) def _list_objects(self, prefix: str, start_after: Optional[str] = None) -> List[str]: """Return keys for objects in the bucket. Lists all keys starting with *prefix* in lexicographic order, starting with the key following *start_after*. """ args = { 'Bucket': cfg.bucket_name, 'Prefix': prefix, } if start_after is not None: args['StartAfter'] = start_after while True: resp = self.s3.list_objects_v2(**args) if 'Contents' not in resp: return for el in resp['Contents']: yield el['Key'] if not resp['IsTruncated']: return args['ContinuationToken'] = resp['NextContinuationToken'] def concat(b1, b2): """Concatenate two byte-like objects (including memoryviews)""" l1 = len(b1) l3 = l1 + len(b2) b3 = bytearray(l3) b3[:l1] = b1 b3[l1:] = b2 return b3 def put_object(s3, obj_name, buf): """Write *buf* into *obj_name""" assert len(buf) == cfg.obj_size # Boto does not support reading from memoryviews :-( if isinstance(buf, memoryview): buf = buf.tobytes() s3.put_object(Bucket=cfg.bucket_name, Key=obj_name, Body=buf) def make_client_error(errcode): return ClientError( error_response={'Error': {'Code': errcode}}, operation_name='unspecified') class MultiLock: """Provides locking for large amounts of entities. This class provides locking for a dynamically changing and potentially large set of entities, avoiding the need to allocate a separate lock for each entity. The `acquire` and `release` methods have an additional argument, the locking key, and only locks with the same key can see each other (ie, several threads can hold locks with different locking keys at the same time). """ def __init__(self): self.locked_keys = set() self.cond = threading.Condition() @contextmanager def __call__(self, key): self.acquire(key) try: yield finally: self.release(key) def acquire(self, key): """Acquire lock for given key.""" with self.cond: while key in self.locked_keys: self.cond.wait() self.locked_keys.add(key) def release(self, key): """Release lock on given key""" with self.cond: self.locked_keys.remove(key) self.cond.notify_all() ################### # Global state # ################### cfg = Config() obj_lock = MultiLock() ###################### # Unit Tests # ###################### class MockS3Client: def __init__(self): self.keys = {} def put_object(self, Bucket: str, Key: str, Body): self.keys[(Bucket, Key)] = bytes(Body) def get_object(self, Bucket: str, Key: str, Range=None): key = (Bucket, Key) if key not in self.keys: raise make_client_error('NoSuchKey') if Range: hit = re.match(r'^bytes=(\d+)-(\d+)$', Range) assert hit (a, b) = [int(x) for x in hit.groups()] buf = self.keys[key][a:b+1] else: buf = self.keys[key] return {'Body': BytesIO(buf)} def delete_objects(self, Bucket: str, Delete: Dict[str, Any]): for el in Delete['Objects']: key = (Bucket, el['Key']) if key not in self.keys: raise make_client_error('NoSuchKey') del self.keys[key] return {'Errors': []} def list_objects_v2(self, Bucket: str, ContinuationToken: str = '', Prefix: str = '', StartAfter: str = ''): assert not ContinuationToken all_keys = sorted(x[1] for x in self.keys if x[0] == Bucket and x[1].startswith(Prefix)) contents = [] for k in all_keys: if k <= StartAfter: continue contents.append({'Key': k}) return {'IsTruncated': False, 'Contents': contents, 'NextContinuationToken': ''} class LocalTest(unittest.TestCase): def setUp(self): super().setUp() self.obj_size = 16 self.dev_size = 20*self.obj_size self.ref_fh = tempfile.TemporaryFile() self.ref_fh.truncate(cfg.dev_size) config('bucket', 'testbucket') config('key', 'nbdkit_test') config('object-size', str(self.obj_size)) config('size', str(self.dev_size)) config_complete() with patch.object(boto3, 'client') as mock_client: mock_client.return_value = MockS3Client() self.s3 = open(False) def tearDown(self) -> None: super().tearDown() self.ref_fh.close() @staticmethod def get_data(len): buf = secrets.token_bytes(len // 2 + 1) return base64.b16encode(buf)[:len] def compare_to_ref(self): fh = self.ref_fh bl = self.obj_size buf = bytearray(bl) fh.seek(0) for off in range(0, self.dev_size, bl): ref = fh.read(bl) pread(self.s3, buf, off, flags=0) self.assertEqual( ref, buf, f'mismatch at off={off} (blk {off // bl})') def test_write_memoryview(self): buf = memoryview(bytearray(cfg.obj_size)) pwrite(self.s3, buf, 0, 0) pwrite(self.s3, buf[10:], 42, 0) def test_read(self): fh = self.ref_fh bl = self.obj_size # Fill disk fh.seek(0) for off in range(0, self.dev_size, self.obj_size): buf = self.get_data(bl) pwrite(self.s3, buf, offset=off, flags=0) fh.write(buf) self.compare_to_ref() # Test different kinds of read requests corner_cases = ( 1, 2, bl-2, bl-1, bl+2, 2*bl-1, 2*bl, 2*bl+1, 5*bl-5, 5*bl, 5*bl+5) for off in (0,) + corner_cases: for len_ in corner_cases: buf = bytearray(len_) pread(self.s3, buf, off, flags=0) fh.seek(off) ref = fh.read(len_) self.assertEqual(buf, ref) def test_write(self): fh = self.ref_fh bl = self.obj_size # Fill disk fh.seek(0) for off in range(0, self.dev_size, bl): buf = self.get_data(bl) pwrite(self.s3, buf, offset=off, flags=0) fh.write(buf) self.compare_to_ref() # Test different kinds of write requests corner_cases = ( 1, 2, bl-2, bl-1, bl+2, 2*bl-1, 2*bl, 2*bl+1, 5*bl-5, 5*bl, 5*bl+5) for off in (0,) + corner_cases: for len_ in corner_cases: buf = self.get_data(len_) pwrite(self.s3, buf, off, flags=0) fh.seek(off) fh.write(buf) self.compare_to_ref() def test_zero(self): fh = self.ref_fh bl = self.obj_size # Fill disk fh.seek(0) for off in range(0, self.dev_size, bl): buf = self.get_data(bl) pwrite(self.s3, buf, offset=off, flags=0) fh.write(buf) self.compare_to_ref() # Test different kinds of zero requests corner_cases = ( 1, 2, bl-2, bl-1, bl, bl+2, 2*bl-1, 2*bl, 2*bl+1, 5*bl-5, 5*bl, 5*bl+5) for flags in (0, nbdkit.FLAG_MAY_TRIM): for off in (0,) + corner_cases: for len_ in corner_cases: zero(self.s3, len_, off, flags=flags) fh.seek(off) fh.write(bytearray(len_)) self.compare_to_ref() # Re-fill with data buf = self.get_data(len_) pwrite(self.s3, buf, off, flags=0) fh.seek(off) fh.write(buf) def test_trim(self): bl = self.obj_size # Fill disk for off in range(0, self.dev_size, self.obj_size): pwrite(self.s3, self.get_data(bl), offset=off, flags=0) # Test different kinds of trim requests corner_cases = ( 1, 2, bl-2, bl-1, bl+2, 2*bl-1, 2*bl, 2*bl+1, 5*bl-5, 5*bl, 5*bl+5) for off in (0,) + corner_cases: for len_ in corner_cases: (b1, o1) = divmod(off, bl) (b2, o2) = divmod(off + len_, bl) obj_count1 = len(list(self.s3._list_objects(cfg.key_name))) trim(self.s3, len_, off, flags=0) obj_count2 = len(list(self.s3._list_objects(cfg.key_name))) blocks_to_delete = b2-b1 if o1 != 0 and blocks_to_delete >= 1: blocks_to_delete -= 1 self.assertEqual(obj_count1 - blocks_to_delete, obj_count2) # Re-fill with data pwrite(self.s3, self.get_data(len_), off, flags=0) # To run unit tests against a real S3 bucket, set the TEST_BUCKET and # (optionally) TEST_ENDPOINT environment variables. The point of these tests is # to make sure we're calling boto correctly, not to test any plugin code. @unittest.skipIf('TEST_BUCKET' not in os.environ, 'TEST_BUCKET environment variable not defined.') class RemoteTest(unittest.TestCase): def setUp(self): super().setUp() self.obj_size = 64 self.dev_size = 20*self.obj_size config('bucket', os.environ['TEST_BUCKET']) if 'TEST_ENDPOINT' in os.environ: config('endpoint-url', os.environ['TEST_ENDPOINT']) config('key', 'nbdkit_test') config('object-size', str(self.obj_size)) config('size', str(self.dev_size)) config_complete() self.s3 = open(False) def tearDown(self) -> None: super().tearDown() @staticmethod def get_data(len): buf = secrets.token_bytes(len // 2 + 1) return base64.b16encode(buf)[:len] def test_zero(self): bs = self.obj_size ref_buf = bytearray(self.get_data(3*bs)) pwrite(self.s3, ref_buf, 0, 0) zero_start = bs//2 zero(self.s3, 2*bs, zero_start, 0) ref_buf[zero_start:zero_start + 2*bs] = bytearray(2*bs) buf = bytearray(len(ref_buf)) pread(self.s3, buf, 0, 0) self.assertEqual(buf, ref_buf) def test_trim(self): ref_buf = bytearray(self.get_data(3*self.obj_size)) pwrite(self.s3, ref_buf, 0, 0) obj_count1 = len(list(self.s3._list_objects(cfg.key_name))) trim_start = self.obj_size//2 trim(self.s3, 2*self.obj_size, trim_start, 0) obj_count2 = len(list(self.s3._list_objects(cfg.key_name))) self.assertEqual(obj_count1-1, obj_count2) def test_readwrite(self): ref_buf = self.get_data(2*self.obj_size) start_off = self.obj_size//2 pwrite(self.s3, ref_buf, start_off, 0) buf = bytearray(len(ref_buf)) pread(self.s3, buf, start_off, 0) self.assertEqual(buf, ref_buf) nbdkit-1.42.2/plugins/S3/nbdkit-S3-plugin.pod0000644000175000017500000001445414623341243014252 =head1 NAME nbdkit-S3-plugin - expose data in Amazon S3 or Ceph buckets as block device =head1 SYNOPSIS nbdkit S3 [access-key=...] [secret-key=...] [session-token=...] [endpoint-url=...] [size=NN object-size=NN] bucket=BUCKET key=STRING =head1 DESCRIPTION C is a plugin for L which lets you open objects stored in Amazon S3 or Ceph as disk images. This plugin uses the Python Amazon Web Services SDK called Boto3. =head1 EXAMPLES nbdkit S3 endpoint-url=https://ceph.example.com \ bucket=MY-BUCKET key=disk.img Provides read only block device holding the data contained in the "disk.img" object. nbdkit S3 endpoint-url=https://ceph.example.com \ size=50G object-size=128k \ bucket=MY-BUCKET key=disk Provides a read-write block device with size 50G, whose contents are stored multiple in objects of size 128k, prefixed with I =head1 PARAMETERS =over 4 =item BACCESS_KEY =item BFILENAME =item B =item BFD =item BSECRET_KEY =item BFILENAME =item B =item BFD =item BSESSION_TOKEN =item BFILENAME =item B =item BFD Pass AWS credentials. See L. =item BENDPOINT If accessing Ceph or another compatible S3 service, provide the endpoint URL through this parameter. =item BBUCKET The bucket containing the object(s). This parameter is required. =item BSTRING The object name (if C is not specified) or object prefix (if C is specified) to use within the bucket. This parameter is required. =item BSIZE =item BSIZE These two parameters must always be specified together. If set, data will be split into blocks of C and stored as separate objects. The block device will report a total size of C and be writeable and trim-able. Object names will have the form I, where C<%16x> is the 16-digit hexadecimal block number. If there are existing objects under such name that do not have the expected size, the plugin will crash. =back =head1 PERFORMANCE CONSIDERATIONS It is highly recommended that clients do their utmost to issue requests that exactly match the object size: Smaller write requests will incur a performance penalty due to the need for read-modify-write cycles (thus also incurring latency from two network round-trips). Larger read and write requests will incur a performance penalty because of sequential execution. The L can be used to alleviate the impact of requests larger than the object size, but does not help if the client issues requests smaller than the block size. The L can be used to investigate what block sizes and alignments are used by the client. When connecting through the Linux kernel's NBD module, consider setting CXE/queue/max_sectors_kb> to match the object size. =head1 CREDENTIALS You can pass AWS credentials in several ways: =over 4 =item In plaintext on the nbdkit command line For example: nbdkit S3 access-key=ABC secret-key=SECRET session-token=123 This is B since a user on the same machine could read them using L. =item Via files on the nbdkit command line (nbdkit E 1.38) For example: nbdkit S3 access-key=+/tmp/access [...] Be careful with the permissions on these files to ensure that no one else can read the sensitive information. =item Interactively when nbdkit starts up (nbdkit E 1.38) For example: nbdkit S3 access-key=- [...] nbdkit will ask for each key to be entered interactively. =item Inherited through a file descriptor (nbdkit E 1.38) For example: nbdkit S3 access-key=-3 [...] The parent process must set up the file descriptor (FD 3 in the example) so that nbdkit can read the key from it. =item Using F<~/.aws/credentials> file This file takes the form: [default] aws_access_key_id = XXX aws_secret_access_key = YYY [profile] aws_access_key_id = XXX aws_secret_access_key = YYY Different profiles from the file can be selected by setting the C environment variable. =item Through environment variables Use the environment variables C, C and C. =back There is much more information about credentials in L. =head1 COMPARISON TO S3FS-FUSE AND S3BACKER s3fs-fuse (L) and s3backer (L) provide similar functionality but are based on FUSE (rather than NBD). They provide a regular file (backed by S3) which can then be loopback-mounted to provide a block device. s3backer also supports to optionally encrypt and compress objects. In theory, NBD should provide better performance than FUSE, because: =over 4 =item * The kernel no longer serializes write and read requests but issues them concurrently. =item * Read and write request size can exceed 128 kB =item * The system can still be reliably hibernated (a running FUSE daemon may prevent this) =item * Requests pass through the VFS only once, not twice =item * Data is present in the page cache only once, not twice =back However, for high-bandwidth network connections s3backer and s3fs-fuse may be faster because they are written in C rather than Python. =head1 FILES =over 4 =item F<$plugindir/nbdkit-S3-plugin> The plugin. Use C to find the location of C<$plugindir>. =item F<$HOME/.aws/credentials> AWS credentials can be passed to boto3 using this file. =back =head1 ENVIRONMENT VARIABLES =over 4 =item C Boto3 reads some credential information from C environment variables. =back =head1 VERSION C first appeared in nbdkit 1.24. =head1 SEE ALSO L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones Nikolaus Rath =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/plugins/S3/nbdkit.py0000644000175000017500000000065414534316443012343 #!/usr/bin/env python3 """ The real nbdkit module is only available when the Python interpreter runs inside the nbdkit binary. To get unit tests to pass, we provide this "stub" module that provides just the minimum attributes to do unit testing. """ import logging log = logging.getLogger(__name__) FLAG_MAY_TRIM = 1 def parse_size(v): return int(v) def debug(msg): log.debug(msg) def set_error(err): pass nbdkit-1.42.2/plugins/blkio/0000755000175000017500000000000014771247241011406 5nbdkit-1.42.2/plugins/blkio/Makefile.am0000644000175000017500000000503714534316443013365 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = nbdkit-blkio-plugin.pod if HAVE_LIBBLKIO plugin_LTLIBRARIES = nbdkit-blkio-plugin.la nbdkit_blkio_plugin_la_SOURCES = \ blkio.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(NULL) nbdkit_blkio_plugin_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ $(NULL) nbdkit_blkio_plugin_la_CFLAGS = \ $(WARNINGS_CFLAGS) \ $(LIBBLKIO_CFLAGS) \ $(NULL) nbdkit_blkio_plugin_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ $(IMPORT_LIBRARY_ON_WINDOWS) \ $(LIBBLKIO_LIBS) \ $(NULL) nbdkit_blkio_plugin_la_LDFLAGS = \ -module -avoid-version -shared $(NO_UNDEFINED_ON_WINDOWS) \ $(NULL) if USE_LINKER_SCRIPT nbdkit_blkio_plugin_la_LDFLAGS += \ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms endif if HAVE_POD man_MANS = nbdkit-blkio-plugin.1 CLEANFILES += $(man_MANS) nbdkit-blkio-plugin.1: nbdkit-blkio-plugin.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD endif nbdkit-1.42.2/plugins/blkio/Makefile.in0000644000175000017500000010000214771245447013372 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_LIBBLKIO_TRUE@@USE_LINKER_SCRIPT_TRUE@am__append_1 = \ @HAVE_LIBBLKIO_TRUE@@USE_LINKER_SCRIPT_TRUE@ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@am__append_2 = $(man_MANS) subdir = plugins/blkio ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)" LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_DEPENDENCIES = \ @HAVE_LIBBLKIO_TRUE@ $(top_builddir)/common/utils/libutils.la \ @HAVE_LIBBLKIO_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_LIBBLKIO_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_LIBBLKIO_TRUE@ $(am__DEPENDENCIES_1) am__nbdkit_blkio_plugin_la_SOURCES_DIST = blkio.c \ $(top_srcdir)/include/nbdkit-plugin.h am__objects_1 = @HAVE_LIBBLKIO_TRUE@am_nbdkit_blkio_plugin_la_OBJECTS = \ @HAVE_LIBBLKIO_TRUE@ nbdkit_blkio_plugin_la-blkio.lo \ @HAVE_LIBBLKIO_TRUE@ $(am__objects_1) nbdkit_blkio_plugin_la_OBJECTS = $(am_nbdkit_blkio_plugin_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_blkio_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(nbdkit_blkio_plugin_la_CFLAGS) $(CFLAGS) \ $(nbdkit_blkio_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LIBBLKIO_TRUE@am_nbdkit_blkio_plugin_la_rpath = -rpath \ @HAVE_LIBBLKIO_TRUE@ $(plugindir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nbdkit_blkio_plugin_la_SOURCES) DIST_SOURCES = $(am__nbdkit_blkio_plugin_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_2) EXTRA_DIST = nbdkit-blkio-plugin.pod @HAVE_LIBBLKIO_TRUE@plugin_LTLIBRARIES = nbdkit-blkio-plugin.la @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_SOURCES = \ @HAVE_LIBBLKIO_TRUE@ blkio.c \ @HAVE_LIBBLKIO_TRUE@ $(top_srcdir)/include/nbdkit-plugin.h \ @HAVE_LIBBLKIO_TRUE@ $(NULL) @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_CPPFLAGS = \ @HAVE_LIBBLKIO_TRUE@ -I$(top_srcdir)/include \ @HAVE_LIBBLKIO_TRUE@ -I$(top_builddir)/include \ @HAVE_LIBBLKIO_TRUE@ -I$(top_srcdir)/common/include \ @HAVE_LIBBLKIO_TRUE@ -I$(top_srcdir)/common/utils \ @HAVE_LIBBLKIO_TRUE@ $(NULL) @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_CFLAGS = \ @HAVE_LIBBLKIO_TRUE@ $(WARNINGS_CFLAGS) \ @HAVE_LIBBLKIO_TRUE@ $(LIBBLKIO_CFLAGS) \ @HAVE_LIBBLKIO_TRUE@ $(NULL) @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_LIBADD = \ @HAVE_LIBBLKIO_TRUE@ $(top_builddir)/common/utils/libutils.la \ @HAVE_LIBBLKIO_TRUE@ $(IMPORT_LIBRARY_ON_WINDOWS) \ @HAVE_LIBBLKIO_TRUE@ $(LIBBLKIO_LIBS) \ @HAVE_LIBBLKIO_TRUE@ $(NULL) @HAVE_LIBBLKIO_TRUE@nbdkit_blkio_plugin_la_LDFLAGS = -module \ @HAVE_LIBBLKIO_TRUE@ -avoid-version -shared \ @HAVE_LIBBLKIO_TRUE@ $(NO_UNDEFINED_ON_WINDOWS) $(NULL) \ @HAVE_LIBBLKIO_TRUE@ $(am__append_1) @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@man_MANS = nbdkit-blkio-plugin.1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/blkio/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/blkio/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } nbdkit-blkio-plugin.la: $(nbdkit_blkio_plugin_la_OBJECTS) $(nbdkit_blkio_plugin_la_DEPENDENCIES) $(EXTRA_nbdkit_blkio_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(nbdkit_blkio_plugin_la_LINK) $(am_nbdkit_blkio_plugin_la_rpath) $(nbdkit_blkio_plugin_la_OBJECTS) $(nbdkit_blkio_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit_blkio_plugin_la-blkio.lo: blkio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_blkio_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_blkio_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_blkio_plugin_la-blkio.lo -MD -MP -MF $(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Tpo -c -o nbdkit_blkio_plugin_la-blkio.lo `test -f 'blkio.c' || echo '$(srcdir)/'`blkio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Tpo $(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkio.c' object='nbdkit_blkio_plugin_la-blkio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_blkio_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_blkio_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_blkio_plugin_la-blkio.lo `test -f 'blkio.c' || echo '$(srcdir)/'`blkio.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/nbdkit_blkio_plugin_la-blkio.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pluginLTLIBRARIES uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pluginLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-pluginLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 uninstall-pluginLTLIBRARIES .PRECIOUS: Makefile @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@nbdkit-blkio-plugin.1: nbdkit-blkio-plugin.pod \ @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@ $(top_builddir)/podwrapper.pl @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@ --html $(top_builddir)/html/$@.html \ @HAVE_LIBBLKIO_TRUE@@HAVE_POD_TRUE@ $< # 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: nbdkit-1.42.2/plugins/blkio/blkio.c0000644000175000017500000003567514534316443012610 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #define NBDKIT_API_VERSION 2 #include #include "array-size.h" #include "const-string-vector.h" #include "vector.h" #define MAX_BOUNCE_BUFFER (64 * 1024 * 1024) /* libblkio could do parallel, but we would need to reimplement this * plugin to use the libblkio event model. */ #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS struct property { const char *name; char *value; bool value_needs_free; }; DEFINE_VECTOR_TYPE (properties, struct property); static const char *driver = NULL; /* driver name - required */ static properties props = empty_vector; /* other command line params */ static const_string_vector get_params = empty_vector; /* get= parameters */ /* XXX Should be possible to query this from libblkio. */ static bool is_preconnect_property (const char *name) { static const char *preconnect_props[] = { "can-add-queues", "driver", "fd", "path", "read-only" }; size_t i; for (i = 0; i < ARRAY_SIZE (preconnect_props); ++i) if (strcmp (name, preconnect_props[i]) == 0) return true; return false; } /* Path properties need to be rewritten using nbdkit_absolute_path. */ static bool is_path_property (const char *name) { static const char *path_props[] = { "path" }; size_t i; for (i = 0; i < ARRAY_SIZE (path_props); ++i) if (strcmp (name, path_props[i]) == 0) return true; return false; } static void bio_unload (void) { size_t i; for (i = 0; i < props.len; ++i) if (props.ptr[i].value_needs_free) free (props.ptr[i].value); properties_reset (&props); const_string_vector_reset (&get_params); } /* Called for each key=value passed on the command line. */ static int bio_config (const char *key, const char *value) { if (strcmp (key, "driver") == 0) { if (driver != NULL) { nbdkit_error ("'driver' property set more than once"); return -1; } driver = value; } else if (strcmp (key, "get") == 0) { if (const_string_vector_append (&get_params, value) == -1) return -1; } else if (strcmp (key, "read-only") == 0) { nbdkit_error ("do not set the libblkio \"read-only\" parameter, " "use the nbdkit -r flag if read-only is required"); return -1; } else if (is_path_property (key) == 0) { char *path = nbdkit_absolute_path (value); struct property prop = { .name = key, .value = path, .value_needs_free = true }; if (path == NULL || properties_append (&props, prop) == -1) return -1; } else /* general property */ { struct property prop = { .name = key, .value = (char *) value, .value_needs_free = false }; if (properties_append (&props, prop) == -1) return -1; } return 0; } /* Check the user did pass a driver parameter. */ static int bio_config_complete (void) { if (driver == NULL) { nbdkit_error ("you must supply the driver= parameter " "after the plugin name on the command line"); return -1; } return 0; } #define bio_config_help \ "driver= (required) Driver name (eg. \"nvme-io_uring\").\n" \ "PROPERTY=VALUE Set arbitrary libblkio property.\n" \ "get=PROPERTY Print property name after connection." struct handle { struct blkio *b; struct blkio_mem_region mem_region; }; /* Create the per-connection handle. */ static void * bio_open (int readonly) { struct handle *h; int r; size_t i; bool b; h = calloc (1, sizeof *h); if (h == NULL) { nbdkit_error ("calloc: %m"); return NULL; } r = blkio_create (driver, &h->b); if (r < 0) { nbdkit_error ("blkio_create: error opening driver: %s: %s", driver, blkio_get_error_msg ()); goto error; } /* If the readonly flag (nbdkit -r) is set, set that property. * However don't change the property otherwise. In can_write below * we will check the final read-only status of the device. * * XXX This doesn't work for all drivers. Somehow the user has to * just "know" that a device is read-only (or not) and must set this * property, otherwise libblkio fails to start with error "Device is * read-only". */ if (readonly) { r = blkio_set_bool (h->b, "read-only", true); if (r < 0) { nbdkit_error ("error setting property: read-only=true: %s", blkio_get_error_msg ()); goto error; } } /* Set the pre-connect properties. */ for (i = 0; i < props.len; ++i) { const struct property *prop = &props.ptr[i]; if (is_preconnect_property (prop->name)) { r = blkio_set_str (h->b, prop->name, prop->value); if (r < 0) { nbdkit_error ("error setting property: %s=%s: %s", prop->name, prop->value, blkio_get_error_msg ()); goto error; } } } /* Connect. */ r = blkio_connect (h->b); if (r < 0) { nbdkit_error ("blkio_connect: failed to connect to device: %s", blkio_get_error_msg ()); goto error; } /* Set the post-connect properties. */ for (i = 0; i < props.len; ++i) { const struct property *prop = &props.ptr[i]; if (! is_preconnect_property (prop->name)) { r = blkio_set_str (h->b, prop->name, prop->value); if (r < 0) { nbdkit_error ("error setting property: %s=%s: %s", prop->name, prop->value, blkio_get_error_msg ()); goto error; } } } /* Start the block device. */ r = blkio_start (h->b); if (r < 0) { nbdkit_error ("blkio_start: failed to start device: %s", blkio_get_error_msg ()); goto error; } /* Print any properties requested on the command line (get=...). */ for (i = 0; i < get_params.len; ++i) { const char *name = get_params.ptr[i]; char *value = NULL; if (blkio_get_str (h->b, name, &value) == 0) nbdkit_debug ("get %s = %s", name, value); else nbdkit_debug ("could not get property %s: %m", name); free (value); } /* If memory regions are required, allocate them using the * convenience functions. Note we allocate one buffer per handle. * It is attached to the handle so blkio_destroy will remove it. */ r = blkio_get_bool (h->b, "needs-mem-regions", &b); if (r < 0) { nbdkit_error ("error reading 'needs-mem-regions' property: %s", blkio_get_error_msg ()); goto error; } if (b) { nbdkit_debug ("driver %s requires a bounce buffer", driver); r = blkio_alloc_mem_region (h->b, &h->mem_region, MAX_BOUNCE_BUFFER); if (r < 0) { nbdkit_error ("blkio_alloc_mem_region: %s", blkio_get_error_msg ()); goto error; } r = blkio_map_mem_region (h->b, &h->mem_region); if (r < 0) { nbdkit_error ("blkio_map_mem_region: %s", blkio_get_error_msg ()); goto error; } } return h; error: if (h->b) blkio_destroy (&h->b); free (h); return NULL; } /* Close the handle. */ static void bio_close (void *handle) { struct handle *h = handle; blkio_destroy (&h->b); free (h); } /* Get the device size. */ static int64_t bio_get_size (void *handle) { struct handle *h = handle; int r; uint64_t ret; r = blkio_get_uint64 (h->b, "capacity", &ret); if (r < 0) { nbdkit_error ("error reading device capacity: %s", blkio_get_error_msg ()); return -1; } return ret; } /* Block size preferences. */ static int bio_block_size (void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) { struct handle *h = handle; int request_alignment = 0, optimal_io_alignment = 0; /* Don't worry if these fail. We also assume 0 for unspecified. */ blkio_get_int (h->b, "request-alignment", &request_alignment); blkio_get_int (h->b, "optimal-io-alignment", &optimal_io_alignment); /* Ignore unspecified or bogusly large alignments. */ if (request_alignment <= 0 || request_alignment > 1024*1024 || optimal_io_alignment < 0 || optimal_io_alignment > 1024*1024) { *minimum = *preferred = *maximum = 0; return 0; } *minimum = request_alignment; *preferred = optimal_io_alignment; *maximum = 0xffffffff; return 0; } /* Find out if the connection is writable. */ static int bio_can_write (void *handle) { struct handle *h = handle; int r; bool ro = true; r = blkio_get_bool (h->b, "read-only", &ro); if (r < 0) { nbdkit_error ("blkio_get_bool: read-only: %s", blkio_get_error_msg ()); return -1; } return !ro; } /* We always support FUA natively. */ static int bio_can_fua (void *handle) { return NBDKIT_FUA_NATIVE; } /* Read data from the device. */ static int bio_pread (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { struct handle *h = handle; int r; struct blkioq *q = blkio_get_queue (h->b, 0); struct blkio_completion completion; if (h->mem_region.addr && count > MAX_BOUNCE_BUFFER) { nbdkit_error ("request too large for bounce buffer"); return -1; } blkioq_read (q, offset, h->mem_region.addr ? : buf, count, NULL, 0); r = blkioq_do_io (q, &completion, 1, 1, NULL); if (r != 1) { nbdkit_error ("blkioq_do_io: %s", blkio_get_error_msg ()); return -1; } if (completion.ret != 0) { nbdkit_error ("blkioq_do_io: unexpected read completion.ret %d != 0", completion.ret); return -1; } if (h->mem_region.addr) memcpy (buf, h->mem_region.addr, count); return 0; } /* Write data to the device. */ static int bio_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags) { const bool fua = flags & NBDKIT_FLAG_FUA; struct handle *h = handle; int r; struct blkioq *q = blkio_get_queue (h->b, 0); struct blkio_completion completion; uint32_t bio_flags; if (h->mem_region.addr && count > MAX_BOUNCE_BUFFER) { nbdkit_error ("request too large for bounce buffer"); return -1; } bio_flags = 0; if (fua) bio_flags |= BLKIO_REQ_FUA; if (h->mem_region.addr) memcpy (h->mem_region.addr, buf, count); blkioq_write (q, offset, h->mem_region.addr ? : buf, count, NULL, bio_flags); r = blkioq_do_io (q, &completion, 1, 1, NULL); if (r != 1) { nbdkit_error ("blkioq_do_io: %s", blkio_get_error_msg ()); return -1; } if (completion.ret != 0) { nbdkit_error ("blkioq_do_io: unexpected write completion.ret %d != 0", completion.ret); return -1; } return 0; } /* Flush. */ static int bio_flush (void *handle, uint32_t flags) { struct handle *h = handle; int r; struct blkioq *q = blkio_get_queue (h->b, 0); struct blkio_completion completion; blkioq_flush (q, NULL, 0); r = blkioq_do_io (q, &completion, 1, 1, NULL); if (r != 1) { nbdkit_error ("blkioq_do_io: %s", blkio_get_error_msg ()); return -1; } if (completion.ret != 0) { nbdkit_error ("blkioq_do_io: unexpected flush completion.ret %d != 0", completion.ret); return -1; } return 0; } /* Write zeroes. */ static int bio_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { const bool fua = flags & NBDKIT_FLAG_FUA; const bool may_trim = flags & NBDKIT_FLAG_MAY_TRIM; struct handle *h = handle; int r; struct blkioq *q = blkio_get_queue (h->b, 0); struct blkio_completion completion; uint32_t bio_flags; bio_flags = 0; if (fua) bio_flags |= BLKIO_REQ_FUA; if (!may_trim) bio_flags |= BLKIO_REQ_NO_UNMAP; /* XXX Could support forcing fast zeroes too. */ blkioq_write_zeroes (q, offset, count, NULL, bio_flags); r = blkioq_do_io (q, &completion, 1, 1, NULL); if (r != 1) { nbdkit_error ("blkioq_do_io: %s", blkio_get_error_msg ()); return -1; } if (completion.ret != 0) { nbdkit_error ("blkioq_do_io: " "unexpected write zeroes completion.ret %d != 0", completion.ret); return -1; } return 0; } /* Discard. */ static int bio_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { const bool fua = flags & NBDKIT_FLAG_FUA; struct handle *h = handle; int r; struct blkioq *q = blkio_get_queue (h->b, 0); struct blkio_completion completion; uint32_t bio_flags; bio_flags = 0; if (fua) bio_flags |= BLKIO_REQ_FUA; blkioq_discard (q, offset, count, NULL, bio_flags); r = blkioq_do_io (q, &completion, 1, 1, NULL); if (r != 1) { nbdkit_error ("blkioq_do_io: %s", blkio_get_error_msg ()); return -1; } if (completion.ret != 0) { nbdkit_error ("blkioq_do_io: unexpected discard completion.ret %d != 0", completion.ret); return -1; } return 0; } static struct nbdkit_plugin plugin = { .name = "blkio", .version = PACKAGE_VERSION, .unload = bio_unload, .config = bio_config, .config_complete = bio_config_complete, .config_help = bio_config_help, .magic_config_key = "driver", .open = bio_open, .close = bio_close, .get_size = bio_get_size, .block_size = bio_block_size, .can_write = bio_can_write, .can_flush = bio_can_write, .can_trim = bio_can_write, .can_zero = bio_can_write, .can_fua = bio_can_fua, .pread = bio_pread, .pwrite = bio_pwrite, .flush = bio_flush, .zero = bio_zero, .trim = bio_trim, .errno_is_preserved = 0, }; NBDKIT_REGISTER_PLUGIN (plugin) nbdkit-1.42.2/plugins/blkio/nbdkit-blkio-plugin.pod0000644000175000017500000000630214534316443015676 =head1 NAME nbdkit-blkio-plugin - libblkio plugin for NVMe, vhost-user, vDPA, VFIO =head1 SYNOPSIS nbdkit blkio [driver=]DRIVER [path=FILENAME] [num-queues=N] ... =head1 DESCRIPTION nbdkit-blkio-plugin is an L plugin for using L to access various disk sources used for high performance applications and virtualization. These include: NVMe, vhost-user, vDPA and VFIO. The first parameter after the plugin name should be the L. For example: nbdkit blkio virtio-blk-vhost-user path=vhost.sock │ │ │ plugin driver other parameters =head2 Driver: C nbdkit blkio nvme-io_uring path=/dev/ng0n1 Connect to an NVMe device, issuing commands through Linux io_uring (requires Linux E 5.19). =head2 Driver: C nbdkit blkio virtio-blk-vfio-pci path=/sys/bus/pci/devices/0000:00:01.0 Connect to a PCI device which implements virtio-blk using VFIO. The path is the path to the device's sysfs directory (see L). =head2 Driver: C nbdkit blkio virtio-blk-vhost-user path=vhost.sock Connect to a vhost-user block device, such as one exported by L. The path is the vhost-user Unix domain socket. For example: qemu-storage-daemon \ --blockdev driver=file,node-name=file,filename=disk.qcow2 \ --blockdev driver=qcow2,node-name=qcow2,file=file \ --export type=vhost-user-blk,id=export,addr.type=unix,addr.path=vhost.sock,node-name=qcow2,writable=on =head2 Driver: C nbdkit blkio virtio-blk-vhost-vdpa path=chardev Connect to a vDPA device which might be implemented in software (eg. VDUSE) or hardware. The path is the vhost-vdpa character device. =head2 Driver: C nbdkit blkio io_uring path=FILENAME You can use this driver to access local files and block devices through the libblkio C driver, but it is usually faster and easier to use L. =head1 PARAMETERS =over 4 =item [B]DRIVER The name of the libblkio driver to use. This parameter is required. C is a magic config key and may be omitted in most cases. See L. =item PROPERTYB<=>VALUE Properties such as C, C etc are translated to libblkio properties. Consult the L for a complete list. =item BPROPERTY Get (print) the value of a property after connecting. The property is fetched and printed in nbdkit debug output, so you will need to use the I<--verbose> flag. This is useful for debugging. =back =head1 FILES =over 4 =item F<$plugindir/nbdkit-blkio-plugin.so> The plugin. Use C to find the location of C<$plugindir>. =back =head1 VERSION C first appeared in nbdkit 1.34. =head1 SEE ALSO L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/plugins/cc/0000755000175000017500000000000014771247241010673 5nbdkit-1.42.2/plugins/cc/Makefile.am0000644000175000017500000000540714676465664012674 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = nbdkit-cc-plugin.pod # Disabled on Windows because we lack mkstemps, and possibly cannot # run shell commands. if !IS_WINDOWS plugin_LTLIBRARIES = nbdkit-cc-plugin.la nbdkit_cc_plugin_la_SOURCES = \ cc.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(NULL) nbdkit_cc_plugin_la_CPPFLAGS = \ -DCC="\"$(CC_PLUGIN_CC)\"" \ -DCFLAGS="\"$(CC_PLUGIN_CFLAGS)\"" \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ -I. \ $(NULL) nbdkit_cc_plugin_la_CFLAGS = $(WARNINGS_CFLAGS) nbdkit_cc_plugin_la_LDFLAGS = \ -module -avoid-version -shared $(NO_UNDEFINED_ON_WINDOWS) \ $(NULL) if USE_LINKER_SCRIPT nbdkit_cc_plugin_la_LDFLAGS += \ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms endif nbdkit_cc_plugin_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ $(IMPORT_LIBRARY_ON_WINDOWS) \ $(DL_LIBS) \ $(NULL) if HAVE_POD man_MANS = nbdkit-cc-plugin.3 CLEANFILES += $(man_MANS) nbdkit-cc-plugin.3: nbdkit-cc-plugin.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ --replace "__OCAML_STD_INCLUDES__:$(OCAML_STD_INCLUDES)" \ --replace "__OCAML_PLUGIN_LIBRARIES__:$(OCAML_PLUGIN_LIBRARIES)" \ $< endif HAVE_POD endif !IS_WINDOWS nbdkit-1.42.2/plugins/cc/Makefile.in0000644000175000017500000007771314771245447012705 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@am__append_1 = \ @IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@am__append_2 = $(man_MANS) subdir = plugins/cc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man3dir)" LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_DEPENDENCIES = \ @IS_WINDOWS_FALSE@ $(top_builddir)/common/utils/libutils.la \ @IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) am__nbdkit_cc_plugin_la_SOURCES_DIST = cc.c \ $(top_srcdir)/include/nbdkit-plugin.h am__objects_1 = @IS_WINDOWS_FALSE@am_nbdkit_cc_plugin_la_OBJECTS = \ @IS_WINDOWS_FALSE@ nbdkit_cc_plugin_la-cc.lo $(am__objects_1) nbdkit_cc_plugin_la_OBJECTS = $(am_nbdkit_cc_plugin_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_cc_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(nbdkit_cc_plugin_la_CFLAGS) $(CFLAGS) \ $(nbdkit_cc_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @IS_WINDOWS_FALSE@am_nbdkit_cc_plugin_la_rpath = -rpath $(plugindir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit_cc_plugin_la-cc.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nbdkit_cc_plugin_la_SOURCES) DIST_SOURCES = $(am__nbdkit_cc_plugin_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man3dir = $(mandir)/man3 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_2) EXTRA_DIST = nbdkit-cc-plugin.pod # Disabled on Windows because we lack mkstemps, and possibly cannot # run shell commands. @IS_WINDOWS_FALSE@plugin_LTLIBRARIES = nbdkit-cc-plugin.la @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_SOURCES = \ @IS_WINDOWS_FALSE@ cc.c \ @IS_WINDOWS_FALSE@ $(top_srcdir)/include/nbdkit-plugin.h \ @IS_WINDOWS_FALSE@ $(NULL) @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_CPPFLAGS = \ @IS_WINDOWS_FALSE@ -DCC="\"$(CC_PLUGIN_CC)\"" \ @IS_WINDOWS_FALSE@ -DCFLAGS="\"$(CC_PLUGIN_CFLAGS)\"" \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/include \ @IS_WINDOWS_FALSE@ -I$(top_builddir)/include \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/include \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/utils \ @IS_WINDOWS_FALSE@ -I. \ @IS_WINDOWS_FALSE@ $(NULL) @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_CFLAGS = $(WARNINGS_CFLAGS) @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_LDFLAGS = -module -avoid-version \ @IS_WINDOWS_FALSE@ -shared $(NO_UNDEFINED_ON_WINDOWS) $(NULL) \ @IS_WINDOWS_FALSE@ $(am__append_1) @IS_WINDOWS_FALSE@nbdkit_cc_plugin_la_LIBADD = \ @IS_WINDOWS_FALSE@ $(top_builddir)/common/utils/libutils.la \ @IS_WINDOWS_FALSE@ $(IMPORT_LIBRARY_ON_WINDOWS) \ @IS_WINDOWS_FALSE@ $(DL_LIBS) \ @IS_WINDOWS_FALSE@ $(NULL) @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@man_MANS = nbdkit-cc-plugin.3 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/cc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/cc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } nbdkit-cc-plugin.la: $(nbdkit_cc_plugin_la_OBJECTS) $(nbdkit_cc_plugin_la_DEPENDENCIES) $(EXTRA_nbdkit_cc_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(nbdkit_cc_plugin_la_LINK) $(am_nbdkit_cc_plugin_la_rpath) $(nbdkit_cc_plugin_la_OBJECTS) $(nbdkit_cc_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_cc_plugin_la-cc.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit_cc_plugin_la-cc.lo: cc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_cc_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_cc_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_cc_plugin_la-cc.lo -MD -MP -MF $(DEPDIR)/nbdkit_cc_plugin_la-cc.Tpo -c -o nbdkit_cc_plugin_la-cc.lo `test -f 'cc.c' || echo '$(srcdir)/'`cc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_cc_plugin_la-cc.Tpo $(DEPDIR)/nbdkit_cc_plugin_la-cc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cc.c' object='nbdkit_cc_plugin_la-cc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_cc_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_cc_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_cc_plugin_la-cc.lo `test -f 'cc.c' || echo '$(srcdir)/'`cc.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/nbdkit_cc_plugin_la-cc.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/nbdkit_cc_plugin_la-cc.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pluginLTLIBRARIES uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pluginLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man3 \ install-pdf install-pdf-am install-pluginLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-man \ uninstall-man3 uninstall-pluginLTLIBRARIES .PRECIOUS: Makefile @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@nbdkit-cc-plugin.3: nbdkit-cc-plugin.pod \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(PODWRAPPER) --section=3 --man $@ \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ --replace "__OCAML_STD_INCLUDES__:$(OCAML_STD_INCLUDES)" \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ --replace "__OCAML_PLUGIN_LIBRARIES__:$(OCAML_PLUGIN_LIBRARIES)" \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $< # 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: nbdkit-1.42.2/plugins/cc/cc.c0000644000175000017500000003634014534316443011350 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #define NBDKIT_API_VERSION 2 #include #include "cleanup.h" #include "utils.h" #include "vector.h" /* The script name. */ static char *script; static bool unlink_on_exit = false; /* C compiler and flags. */ static const char *cc = CC; static const char *cflags = CFLAGS " -fPIC -shared" #ifdef __APPLE__ " -Wl,-undefined,dynamic_lookup" #endif ; static const char *extra_cflags; /* List of parameters for the subplugin. */ struct key_value { const char *key, *value; }; DEFINE_VECTOR_TYPE (params_vector, struct key_value); static params_vector params = empty_vector; /* The subplugin. */ static void *dl; static struct nbdkit_plugin subplugin; static void cc_unload (void) { if (subplugin.unload) subplugin.unload (); if (unlink_on_exit) unlink (script); if (dl) dlclose (dl); free (params.ptr); free (script); } static void cc_dump_plugin (void) { printf ("CC=%s\n", CC); printf ("CFLAGS=%s\n", CFLAGS); } #define cc_config_help \ "[script=] (required) The shell script to run.\n" \ "CC= C compiler.\n" \ "CFLAGS= C compiler flags.\n" \ "EXTRA_CFLAGS= Extra C compiler flags.\n" \ "[other arguments may be used by the plugin that you load]" static char * inline_script (void) { CLEANUP_FREE char *cmd = NULL; int fd; if (!nbdkit_stdio_safe ()) { nbdkit_error ("inline script is incompatible with -s"); return NULL; } script = strdup ("/tmp/ccXXXXXX.c"); if (script == NULL) { nbdkit_error ("strdup: %m"); return NULL; } fd = mkstemps (script, 2); if (fd == -1) { nbdkit_error ("mkstemps: %m"); return NULL; } close (fd); unlink_on_exit = true; if (asprintf (&cmd, "cat > %s", script) == -1) { nbdkit_error ("asprintf: %m"); return NULL; } if (system (cmd) != 0) { nbdkit_error ("cc: failed to copy inline script to temporary file"); return NULL; } return script; } static int cc_config (const char *key, const char *value) { if (!script) { /* The first parameter must be "script". */ if (strcmp (key, "script") != 0) { nbdkit_error ("cc: the first parameter must be the C file or \"-\""); return -1; } if (strcmp (value, "-") != 0) script = nbdkit_realpath (value); else script = inline_script (); if (script == NULL) return -1; return 0; } else { /* Although not impossible, it's likely to be a bug if there is a * further parameter called "script" so disallow it. */ if (strcmp (key, "script") == 0) { nbdkit_error ("cc: script parameter must appear only once"); return -1; } /* Otherwise parse our parameters. */ else if (strcmp (key, "CC") == 0) cc = value; else if (strcmp (key, "CFLAGS") == 0) cflags = value; else if (strcmp (key, "EXTRA_CFLAGS") == 0) extra_cflags = value; else { /* Anything else is saved for the subplugin. */ struct key_value kv = { .key = key, .value = value }; if (params_vector_append (¶ms, kv) == -1) { nbdkit_error ("realloc: %m"); return -1; } } return 0; } } /* We must compile and load the subplugin here (not in get_ready) * because we must find the subplugin's thread model, and the core * server will query that straight after config_complete. */ static int cc_config_complete (void) { CLEANUP_FREE char *command = NULL; size_t len = 0, size, i; FILE *fp; int fd, r; char tmpfile[] = "/tmp/ccXXXXXX.so"; struct nbdkit_plugin *(*plugin_init) (void); char *error; const struct nbdkit_plugin *ptr; if (!script) { nbdkit_error ("cc: no C program name (or \"-\") given"); return -1; } /* Create a temporary file to store the compiled plugin. */ fd = mkstemps (tmpfile, 3); if (fd == -1) { nbdkit_error ("mkstemps: %m"); return -1; } close (fd); /* Compile the C program. */ fp = open_memstream (&command, &len); if (fp == NULL) { nbdkit_error ("open_memstream: %m"); return -1; } /* The C compiler and C flags don't need to be quoted. */ fprintf (fp, "%s %s ", cc, cflags); if (extra_cflags) fprintf (fp, "%s ", extra_cflags); shell_quote (script, fp); fprintf (fp, " -o "); shell_quote (tmpfile, fp); if (fclose (fp) == EOF) { nbdkit_error ("memstream failed: %m"); return -1; } nbdkit_debug ("cc: %s", command); r = system (command); if (exit_status_to_nbd_error (r, cc) == -1) { unlink (tmpfile); return -1; } /* Load the subplugin. */ dl = dlopen (tmpfile, RTLD_NOW); unlink (tmpfile); if (dl == NULL) { nbdkit_error ("cannot open the compiled plugin: %s", dlerror ()); return -1; } /* Now we basically behave like core nbdkit when it loads a plugin. */ dlerror (); *(void **) (&plugin_init) = dlsym (dl, "plugin_init"); if ((error = dlerror ()) != NULL) { nbdkit_error ("no plugin_init symbol found: %s", error); return -1; } if (!plugin_init) { nbdkit_error ("invalid plugin_init symbol"); return -1; } ptr = plugin_init (); if (!ptr) { nbdkit_error ("plugin registration failed"); return -1; } /* Are the APIs compatible? */ if (ptr->_api_version != NBDKIT_API_VERSION) { nbdkit_error ("plugin uses the wrong NBDKIT_API_VERSION, it must be %d", NBDKIT_API_VERSION); return -1; } /* Copy the subplugins struct into our plugin global, padding or * truncating as necessary. */ size = sizeof subplugin; /* Size of our struct. */ if (size > ptr->_struct_size) size = ptr->_struct_size; memcpy (&subplugin, ptr, size); /* Check that the plugin has .open, .get_size and .pread. */ if (subplugin.open == NULL) { nbdkit_error ("plugin must have a .open callback"); return -1; } if (subplugin.get_size == NULL) { nbdkit_error ("plugin must have a .get_size callback"); return -1; } if (subplugin.pread == NULL) { nbdkit_error ("plugin must have a .pread callback"); return -1; } /* Now we have to call the subplugin's load, config and * config_complete. Everything after that will be called via the * core server through our forwarding functions below. */ if (subplugin.load) subplugin.load (); if (subplugin.config) { for (i = 0; i < params.len; ++i) { if (subplugin.config (params.ptr[i].key, params.ptr[i].value) == -1) return -1; } } else if (params.len > 0) { /* Just print the first one in the error message. */ nbdkit_error ("unknown parameter: %s", params.ptr[0].key); return -1; } if (subplugin.config_complete) { if (subplugin.config_complete () == -1) return -1; } return 0; } /* This is adjusted when we load the subplugin. */ #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL /* Set the thread model from the subplugin. */ static int cc_thread_model (void) { if (subplugin.thread_model != NULL) return subplugin.thread_model (); else return subplugin._thread_model; } /* All other calls are forwarded to the subplugin. */ static int cc_get_ready (void) { if (subplugin.get_ready) return subplugin.get_ready (); return 0; } static int cc_after_fork (void) { if (subplugin.after_fork) return subplugin.after_fork (); return 0; } static int cc_preconnect (int readonly) { if (subplugin.preconnect) return subplugin.preconnect (readonly); return 0; } static int cc_list_exports (int readonly, int is_tls, struct nbdkit_exports *exports) { if (subplugin.list_exports) return subplugin.list_exports (readonly, is_tls, exports); return nbdkit_use_default_export (exports); } static const char * cc_default_export (int readonly, int is_tls) { if (subplugin.default_export) return subplugin.default_export (readonly, is_tls); return ""; } static void * cc_open (int readonly) { return subplugin.open (readonly); } static void cc_close (void *handle) { if (subplugin.close) subplugin.close (handle); } static const char * cc_export_description (void *handle) { if (subplugin.export_description) return subplugin.export_description (handle); return NULL; } static int64_t cc_get_size (void *handle) { return subplugin.get_size (handle); } static int cc_block_size (void *handle, uint32_t *minimum, uint32_t *preferred, uint32_t *maximum) { if (subplugin.block_size) return subplugin.block_size (handle, minimum, preferred, maximum); else { *minimum = *preferred = *maximum = 0; return 0; } } static int cc_can_write (void *handle) { if (subplugin.can_write) return subplugin.can_write (handle); else return !!subplugin.pwrite; } static int cc_can_flush (void *handle) { if (subplugin.can_flush) return subplugin.can_flush (handle); else return !!subplugin.flush; } static int cc_is_rotational (void *handle) { if (subplugin.is_rotational) return subplugin.is_rotational (handle); else return 0; } static int cc_can_trim (void *handle) { if (subplugin.can_trim) return subplugin.can_trim (handle); else return !!subplugin.trim; } static int cc_can_zero (void *handle) { if (subplugin.can_zero) return subplugin.can_zero (handle); else return !!subplugin.zero; } static int cc_can_fast_zero (void *handle) { if (subplugin.can_fast_zero) return subplugin.can_fast_zero (handle); else return 0; } static int cc_can_extents (void *handle) { if (subplugin.can_extents) return subplugin.can_extents (handle); else return !!subplugin.extents; } static int cc_can_fua (void *handle) { if (subplugin.can_fua) return subplugin.can_fua (handle); else if (cc_can_flush (handle)) return NBDKIT_FUA_EMULATE; else return NBDKIT_FUA_NONE; } static int cc_can_multi_conn (void *handle) { if (subplugin.can_multi_conn) return subplugin.can_multi_conn (handle); else return 0; } static int cc_can_cache (void *handle) { if (subplugin.can_cache) return subplugin.can_cache (handle); else if (subplugin.cache) return NBDKIT_CACHE_NATIVE; else return NBDKIT_CACHE_NONE; } static int cc_pread (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { return subplugin.pread (handle, buf, count, offset, flags); } static int cc_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags) { if (subplugin.pwrite) return subplugin.pwrite (handle, buf, count, offset, flags); else { nbdkit_error ("missing %s callback", "pwrite"); errno = EROFS; return -1; } } static int cc_flush (void *handle, uint32_t flags) { if (subplugin.flush) return subplugin.flush (handle, flags); else { nbdkit_error ("missing %s callback", "flush"); errno = EINVAL; return -1; } } static int cc_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { if (subplugin.trim) return subplugin.trim (handle, count, offset, flags); else { nbdkit_error ("missing %s callback", "trim"); errno = EINVAL; return -1; } } static int cc_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { if (subplugin.zero) return subplugin.zero (handle, count, offset, flags); else { /* Inform nbdkit to fall back to pwrite. */ nbdkit_error ("missing %s callback", "zero"); errno = EOPNOTSUPP; return -1; } } static int cc_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents) { if (subplugin.extents) return subplugin.extents (handle, count, offset, flags, extents); else { nbdkit_error ("missing %s callback", "extents"); errno = EINVAL; return -1; } } static int cc_cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { if (subplugin.cache) return subplugin.cache (handle, count, offset, flags); else /* A plugin may advertise caching but not provide .cache; in that * case, caching is explicitly a no-op. */ return 0; } static void cc_cleanup (void) { if (subplugin.cleanup) subplugin.cleanup (); } static struct nbdkit_plugin plugin = { .name = "cc", .longname = "nbdkit C compiler plugin", .version = PACKAGE_VERSION, /* These are the callbacks that this plugin overrides. */ .unload = cc_unload, .dump_plugin = cc_dump_plugin, .config = cc_config, .config_complete = cc_config_complete, .config_help = cc_config_help, .thread_model = cc_thread_model, /* And we must provide callbacks for everything else, which are * passed through to the subplugin. */ .get_ready = cc_get_ready, .after_fork = cc_after_fork, .cleanup = cc_cleanup, .preconnect = cc_preconnect, .list_exports = cc_list_exports, .default_export = cc_default_export, .open = cc_open, .close = cc_close, .export_description = cc_export_description, .get_size = cc_get_size, .block_size = cc_block_size, .can_write = cc_can_write, .can_flush = cc_can_flush, .is_rotational = cc_is_rotational, .can_trim = cc_can_trim, .can_zero = cc_can_zero, .can_fast_zero = cc_can_fast_zero, .can_extents = cc_can_extents, .can_fua = cc_can_fua, .can_multi_conn = cc_can_multi_conn, .can_cache = cc_can_cache, .pread = cc_pread, .pwrite = cc_pwrite, .flush = cc_flush, .trim = cc_trim, .zero = cc_zero, .extents = cc_extents, .cache = cc_cache, .errno_is_preserved = 1, }; NBDKIT_REGISTER_PLUGIN (plugin) nbdkit-1.42.2/plugins/cc/nbdkit-cc-plugin.pod0000644000175000017500000001216314676465664014473 =head1 NAME nbdkit-cc-plugin - write small nbdkit plugins in inline C (and other languages) =head1 SYNOPSIS nbdkit cc /path/to/plugin.c [CC=] [CFLAGS=] [EXTRA_CFLAGS=] =for paragraph nbdkit cc - <<'EOF' ... C code ... EOF =head1 DESCRIPTION This plugin allows you to write small L plugins in C (and some other languages). When you use this plugin it compiles your source code to a temporary plugin and then jumps into your compiled plugin. It is somewhat similar to L, except for C source code. This can also be used to write plugins which are "C scripts". B this is not the way you normally write nbdkit plugins in C. To understand how to write plugins in C normally, read L. =head2 Simple plugin example Simple plugins from the nbdkit source tree can be compiled and run directly using commands such as: $ nbdkit cc plugins/example1/example1.c EXTRA_CFLAGS="-I. -Iinclude" You can also read the source from stdin using C<->: $ nbdkit cc - EXTRA_CFLAGS="-I. -Iinclude" \ < plugins/example1/example1.c To replace the compiler flags: $ nbdkit cc plugins/example1/example1.c \ CFLAGS="-O3 -mavx2 -fPIC -shared" =head2 Compiler name and flags The plugin parameters C, C and C (written in uppercase) can be used to control which C compiler and C compiler flags are used. If not set, the default compiler and flags from when nbdkit was itself compiled from source are used. To see what those were you can do: $ nbdkit cc --dump-plugin ... CC=gcc CFLAGS=-g -O2 -fPIC -shared The C parameter overrides the built-in flags completely. The C parameter adds extra flags to the built-in flags. =head2 Plugin API version Plugins compiled this way must use the same API version as the cc plugin itself uses. Currently this is C. =head2 C plugin as a self-contained script You can create a C plugin which is a self-contained script by adding the following lines at the top and ensuring the C source is executable (S>): #if 0 exec nbdkit cc "$0" "$@" #endif The script can be run as a command with additional nbdkit flags and plugin parameters, eg: ./plugin.c -f -v ./plugin.c -p 10000 --filter=cow ./plugin.c param=1 =head2 Using this plugin with C++ nbdkit cc CC=g++ source.cpp C++ plugin scripts can be created similarly to C, but you must add C as a parameter to exec nbdkit. =head2 Using this plugin with OCaml nbdkit cc CC=ocamlopt \ CFLAGS="-output-obj -runtime-variant _pic __OCAML_STD_INCLUDES__ __OCAML_PLUGIN_LIBRARIES__ NBDKit.cmx -cclib -lnbdkitocaml" \ source.ml OCaml plugin scripts can be created using this trick: (*/.)>/dev/null 2>&1 exec nbdkit cc "$0" \ CC=ocamlopt \ CFLAGS="-output-obj -runtime-variant _pic __OCAML_STD_INCLUDES__ __OCAML_PLUGIN_LIBRARIES__ NBDKit.cmx -cclib -lnbdkitocaml" \ "$@" *) (* followed by OCaml code for the plugin here *) As with C plugin scripts, the file must be executable. See also L. =head2 Using this plugin with other programming languages This plugin can be used with most ahead-of-time compiled programming languages if they can create shared objects (F<.so> files). The only requirement is that the compiler (C) supports an I<-o> option to write a shared object. =head1 PARAMETERS The script name, or C<->, must appear as the first parameter. =over 4 =item BCC =item BCFLAGSB<"> =item BEXTRA_CFLAGSB<"> Override the compiler and flags. See L above. =back All other parameters on the command line are passed to the plugin. =head1 EXAMPLE $ nbdkit cc - <<'EOF' #include #include #define NBDKIT_API_VERSION 2 #include char data[10*1024*1024]; #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL static void * my_open (int readonly) { return NBDKIT_HANDLE_NOT_NEEDED; } static int64_t my_get_size (void *handle) { return (int64_t) sizeof (data); } static int my_pread (void *handle, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { memcpy (buf, data+offset, count); return 0; } static int my_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, uint32_t flags) { memcpy (data+offset, buf, count); return 0; } static struct nbdkit_plugin plugin = { .name = "myplugin", .open = my_open, .get_size = my_get_size, .pread = my_pread, .pwrite = my_pwrite, }; NBDKIT_REGISTER_PLUGIN(plugin) EOF =head1 FILES =over 4 =item F<$plugindir/nbdkit-cc-plugin.so> The plugin. Use C to find the location of C<$plugindir>. =back =head1 VERSION C first appeared in nbdkit 1.22. =head1 SEE ALSO L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/plugins/cdi/0000755000175000017500000000000014771247241011045 5nbdkit-1.42.2/plugins/cdi/Makefile.am0000644000175000017500000000512414534316443013021 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = nbdkit-cdi-plugin.pod # Disabled on Windows because this needs to run a bash script. if !IS_WINDOWS plugin_LTLIBRARIES = nbdkit-cdi-plugin.la nbdkit_cdi_plugin_la_SOURCES = \ cdi.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(NULL) nbdkit_cdi_plugin_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/utils \ -I. \ $(NULL) nbdkit_cdi_plugin_la_CFLAGS = \ $(WARNINGS_CFLAGS) \ $(JANSSON_CFLAGS) \ $(NULL) nbdkit_cdi_plugin_la_LDFLAGS = \ -module -avoid-version -shared $(NO_UNDEFINED_ON_WINDOWS) \ $(NULL) if USE_LINKER_SCRIPT nbdkit_cdi_plugin_la_LDFLAGS += \ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms endif nbdkit_cdi_plugin_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ $(IMPORT_LIBRARY_ON_WINDOWS) \ $(JANSSON_LIBS) \ $(NULL) if HAVE_POD man_MANS = nbdkit-cdi-plugin.1 CLEANFILES += $(man_MANS) nbdkit-cdi-plugin.1: nbdkit-cdi-plugin.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD endif !IS_WINDOWS nbdkit-1.42.2/plugins/cdi/Makefile.in0000644000175000017500000007741514771245447013056 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@am__append_1 = \ @IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@am__append_2 = $(man_MANS) subdir = plugins/cdi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)" LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_DEPENDENCIES = \ @IS_WINDOWS_FALSE@ $(top_builddir)/common/utils/libutils.la \ @IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__nbdkit_cdi_plugin_la_SOURCES_DIST = cdi.c \ $(top_srcdir)/include/nbdkit-plugin.h am__objects_1 = @IS_WINDOWS_FALSE@am_nbdkit_cdi_plugin_la_OBJECTS = \ @IS_WINDOWS_FALSE@ nbdkit_cdi_plugin_la-cdi.lo $(am__objects_1) nbdkit_cdi_plugin_la_OBJECTS = $(am_nbdkit_cdi_plugin_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_cdi_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(nbdkit_cdi_plugin_la_CFLAGS) $(CFLAGS) \ $(nbdkit_cdi_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @IS_WINDOWS_FALSE@am_nbdkit_cdi_plugin_la_rpath = -rpath $(plugindir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nbdkit_cdi_plugin_la_SOURCES) DIST_SOURCES = $(am__nbdkit_cdi_plugin_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_2) EXTRA_DIST = nbdkit-cdi-plugin.pod # Disabled on Windows because this needs to run a bash script. @IS_WINDOWS_FALSE@plugin_LTLIBRARIES = nbdkit-cdi-plugin.la @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_SOURCES = \ @IS_WINDOWS_FALSE@ cdi.c \ @IS_WINDOWS_FALSE@ $(top_srcdir)/include/nbdkit-plugin.h \ @IS_WINDOWS_FALSE@ $(NULL) @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_CPPFLAGS = \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/include \ @IS_WINDOWS_FALSE@ -I$(top_builddir)/include \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/include \ @IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/utils \ @IS_WINDOWS_FALSE@ -I. \ @IS_WINDOWS_FALSE@ $(NULL) @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_CFLAGS = \ @IS_WINDOWS_FALSE@ $(WARNINGS_CFLAGS) \ @IS_WINDOWS_FALSE@ $(JANSSON_CFLAGS) \ @IS_WINDOWS_FALSE@ $(NULL) @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_LDFLAGS = -module \ @IS_WINDOWS_FALSE@ -avoid-version -shared \ @IS_WINDOWS_FALSE@ $(NO_UNDEFINED_ON_WINDOWS) $(NULL) \ @IS_WINDOWS_FALSE@ $(am__append_1) @IS_WINDOWS_FALSE@nbdkit_cdi_plugin_la_LIBADD = \ @IS_WINDOWS_FALSE@ $(top_builddir)/common/utils/libutils.la \ @IS_WINDOWS_FALSE@ $(IMPORT_LIBRARY_ON_WINDOWS) \ @IS_WINDOWS_FALSE@ $(JANSSON_LIBS) \ @IS_WINDOWS_FALSE@ $(NULL) @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@man_MANS = nbdkit-cdi-plugin.1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/cdi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/cdi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } nbdkit-cdi-plugin.la: $(nbdkit_cdi_plugin_la_OBJECTS) $(nbdkit_cdi_plugin_la_DEPENDENCIES) $(EXTRA_nbdkit_cdi_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(nbdkit_cdi_plugin_la_LINK) $(am_nbdkit_cdi_plugin_la_rpath) $(nbdkit_cdi_plugin_la_OBJECTS) $(nbdkit_cdi_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit_cdi_plugin_la-cdi.lo: cdi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_cdi_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_cdi_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_cdi_plugin_la-cdi.lo -MD -MP -MF $(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Tpo -c -o nbdkit_cdi_plugin_la-cdi.lo `test -f 'cdi.c' || echo '$(srcdir)/'`cdi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Tpo $(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cdi.c' object='nbdkit_cdi_plugin_la-cdi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_cdi_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_cdi_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_cdi_plugin_la-cdi.lo `test -f 'cdi.c' || echo '$(srcdir)/'`cdi.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/nbdkit_cdi_plugin_la-cdi.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pluginLTLIBRARIES uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pluginLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-pluginLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 uninstall-pluginLTLIBRARIES .PRECIOUS: Makefile @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@nbdkit-cdi-plugin.1: nbdkit-cdi-plugin.pod \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/podwrapper.pl @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ --html $(top_builddir)/html/$@.html \ @HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $< # 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: nbdkit-1.42.2/plugins/cdi/cdi.c0000644000175000017500000001527414623341243011672 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include "cleanup.h" #include "utils.h" /* Parameters. */ static const char *name; /* Name or URI of container image. */ static int layer = 0; /* Layer (may be negative to count from end). */ /* The script that we run to pull and unpack the image. */ static const char script[] = /* Exit on errors. */ "set -e\n" /* Avoid stdin/stdout leaking (because of nbdkit -s). * XXX Capture errors to a temporary file. */ "exec /dev/null\n" /* Create a temporary directory to extract the image to. */ "d=\"$tmpfile.d\"\n" "podman pull \"$name\"\n" "podman save --format docker-dir -o \"$d\" \"$name\"\n" "f=\"$d/$( jq -r \".layers[$layer].digest\" < \"$d/manifest.json\" |\n" " cut -d: -f2 )\"\n" "if ! test -f \"$f\"; then\n" " echo \"cdi: could not extract layer\"\n" " rm -rf \"$d\"\n" " exit 1\n" "fi\n" "mv \"$f\" \"$tmpfile\"\n" "rm -rf \"$d\"\n"; /* The temporary file. */ static int fd = -1; /* Construct the temporary file. */ static int make_layer (void) { const char *tmpdir; CLEANUP_FREE char *template = NULL; CLEANUP_FREE char *command = NULL; size_t command_len = 0; FILE *fp; int r; /* Path for temporary file. */ tmpdir = getenv ("TMPDIR"); if (tmpdir == NULL) tmpdir = LARGE_TMPDIR; if (asprintf (&template, "%s/imageXXXXXX", tmpdir) == -1) { nbdkit_error ("asprintf: %m"); return -1; } fd = mkstemp (template); if (fd == -1) { nbdkit_error ("mkstemp: %s: %m", template); return -1; } /* Construct the podman script. */ fp = open_memstream (&command, &command_len); if (fp == NULL) { nbdkit_error ("open_memstream: %m"); return -1; } fprintf (fp, "name="); shell_quote (name, fp); putc ('\n', fp); fprintf (fp, "layer=%d\n", layer); fprintf (fp, "tmpfile="); shell_quote (template, fp); putc ('\n', fp); fprintf (fp, "\n"); fprintf (fp, "%s", script); if (fclose (fp) == EOF) { nbdkit_error ("memstream failed: %m"); return -1; } /* Run the command. */ nbdkit_debug ("%s", command); r = system (command); if (exit_status_to_nbd_error (r, "podman") == -1) return -1; /* Expect that the script creates 'template'. */ if (access (template, F_OK) != 0) { nbdkit_error ("internal error: expected %s to be created", template); return -1; } /* Since the script likely overwrites the file, we need to reopen it. */ close (fd); fd = open (template, O_RDONLY|O_CLOEXEC); if (fd == -1) { nbdkit_error ("open: %s: %m", template); unlink (template); return -1; } /* Since we've opened the file, we can unlink it. */ unlink (template); return 0; } static void cdi_unload (void) { if (fd >= 0) close (fd); } static int cdi_config (const char *key, const char *value) { if (strcmp (key, "name") == 0) name = value; else if (strcmp (key, "layer") == 0) { if (nbdkit_parse_int ("layer", value, &layer) == -1) return -1; } else { nbdkit_error ("unknown parameter '%s'", key); return -1; } return 0; } static int cdi_config_complete (void) { if (name == NULL) { nbdkit_error ("you must supply the 'name' parameter " "after the plugin name on the command line"); return -1; } return 0; } #define cdi_config_help \ "name=NAME[:TAG|@DIGEST] (required) Name or URI of container image.\n" \ "layer= Layer of image to export." static int cdi_get_ready (void) { return make_layer (); } static void * cdi_open (int readonly) { return NBDKIT_HANDLE_NOT_NEEDED; } #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL /* Get the file size. */ static int64_t cdi_get_size (void *handle) { int64_t r; r = device_size (fd, NULL); if (r == -1) { nbdkit_error ("device_size: %m"); return -1; } return r; } /* Serves the same data over multiple connections. */ static int cdi_can_multi_conn (void *handle) { return 1; } static int cdi_can_cache (void *handle) { /* Let nbdkit call pread to populate the file system cache. */ return NBDKIT_CACHE_EMULATE; } /* Read data from the file. */ static int cdi_pread (void *handle, void *buf, uint32_t count, uint64_t offset) { while (count > 0) { ssize_t r = pread (fd, buf, count, offset); if (r == -1) { nbdkit_error ("pread: %m"); return -1; } if (r == 0) { nbdkit_error ("pread: unexpected end of file"); return -1; } buf += r; count -= r; offset += r; } return 0; } static struct nbdkit_plugin plugin = { .name = "cdi", .longname = "nbdkit containerized data importer plugin", .version = PACKAGE_VERSION, .unload = cdi_unload, .config = cdi_config, .config_complete = cdi_config_complete, .config_help = cdi_config_help, .magic_config_key = "name", .get_ready = cdi_get_ready, .open = cdi_open, .get_size = cdi_get_size, .can_multi_conn = cdi_can_multi_conn, .can_cache = cdi_can_cache, .pread = cdi_pread, .errno_is_preserved = 1, }; NBDKIT_REGISTER_PLUGIN (plugin) nbdkit-1.42.2/plugins/cdi/nbdkit-cdi-plugin.pod0000644000175000017500000000606114534316443014776 =head1 NAME nbdkit-cdi-plugin - export a layer from a container image =head1 SYNOPSIS nbdkit cdi [name=]NAME[:TAG|@DIGEST] [layer=N] =head1 DESCRIPTION C (Containerized Data Importer plugin) is a plugin for L which downloads a container image using L and makes a single layer available over NBD. The plugin is essentially a convenient wrapper around L and L and requires both tools to be installed. =head1 EXAMPLES Given a Containerized Data Importer (CDI) registry image containing a VM disk, you can export the whole layer using: $ nbdkit cdi quay.io/kubevirt/fedora-cloud-container-disk-demo The layer exported over NBD is a tar file: $ nbdcopy nbd://localhost - | file - -: POSIX tar archive To export only the VM disk image in this layer, combine this plugin with L. In the example below the file exposed inside the tar archive is a qcow2 image so you can turn it into a raw NBD export of the virtual machine using L: ┌──────────────────────────────────────────┠│ fedora-cloud-container-disk-demo layer=0 │ │ (uncompressed tar file) │ │ ┌──────────────────────────────────────┠│ │ │ ./disk/downloaded │ │ │ │ (qcow2 image) │ │ │ └──────────────────────────────────────┘ │ └──────────────────────────────────────────┘ $ nbdkit cdi \ --filter=qcow2dec \ --filter=tar tar-entry=./disk/downloaded \ quay.io/kubevirt/fedora-cloud-container-disk-demo \ --run 'nbdinfo "$uri"' export="": export-size: 4294967296 (4G) content: DOS/MBR boot sector [...] =head1 PARAMETERS =over 4 =item [B]NAME[:TAG|@DIGEST] The name or URI of the container image. This is passed to L. C is a magic config key and may be omitted in most cases. See L. =item BN Export the N'th layer (instead of layer 0). =back =head1 ENVIRONMENT VARIABLES =over 4 =item C A temporary copy of the layer is created in C. If this environment variable is not set then F is used instead. =back =head1 FILES =over 4 =item F<$plugindir/nbdkit-cdi-plugin.so> The plugin. Use C to find the location of C<$plugindir>. =back =head1 VERSION C first appeared in nbdkit 1.22. =head1 SEE ALSO L, L, L, L, L, L, L, L. =head1 AUTHORS Richard W.M. Jones =head1 COPYRIGHT Copyright Red Hat nbdkit-1.42.2/plugins/curl/0000755000175000017500000000000014771247241011253 5nbdkit-1.42.2/plugins/curl/Makefile.am0000644000175000017500000000536714534316443013240 # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 $(top_srcdir)/common-rules.mk EXTRA_DIST = nbdkit-curl-plugin.pod if HAVE_CURL # Disabled on Windows because no self-pipe. if !IS_WINDOWS plugin_LTLIBRARIES = nbdkit-curl-plugin.la nbdkit_curl_plugin_la_SOURCES = \ config.c \ curldefs.h \ curl.c \ scripts.c \ times.c \ worker.c \ $(top_srcdir)/include/nbdkit-plugin.h \ $(NULL) nbdkit_curl_plugin_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/common/include \ -I$(top_srcdir)/common/replacements \ -I$(top_srcdir)/common/utils \ $(NULL) nbdkit_curl_plugin_la_CFLAGS = \ $(WARNINGS_CFLAGS) \ $(CURL_CFLAGS) \ $(NULL) nbdkit_curl_plugin_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ $(top_builddir)/common/replacements/libcompat.la \ $(IMPORT_LIBRARY_ON_WINDOWS) \ $(CURL_LIBS) \ $(NULL) nbdkit_curl_plugin_la_LDFLAGS = \ -module -avoid-version -shared $(NO_UNDEFINED_ON_WINDOWS) \ $(NULL) if USE_LINKER_SCRIPT nbdkit_curl_plugin_la_LDFLAGS += \ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms endif if HAVE_POD man_MANS = nbdkit-curl-plugin.1 CLEANFILES += $(man_MANS) nbdkit-curl-plugin.1: nbdkit-curl-plugin.pod \ $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=1 --man $@ \ --html $(top_builddir)/html/$@.html \ $< endif HAVE_POD endif !IS_WINDOWS endif HAVE_CURL nbdkit-1.42.2/plugins/curl/Makefile.in0000644000175000017500000011563514771245447013261 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 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@ # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. # nbdkit # Copyright Red Hat # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@am__append_1 = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@@USE_LINKER_SCRIPT_TRUE@ -Wl,--version-script=$(top_srcdir)/plugins/plugins.syms @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@am__append_2 = $(man_MANS) subdir = plugins/curl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ocaml.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)" LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_DEPENDENCIES = $(top_builddir)/common/utils/libutils.la \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/common/replacements/libcompat.la \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(am__DEPENDENCIES_1) am__nbdkit_curl_plugin_la_SOURCES_DIST = config.c curldefs.h curl.c \ scripts.c times.c worker.c \ $(top_srcdir)/include/nbdkit-plugin.h am__objects_1 = @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@am_nbdkit_curl_plugin_la_OBJECTS = nbdkit_curl_plugin_la-config.lo \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ nbdkit_curl_plugin_la-curl.lo \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ nbdkit_curl_plugin_la-scripts.lo \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ nbdkit_curl_plugin_la-times.lo \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ nbdkit_curl_plugin_la-worker.lo \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(am__objects_1) nbdkit_curl_plugin_la_OBJECTS = $(am_nbdkit_curl_plugin_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = nbdkit_curl_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) \ $(nbdkit_curl_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@am_nbdkit_curl_plugin_la_rpath = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -rpath $(plugindir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/nbdkit_curl_plugin_la-config.Plo \ ./$(DEPDIR)/nbdkit_curl_plugin_la-curl.Plo \ ./$(DEPDIR)/nbdkit_curl_plugin_la-scripts.Plo \ ./$(DEPDIR)/nbdkit_curl_plugin_la-times.Plo \ ./$(DEPDIR)/nbdkit_curl_plugin_la-worker.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nbdkit_curl_plugin_la_SOURCES) DIST_SOURCES = $(am__nbdkit_curl_plugin_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/common-rules.mk \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@ BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@ BZIP2 = @BZIP2@ BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ CARGO = @CARGO@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_PLUGIN_CC = @CC_PLUGIN_CC@ CC_PLUGIN_CFLAGS = @CC_PLUGIN_CFLAGS@ CERTTOOL = @CERTTOOL@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CUT = @CUT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LDFLAGS = @DL_LDFLAGS@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GENISOIMAGE = @GENISOIMAGE@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GOARCH = @GOARCH@ GOLANG = @GOLANG@ GOOS = @GOOS@ GOROOT = @GOROOT@ GREP = @GREP@ IMPORT_LIBRARY_ON_WINDOWS = @IMPORT_LIBRARY_ON_WINDOWS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOPROG = @ISOPROG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBLKIO_CFLAGS = @LIBBLKIO_CFLAGS@ LIBBLKIO_LIBS = @LIBBLKIO_LIBS@ LIBGUESTFS_CFLAGS = @LIBGUESTFS_CFLAGS@ LIBGUESTFS_LIBS = @LIBGUESTFS_LIBS@ LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@ LIBLZMA_LIBS = @LIBLZMA_LIBS@ LIBNBD_CFLAGS = @LIBNBD_CFLAGS@ LIBNBD_LIBS = @LIBNBD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSELINUX_CFLAGS = @LIBSELINUX_CFLAGS@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ LIBTOOL = @LIBTOOL@ LIBTORRENT_CFLAGS = @LIBTORRENT_CFLAGS@ LIBTORRENT_LIBS = @LIBTORRENT_LIBS@ LIBVIRT_CFLAGS = @LIBVIRT_CFLAGS@ LIBVIRT_LIBS = @LIBVIRT_LIBS@ LIBZSTD_CFLAGS = @LIBZSTD_CFLAGS@ LIBZSTD_LIBS = @LIBZSTD_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ LZIP = @LZIP@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MC = @MC@ MKDIR_P = @MKDIR_P@ MKISOFS = @MKISOFS@ NBDKIT_VERSION_MAJOR = @NBDKIT_VERSION_MAJOR@ NBDKIT_VERSION_MICRO = @NBDKIT_VERSION_MICRO@ NBDKIT_VERSION_MINOR = @NBDKIT_VERSION_MINOR@ NM = @NM@ NMEDIT = @NMEDIT@ NO_UNDEFINED_ON_WINDOWS = @NO_UNDEFINED_ON_WINDOWS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OCAML = @OCAML@ OCAMLBEST = @OCAMLBEST@ OCAMLBUILD = @OCAMLBUILD@ OCAMLC = @OCAMLC@ OCAMLCDOTOPT = @OCAMLCDOTOPT@ OCAMLDEP = @OCAMLDEP@ OCAMLDOC = @OCAMLDOC@ OCAMLLIB = @OCAMLLIB@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLMKTOP = @OCAMLMKTOP@ OCAMLOPT = @OCAMLOPT@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@ OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ OCAMLVERSION = @OCAMLVERSION@ OCAML_MAJOR = @OCAML_MAJOR@ OCAML_PLUGIN_LIBRARIES = @OCAML_PLUGIN_LIBRARIES@ OCAML_STD_INCLUDES = @OCAML_STD_INCLUDES@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL_ARCHLIB = @PERL_ARCHLIB@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_LDOPTS = @PERL_LDOPTS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PODWRAPPER = @PODWRAPPER@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ RUSTC = @RUSTC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOEXT = @SOEXT@ SSH_CFLAGS = @SSH_CFLAGS@ SSH_LIBS = @SSH_LIBS@ STAT = @STAT@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TRUNCATE = @TRUNCATE@ VALGRIND = @VALGRIND@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ WARNINGS_CFLAGS = @WARNINGS_CFLAGS@ WARNINGS_MODULE_CXXFLAGS = @WARNINGS_MODULE_CXXFLAGS@ XORRISO = @XORRISO@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_NG_CFLAGS = @ZLIB_NG_CFLAGS@ ZLIB_NG_LIBS = @ZLIB_NG_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_MC = @ac_ct_MC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ filters = @filters@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ lang_plugins = @lang_plugins@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ non_lang_plugins = @non_lang_plugins@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ plugins = @plugins@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Convenient list terminator NULL = plugindir = $(libdir)/nbdkit/plugins filterdir = $(libdir)/nbdkit/filters CLEANFILES = *~ *.cmi *.cmx *.cmxa *.so *.dll $(am__append_2) EXTRA_DIST = nbdkit-curl-plugin.pod # Disabled on Windows because no self-pipe. @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@plugin_LTLIBRARIES = nbdkit-curl-plugin.la @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_SOURCES = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ config.c \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ curldefs.h \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ curl.c \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ scripts.c \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ times.c \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ worker.c \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(top_srcdir)/include/nbdkit-plugin.h \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NULL) @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_CPPFLAGS = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -I$(top_srcdir)/include \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -I$(top_builddir)/include \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/include \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/replacements \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -I$(top_srcdir)/common/utils \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NULL) @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_CFLAGS = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(WARNINGS_CFLAGS) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(CURL_CFLAGS) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NULL) @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_LIBADD = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/common/utils/libutils.la \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/common/replacements/libcompat.la \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(IMPORT_LIBRARY_ON_WINDOWS) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(CURL_LIBS) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NULL) @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@nbdkit_curl_plugin_la_LDFLAGS = \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -module -avoid-version \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ -shared \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NO_UNDEFINED_ON_WINDOWS) \ @HAVE_CURL_TRUE@@IS_WINDOWS_FALSE@ $(NULL) $(am__append_1) @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@man_MANS = nbdkit-curl-plugin.1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-rules.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/curl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign plugins/curl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/common-rules.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } nbdkit-curl-plugin.la: $(nbdkit_curl_plugin_la_OBJECTS) $(nbdkit_curl_plugin_la_DEPENDENCIES) $(EXTRA_nbdkit_curl_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(nbdkit_curl_plugin_la_LINK) $(am_nbdkit_curl_plugin_la_rpath) $(nbdkit_curl_plugin_la_OBJECTS) $(nbdkit_curl_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_curl_plugin_la-config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_curl_plugin_la-curl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_curl_plugin_la-scripts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_curl_plugin_la-times.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nbdkit_curl_plugin_la-worker.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< nbdkit_curl_plugin_la-config.lo: config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_curl_plugin_la-config.lo -MD -MP -MF $(DEPDIR)/nbdkit_curl_plugin_la-config.Tpo -c -o nbdkit_curl_plugin_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_curl_plugin_la-config.Tpo $(DEPDIR)/nbdkit_curl_plugin_la-config.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config.c' object='nbdkit_curl_plugin_la-config.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_curl_plugin_la-config.lo `test -f 'config.c' || echo '$(srcdir)/'`config.c nbdkit_curl_plugin_la-curl.lo: curl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_curl_plugin_la-curl.lo -MD -MP -MF $(DEPDIR)/nbdkit_curl_plugin_la-curl.Tpo -c -o nbdkit_curl_plugin_la-curl.lo `test -f 'curl.c' || echo '$(srcdir)/'`curl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_curl_plugin_la-curl.Tpo $(DEPDIR)/nbdkit_curl_plugin_la-curl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl.c' object='nbdkit_curl_plugin_la-curl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_curl_plugin_la-curl.lo `test -f 'curl.c' || echo '$(srcdir)/'`curl.c nbdkit_curl_plugin_la-scripts.lo: scripts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_curl_plugin_la-scripts.lo -MD -MP -MF $(DEPDIR)/nbdkit_curl_plugin_la-scripts.Tpo -c -o nbdkit_curl_plugin_la-scripts.lo `test -f 'scripts.c' || echo '$(srcdir)/'`scripts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_curl_plugin_la-scripts.Tpo $(DEPDIR)/nbdkit_curl_plugin_la-scripts.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scripts.c' object='nbdkit_curl_plugin_la-scripts.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_curl_plugin_la-scripts.lo `test -f 'scripts.c' || echo '$(srcdir)/'`scripts.c nbdkit_curl_plugin_la-times.lo: times.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_curl_plugin_la-times.lo -MD -MP -MF $(DEPDIR)/nbdkit_curl_plugin_la-times.Tpo -c -o nbdkit_curl_plugin_la-times.lo `test -f 'times.c' || echo '$(srcdir)/'`times.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_curl_plugin_la-times.Tpo $(DEPDIR)/nbdkit_curl_plugin_la-times.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='times.c' object='nbdkit_curl_plugin_la-times.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_curl_plugin_la-times.lo `test -f 'times.c' || echo '$(srcdir)/'`times.c nbdkit_curl_plugin_la-worker.lo: worker.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -MT nbdkit_curl_plugin_la-worker.lo -MD -MP -MF $(DEPDIR)/nbdkit_curl_plugin_la-worker.Tpo -c -o nbdkit_curl_plugin_la-worker.lo `test -f 'worker.c' || echo '$(srcdir)/'`worker.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nbdkit_curl_plugin_la-worker.Tpo $(DEPDIR)/nbdkit_curl_plugin_la-worker.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='worker.c' object='nbdkit_curl_plugin_la-worker.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nbdkit_curl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(nbdkit_curl_plugin_la_CFLAGS) $(CFLAGS) -c -o nbdkit_curl_plugin_la-worker.lo `test -f 'worker.c' || echo '$(srcdir)/'`worker.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-config.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-curl.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-scripts.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-times.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-worker.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-config.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-curl.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-scripts.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-times.Plo -rm -f ./$(DEPDIR)/nbdkit_curl_plugin_la-worker.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pluginLTLIBRARIES uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pluginLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-pluginLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 uninstall-pluginLTLIBRARIES .PRECIOUS: Makefile @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@nbdkit-curl-plugin.1: nbdkit-curl-plugin.pod \ @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(top_builddir)/podwrapper.pl @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $(PODWRAPPER) --section=1 --man $@ \ @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ --html $(top_builddir)/html/$@.html \ @HAVE_CURL_TRUE@@HAVE_POD_TRUE@@IS_WINDOWS_FALSE@ $< # 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: nbdkit-1.42.2/plugins/curl/config.c0000644000175000017500000005614214730027756012616 /* nbdkit * Copyright Red Hat * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Red Hat 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 RED HAT 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 RED HAT 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 #include #include #include #include #include #include #include #include #include #include #include #include #include "cleanup.h" #include "curldefs.h" /* Plugin configuration. */ const char *url = NULL; /* required */ static const char *cainfo = NULL; static const char *capath = NULL; static char *cookie = NULL; static const char *cookiefile = NULL; static const char *cookiejar = NULL; static bool followlocation = true; static struct curl_slist *headers = NULL; static long http_version = CURL_HTTP_VERSION_NONE; static long ipresolve = CURL_IPRESOLVE_WHATEVER; static char *password = NULL; #ifndef HAVE_CURLOPT_PROTOCOLS_STR static long protocols = CURLPROTO_ALL; #else static const char *protocols = NULL; #endif static const char *proxy = NULL; static char *proxy_password = NULL; static const char *proxy_user = NULL; static struct curl_slist *resolves = NULL; static bool sslverify = true; static const char *ssl_cipher_list = NULL; static long ssl_version = CURL_SSLVERSION_DEFAULT; static const char *tls13_ciphers = NULL; static bool tcp_keepalive = false; static bool tcp_nodelay = true; static uint32_t timeout = 0; static const char *unix_socket_path = NULL; static const char *user = NULL; static const char *user_agent = NULL; static int debug_cb (CURL *handle, curl_infotype type, const char *data, size_t size, void *); /* Use '-D curl.verbose=1' to set. */ NBDKIT_DLL_PUBLIC int curl_debug_verbose = 0; /* Use '-D curl.verbose.ids=1' to set. */ NBDKIT_DLL_PUBLIC int curl_debug_verbose_ids = 0; void config_unload (void) { free (cookie); if (headers) curl_slist_free_all (headers); free (password); free (proxy_password); if (resolves) curl_slist_free_all (resolves); } /* Add extra information to 'nbdkit curl --dump-plugin' output. */ void curl_dump_plugin (void) { #ifdef LIBCURL_VERSION /* The static version we were compiled against. */ printf ("curl_version=%s\n", LIBCURL_VERSION); #endif #ifdef HAVE_CURL_VERSION_INFO const curl_version_info_data *ver = curl_version_info (CURLVERSION_NOW); const char *const *p; /* The dynamic version we are linked against. */ printf ("curl_dynamic_version=%s\n", ver->version); if (ver->ssl_version) printf ("curl_ssl_version=%s\n", ver->ssl_version); /* List of protocols supported. */ for (p = ver->protocols; *p != NULL; p++) printf ("curl_protocol_%s=yes\n", *p); #endif } #ifndef HAVE_CURLOPT_PROTOCOLS_STR /* See */ static struct { const char *name; long bitmask; } curl_protocols[] = { { "http", CURLPROTO_HTTP }, { "https", CURLPROTO_HTTPS }, { "ftp", CURLPROTO_FTP }, { "ftps", CURLPROTO_FTPS }, { "scp", CURLPROTO_SCP }, { "sftp", CURLPROTO_SFTP }, { "telnet", CURLPROTO_TELNET }, { "ldap", CURLPROTO_LDAP }, { "ldaps", CURLPROTO_LDAPS }, { "dict", CURLPROTO_DICT }, { "file", CURLPROTO_FILE }, { "tftp", CURLPROTO_TFTP }, { "imap", CURLPROTO_IMAP }, { "imaps", CURLPROTO_IMAPS }, { "pop3", CURLPROTO_POP3 }, { "pop3s", CURLPROTO_POP3S }, { "smtp", CURLPROTO_SMTP }, { "smtps", CURLPROTO_SMTPS }, { "rtsp", CURLPROTO_RTSP }, { "rtmp", CURLPROTO_RTMP }, { "rtmpt", CURLPROTO_RTMPT }, { "rtmpe", CURLPROTO_RTMPE }, { "rtmpte", CURLPROTO_RTMPTE }, { "rtmps", CURLPROTO_RTMPS }, { "rtmpts", CURLPROTO_RTMPTS }, { "gopher", CURLPROTO_GOPHER }, #ifdef CURLPROTO_SMB { "smb", CURLPROTO_SMB }, #endif #ifdef CURLPROTO_SMBS { "smbs", CURLPROTO_SMBS }, #endif #ifdef CURLPROTO_MQTT { "mqtt", CURLPROTO_MQTT }, #endif #ifdef CURLPROTO_GOPHERS { "gophers", CURLPROTO_GOPHERS }, #endif { NULL } }; /* Parse the protocols parameter. */ static int parse_protocols (const char *value) { size_t n, i; protocols = 0; while (*value) { n = strcspn (value, ","); for (i = 0; curl_protocols[i].name != NULL; ++i) { if (strlen (curl_protocols[i].name) == n && strncmp (value, curl_protocols[i].name, n) == 0) { protocols |= curl_protocols[i].bitmask; goto found; } } nbdkit_error ("protocols: protocol name not found: %.*s", (int) n, value); return -1; found: value += n; if (*value == ',') value++; } if (protocols == 0) { nbdkit_error ("protocols: empty list of protocols is not allowed"); return -1; } nbdkit_debug ("curl: protocols: %ld", protocols); return 0; } #endif /* !HAVE_CURLOPT_PROTOCOLS_STR */ /* Called for each key=value passed on the command line. */ int curl_config (const char *key, const char *value) { int r; if (strcmp (key, "cainfo") == 0) { cainfo = value; } else if (strcmp (key, "capath") == 0) { capath = value; } else if (strcmp (key, "connections") == 0) { if (nbdkit_parse_unsigned ("connections", value, &connections) == -1) return -1; if (connections == 0) { nbdkit_error ("connections parameter must not be 0"); return -1; } } else if (strcmp (key, "cookie") == 0) { free (cookie); if (nbdkit_read_password (value, &cookie) == -1) return -1; } else if (strcmp (key, "cookiefile") == 0) { /* Reject cookiefile=- because it will cause libcurl to try to * read from stdin when we connect. */ if (strcmp (value, "-") == 0) { nbdkit_error ("cookiefile parameter cannot be \"-\""); return -1; } cookiefile = value; } else if (strcmp (key, "cookiejar") == 0) { /* Reject cookiejar=- because it will cause libcurl to try to * write to stdout. */ if (strcmp (value, "-") == 0) { nbdkit_error ("cookiejar parameter cannot be \"-\""); return -1; } cookiejar = value; } else if (strcmp (key, "cookie-script") == 0) { cookie_script = value; } else if (strcmp (key, "cookie-script-renew") == 0) { if (nbdkit_parse_unsigned ("cookie-script-renew", value, &cookie_script_renew) == -1) return -1; } else if (strcmp (key, "followlocation") == 0) { r = nbdkit_parse_bool (value); if (r == -1) return -1; followlocation = r; } else if (strcmp (key, "header") == 0) { headers = curl_slist_append (headers, value); if (headers == NULL) { nbdkit_error ("curl_slist_append: %m"); return -1; } } else if (strcmp (key, "header-script") == 0) { header_script = value; } else if (strcmp (key, "header-script-renew") == 0) { if (nbdkit_parse_unsigned ("header-script-renew", value, &header_script_renew) == -1) return -1; } else if (strcmp (key, "http-version") == 0) { if (strcmp (value, "none") == 0) http_version = CURL_HTTP_VERSION_NONE; else if (strcmp (value, "1.0") == 0) http_version = CURL_HTTP_VERSION_1_0; else if (strcmp (value, "1.1") == 0) http_version = CURL_HTTP_VERSION_1_1; #ifdef HAVE_CURL_HTTP_VERSION_2_0 else if (strcmp (value, "2.0") == 0) http_version = CURL_HTTP_VERSION_2_0; #endif #ifdef HAVE_CURL_HTTP_VERSION_2TLS else if (strcmp (value, "2TLS") == 0) http_version = CURL_HTTP_VERSION_2TLS; #endif #ifdef HAVE_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE else if (strcmp (value, "2-prior-knowledge") == 0) http_version = CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE; #endif #ifdef HAVE_CURL_HTTP_VERSION_3 else if (strcmp (value, "3") == 0) http_version = CURL_HTTP_VERSION_3; #endif #ifdef HAVE_CURL_HTTP_VERSION_3ONLY else if (strcmp (value, "3only") == 0) http_version = CURL_HTTP_VERSION_3ONLY; #endif else { nbdkit_error ("unknown http-version: %s", value); return -1; } } else if (strcmp (key, "ipresolve") == 0) { if (strcmp (value, "any") == 0 || strcmp (value, "whatever") == 0) ipresolve = CURL_IPRESOLVE_WHATEVER; else if (strcmp (value, "v4") == 0 || strcmp (value, "4") == 0) ipresolve = CURL_IPRESOLVE_V4; else if (strcmp (value, "v6") == 0 || strcmp (value, "6") == 0) ipresolve = CURL_IPRESOLVE_V6; else { nbdkit_error ("unknown ipresolve: %s", value); return -1; } } else if (strcmp (key, "password") == 0) { free (password); if (nbdkit_read_password (value, &password) == -1) return -1; } else if (strcmp (key, "protocols") == 0) { #ifndef HAVE_CURLOPT_PROTOCOLS_STR if (parse_protocols (value) == -1) return -1; #else protocols = value; #endif } else if (strcmp (key, "proxy") == 0) { proxy = value; } else if (strcmp (key, "proxy-password") == 0) { free (proxy_password); if (nbdkit_read_password (value, &proxy_password) == -1) return -1; } else if (strcmp (key, "proxy-user") == 0) proxy_user = value; else if (strcmp (key, "resolve") == 0) { resolves = curl_slist_append (headers, value); if (resolves == NULL) { nbdkit_error ("curl_slist_append: %m"); return -1; } } else if (strcmp (key, "sslverify") == 0) { r = nbdkit_parse_bool (value); if (r == -1) return -1; sslverify = r; } else if (strcmp (key, "ssl-version") == 0) { if (strcmp (value, "default") == 0) ssl_version = CURL_SSLVERSION_DEFAULT; else if (strcmp (value, "tlsv1") == 0) ssl_version = CURL_SSLVERSION_TLSv1; else if (strcmp (value, "sslv2") == 0) ssl_version = CURL_SSLVERSION_SSLv2; else if (strcmp (value, "sslv3") == 0) ssl_version = CURL_SSLVERSION_SSLv3; else if (strcmp (value, "tlsv1.0") == 0) ssl_version = CURL_SSLVERSION_TLSv1_0; else if (strcmp (value, "tlsv1.1") == 0) ssl_version = CURL_SSLVERSION_TLSv1_1; else if (strcmp (value, "tlsv1.2") == 0) ssl_version = CURL_SSLVERSION_TLSv1_2; else if (strcmp (value, "tlsv1.3") == 0) ssl_version = CURL_SSLVERSION_TLSv1_3; #ifdef CURL_SSLVERSION_MAX_DEFAULT else if (strcmp (value, "max-default") == 0) ssl_version = CURL_SSLVERSION_MAX_DEFAULT; #endif #ifdef CURL_SSLVERSION_MAX_TLSv1_0 else if (strcmp (value, "max-tlsv1.0") == 0) ssl_version = CURL_SSLVERSION_MAX_TLSv1_0; #endif #ifdef CURL_SSLVERSION_MAX_TLSv1_1 else if (strcmp (value, "max-tlsv1.1") == 0) ssl_version = CURL_SSLVERSION_MAX_TLSv1_1; #endif #ifdef CURL_SSLVERSION_MAX_TLSv1_2 else if (strcmp (value, "max-tlsv1.2") == 0) ssl_version = CURL_SSLVERSION_MAX_TLSv1_2; #endif #ifdef CURL_SSLVERSION_MAX_TLSv1_3 else if (strcmp (value, "max-tlsv1.3") == 0) ssl_version = CURL_SSLVERSION_MAX_TLSv1_3; #endif else { nbdkit_error ("unknown ssl-version: %s", value); return -1; } } else if (strcmp (key, "ssl-cipher-list") == 0) ssl_cipher_list = value; else if (strcmp (key, "tls13-ciphers") == 0) tls13_ciphers = value; else if (strcmp (key, "tcp-keepalive") == 0) { r = nbdkit_parse_bool (value); if (r == -1) return -1; tcp_keepalive = r; } else if (strcmp (key, "tcp-nodelay") == 0) { r = nbdkit_parse_bool (value); if (r == -1) return -1; tcp_nodelay = r; } else if (strcmp (key, "timeout") == 0) { if (nbdkit_parse_uint32_t ("timeout", value, &timeout) == -1) return -1; #if LONG_MAX < UINT32_MAX /* C17 5.2.4.2.1 requires that LONG_MAX is at least 2^31 - 1. * However a large positive number might still exceed the limit. */ if (timeout > LONG_MAX) { nbdkit_error ("timeout is too large"); return -1; } #endif } else if (strcmp (key, "unix-socket-path") == 0 || strcmp (key, "unix_socket_path") == 0) unix_socket_path = value; else if (strcmp (key, "url") == 0) url = value; else if (strcmp (key, "user") == 0) user = value; else if (strcmp (key, "user-agent") == 0) user_agent = value; else { nbdkit_error ("unknown parameter '%s'", key); return -1; } return 0; } /* Check the user did pass a url parameter. */ int curl_config_complete (void) { if (url == NULL) { nbdkit_error ("you must supply the url= parameter " "after the plugin name on the command line"); return -1; } if (headers && header_script) { nbdkit_error ("header and header-script cannot be used at the same time"); return -1; } if (!header_script && header_script_renew) { nbdkit_error ("header-script-renew cannot be used without header-script"); return -1; } if (cookie && cookie_script) { nbdkit_error ("cookie and cookie-script cannot be used at the same time"); return -1; } if (!cookie_script && cookie_script_renew) { nbdkit_error ("cookie-script-renew cannot be used without cookie-script"); return -1; } return 0; } const char *curl_config_help = "cainfo= Path to Certificate Authority file.\n" "capath= Path to directory with CA certificates.\n" "connections= Number of HTTP connections to use.\n" "cookie= Set HTTP/HTTPS cookies.\n" "cookiefile= Enable cookie processing.\n" "cookiefile= Read cookies from file.\n" "cookiejar= Read and write cookies to jar.\n" "cookie-script=