amanda-3.3.6/0000775000076400007640000000000012357750430014446 5ustar00martineamartinea00000000000000amanda-3.3.6/changer-src/0000775000076400007640000000000012357750427016650 5ustar00martineamartinea00000000000000amanda-3.3.6/changer-src/Makefile.in0000664000076400007640000020303312357750240020707 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda tape changer programs. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = changer-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibexecdir)" \ "$(DESTDIR)$(amlibexecdir)" SCRIPTS = $(amlibexec_SCRIPTS) 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 = $(amlibexec_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = chg-lib.sh.in BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ $(SCRIPTS_INCLUDE) $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done SCRIPTS_SHELL = \ chg-manual \ chg-multi \ chg-zd-mtx \ chg-disk SCRIPTS_INCLUDE = \ chg-lib.sh amlibexec_SCRIPTS = $(SCRIPTS_SHELL) amlibexec_DATA = $(SCRIPTS_INCLUDE) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu changer-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu changer-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am: $(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-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(amlibexecdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-amlibexecDATA: $(amlibexec_DATA) @$(NORMAL_INSTALL) @list='$(amlibexec_DATA)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(amlibexecdir)" || exit $$?; \ done uninstall-amlibexecDATA: @$(NORMAL_UNINSTALL) @list='$(amlibexec_DATA)'; test -n "$(amlibexecdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(amlibexecdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @SYNTAX_CHECKS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-amlibexecDATA install-amlibexecSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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-amlibexecDATA uninstall-amlibexecSCRIPTS .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip .PHONY: all all-am check check-am check-local clean clean-generic \ clean-libtool dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-amlibexecDATA \ install-amlibexecSCRIPTS install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook 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 uninstall uninstall-am \ uninstall-amlibexecDATA uninstall-amlibexecSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ @SYNTAX_CHECKS_TRUE@ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ @SYNTAX_CHECKS_TRUE@ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ @SYNTAX_CHECKS_TRUE@ rm $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ else \ @SYNTAX_CHECKS_TRUE@ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ @SYNTAX_CHECKS_TRUE@ fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-perl # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-shell # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # 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: amanda-3.3.6/changer-src/chg-manual.sh0000664000076400007640000001707012357250001021204 0ustar00martineamartinea00000000000000#!@SHELL@ # # Exit Status: # 0 Alles Ok # 1 Illegal Request # 2 Fatal Error # prefix=@prefix@ exec_prefix=@exec_prefix@ amlibexecdir=@amlibexecdir@ . ${amlibexecdir}/chg-lib.sh # # Changer config file (changerfile) # # resend_mail=900 # 15 minutes # timeout_mail=604800 # 7 days # request="tty" # Use the tty to ask the user to change tape. # # Can't be use by cron # request="email" # Send an email to ask the user to change tape. # request="tty_email" # Use the tty if it exist or send an email. # #Default is "tty_email" # mtx_binary="/path/to/mtx" # path of 'mtx'; default is value discovered by # # configure # # if [ -d "@AMANDA_DBGDIR@" ]; then logfile=@AMANDA_DBGDIR@/changer.debug else logfile=/dev/null fi myname=`basename $0` EGREP='@EGREP@' if ! error=`try_find_mt`; then echo $error exit 2 fi ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$" REPORTTO=`amgetconf mailto` MAILER=`amgetconf mailer` tape=`amgetconf tapedev` if [ -z "$tape" ]; then echo `_ ' tapedev not specified in amanda.conf.'` exit 2 fi ORG=`amgetconf ORG` firstslot=1 lastslot=99 resend_mail=900 # 15 minutes timeout_mail=604800 # 7 days abort_file="chg-manual.abort" abort_dir=`pwd` changerfile=`amgetconf changerfile` conf_match=`expr "$changerfile" : .\*\.conf\$` if [ $conf_match -ge 6 ]; then configfile=$changerfile changerfile=`echo $changerfile | sed 's/.conf$//g'` else configfile=$changerfile.conf fi cleanfile=$changerfile-clean accessfile=$changerfile-access slotfile=$changerfile-slot [ ! -f $cleanfile ] && echo 0 > $cleanfile [ ! -f $accessfile ] && echo 0 > $accessfile [ ! -f $slotfile ] && echo $firstslot > $slotfile cleancount=`cat $cleanfile` accesscount=`cat $accessfile` slot=`cat $slotfile` # define these functions early so that they can be overridden in changerfile.conf request_tty() { if > /dev/tty; then echo "$amdevcheck_message" >> /dev/tty # message parsed by ZMC: echo `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty echo `_ ' or type "NONE" to abort'` > /dev/tty read ANSWER < /dev/tty if [ X"$ANSWER" = X"NONE" ]; then echo `_ 'Aborting by user request'` > /dev/tty answer=`_ ' Aborting by user request'` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi else answer=`_ ' no /dev/tty to ask to change tape'` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi } ### # If $changerfile exists, source it into this script. One reason is to # override the request() function above which gets called to request # that a tape be mounted. Here is an alternate versions of request() # that does things more asynchronous: # request_email() { # Send E-mail about the mount request and wait for the drive # to go ready by checking the status once a minute. Repeat # the E-mail once an hour in case it gets lost. timeout=0 gtimeout=$timeout_mail rm -f $abort_filename while true;do if [ $gtimeout -le 0 ]; then answer=`_ '%s %s: timeout waiting for tape online' "$load" "$myname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2; fi if [ -f $abort_filename ]; then rm -f $abort_filename answer=`_ ' Aborting by user request'` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi if [ $timeout -le 0 ]; then msg=`_ '%s\nInsert Amanda tape into slot %s (%s)\nor \`touch %s\` to abort.' "$amdevcheck_message" "$1" "$tape" "$abort_filename"` subject=`_ '%s AMANDA TAPE MOUNT REQUEST FOR SLOT %s' "$ORG" "$1"` echo "$msg" | $MAILER -s "$subject" $REPORTTO timeout=$resend_mail fi echo `_ ' -> status %s' "$tape"` >> $logfile if amdevcheck_status $tape; then break fi sleep 60 timeout=`expr $timeout - 60` gtimeout=`expr $gtimeout - 60` done } request_tty_email() { if > /dev/tty; then request_tty "$1" else request_email "$1" fi } request() { if [ X"$request" = X"tty" ]; then request_tty "$1" else if [ X"$request" = X"email" ]; then request_email "$1" else request_tty_email "$1" fi fi } # source the changer configuration file (see description, top of file) if [ -f $configfile ]; then . $configfile fi # adjust MTX, if necessary test -n "${mtx_binary}" && MTX="${mtx_binary}" # check that MAILER is defined if test -z "$MAILER"; then if test x"$request" = x"email" || test x"$request" = x"tty-email"; then answer=`_ " %s: Can't send email because MAILER is not defined" "$myname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi fi # eject() { echo `_ ' -> status %s' "$tape"` >> $logfile if amdevcheck_status $tape; then echo `_ ' -> offline %s' "$tape"` >> $logfile try_eject_device $tape answer="$slot $tape" code=0 else answer=`_ ' %s: %s' "$myname" "$amdevcheck_message"` code=1 fi echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit $code } abort_filename="$abort_dir/$abort_file" # reset() { echo `_ ' -> status %s' "$tape"` >> $logfile if amdevcheck_status $tape; then answer="$slot $tape" else answer="0 $tape $amdevcheck_message" fi echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 } # load # loadslot() { echo `_ ' -> status %s' "$tape"` >> $logfile # amdevcheck returns zero if the tape exists. amdevcheck_status $tape; tape_status=$? whichslot=$1 case $whichslot in current) load=$slot ;; next|advance) load=`expr $slot + 1` [ $load -gt $lastslot ] && load=$firstslot ;; prev) load=`expr $slot - 1` [ $load -lt $firstslot ] && load=$lastslot ;; first) load=$firstslot ;; last) load=$lastslot ;; [0-9]|[0-9][0-9]) if [ $1 -lt $firstslot -o $1 -gt $lastslot ]; then answer=`_ ' %s: slot must be %s .. %s' "$myname" "firstslot" "$lastslot"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi load=$1 ;; *) answer=`_ ' %s: illegal slot: %s' "$myname" "$1"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 ;; esac # if [ $tape_status -eq 0 -a $load = $slot ];then # already loaded answer="$slot $tape" echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 fi if [ X"$whichslot" = X"current" ]; then answer=" Current slot not loaded" echo `_ 'Exit ->'` $answer>> $logfile echo $answer exit 1 fi expr $accesscount + 1 > $accessfile if [ $tape_status -eq 0 ]; then echo `_ " -> offline %s" "$tape"` >> $logfile try_eject_device $tape tape_status=1 fi if [ $whichslot = advance ]; then tape=/dev/null else echo `_ ' -> load %s' "$load"` >> $logfile while true; do request $load echo `_ ' -> status %s' "$tape"` >> $logfile if amdevcheck_status $tape; then break; fi done fi echo $load > $slotfile answer="$load $tape" echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 } # info() { echo `_ ' -> status %s' "$tape"` >> $logfile if amdevcheck_status $tape; then answer="$slot $lastslot 1" else answer="0 $lastslot 1" fi echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 } # # main part # echo `gettext "args ->"` "$@" >> $logfile while [ $# -ge 1 ];do case $1 in -slot) shift loadslot $* ;; -info) shift info ;; -reset) shift reset ;; -eject) shift eject ;; *) fmt=`gettext " %s: Unknown option %s\n"` printf $fmt $myname $1 exit 2 ;; esac done exit 0 amanda-3.3.6/changer-src/chg-multi.sh0000664000076400007640000003061712357250001021063 0ustar00martineamartinea00000000000000#! @SHELL@ # # Amanda, The Advanced Maryland Automatic Network Disk Archiver # Copyright (c) 1991-1999 University of Maryland at College Park # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # All Rights Reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of U.M. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. U.M. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Author: James da Silva, Systems Design and Analysis Group # Computer Science Department # University of Maryland at College Park # # # chg-multi.sh - generic tape changer script # # source utility functions and values from configure prefix=@prefix@ exec_prefix=@exec_prefix@ amlibexecdir=@amlibexecdir@ . ${amlibexecdir}/chg-lib.sh pname="chg-multi" if [ -d "@AMANDA_DBGDIR@" ]; then logfile=@AMANDA_DBGDIR@/changer.debug else logfile=/dev/null fi echo `_ "arguments ->"` "$@" >> $logfile ourconf=`amgetconf changerfile` if ! error=try_find_mt; then echo $error exit 2 fi EXPR=expr # EXPR=/usr/local/bin/expr # in case you need a more powerful expr... # read in some config parameters if [ ! -f "$ourconf" ]; then answer=`_ ' %s: %s does not exist' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null` if [ -z "$firstslot" ]; then answer=`_ ' %s: firstslot not specified in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null` if [ -z "$lastslot" ]; then answer=`_ ' %s: lastslot not specified in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi nslots=`$EXPR $lastslot - $firstslot + 1` gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null` if [ -z "$gravity" ]; then answer=`_ ' %s: gravity not specified in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null` if [ -z "$needeject" ]; then answer=`_ ' %s: needeject not specified in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null` if [ -z "$multieject" ]; then echo `_ 'Note: setting multieject to a default of zero'` >> $logfile multieject=0 fi ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null` if [ -z "$ejectdelay" ]; then echo `_ 'Note: setting ejectdelay to a default of zero'` >> $logfile ejectdelay=0 fi posteject=`awk '$1 == "posteject" {print $2}' $ourconf 2>/dev/null` if [ -z "$posteject" ]; then echo `_ 'Note: setting posteject to a default of "true"'` >> $logfile posteject=true fi ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null` if [ -z "$ourstate" ]; then answer=`_ ' %s: statefile not specified in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi if [ -f "$ourstate" -a ! -r "$ourstate" ]; then answer=`_ " %s: Can't read the statefile %s" "$pname" "$ourstate"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi if [ -f "$ourstate" -a ! -w "$ourstate" ]; then answer=`_ " %s: Can't write the statefile %s" "$pname" "$ourstate"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi dirstate=`dirname $ourstate` if [ ! -e "$dirstate" ]; then answer=`_ " %s: Directory %s doesn't exist" "$pname" "$dirstate"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi if [ ! -d "$dirstate" ]; then answer=`_ ' %s: %s must be a directory' "$pname" "$dirstate"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi if [ ! -w "$dirstate" ]; then answer=`_ " %s: Can't write to %s directory" "$pname" "$dirstate"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi # needeject and multieject are incompatible if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then answer=`_ ' %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi # read in state: only curslot and curloaded at the present time curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null` if [ -z "$curslot" ]; then curslot=$firstslot fi curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null` if [ -z "$curloaded" ]; then curloaded=0 fi # process the command-line # control vars to avoid code duplication: not all shells have functions! usage=0 checkgravity=0 ejectslot=0 loadslot=0 slotempty=0 ejectonly=0 if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi case "$command" in -info) # return basic information about changer backwards=`$EXPR 1 - $gravity` answer="$curslot $nslots $backwards" echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 ;; -reset) # reset changer. Actually, we only reset changer state. We # trust that the operator has reloaded a stack and reset the # hardware. In most cases, we do not want to actually do # anything: if the operator has done something with the # hardware, we have no way to know what the actual current # slot is. If the hardware state has not changed, and what is # really wanted is to load the first slot, use "slot first" # instead checkgravity=0 loadslot=1 newslot=$firstslot curslot=$firstslot # XXX put changer-specific reset here, if applicable ;; -eject) # eject tape if loaded. Note that if multieject is set, this # only can make sense if the position is last and gravity 1 checkgravity=0 loadslot=0 newslot=$curslot ejectslot=1 ejectonly=1 if [ $multieject -eq 1 ] && \ ([ $gravity -eq 0 ] || [ $curslot -ne $lastslot ]) ; then # Can't do this: if we eject, the stacker is going to # load the next tape, and our state will be botched answer=`_ '%s %s: Cannot use -eject with multieject/nogravity/notlastslot' "$curslot" "$pname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi if [ $curloaded -eq 0 ]; then answer=`_ '%s %s: slot already empty' "$curslot" "$pname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi ;; -slot) # change to slot checkgravity=1 loadslot=1 slotparm=$2 case "$slotparm" in [0-9]*) newslot=$slotparm if [ $newslot -gt $lastslot ] || \ [ $newslot -lt $firstslot ] ; then answer=`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi ;; current) newslot=$curslot ;; first) newslot=$firstslot ;; last) newslot=$lastslot ;; next|advance) newslot=`$EXPR $curslot + 1` if [ $newslot -gt $lastslot ]; then newslot=$firstslot fi if [ $slotparm = advance ]; then loadslot=0 fi ;; prev) newslot=`$EXPR $curslot - 1` if [ $newslot -lt $firstslot ]; then newslot=$lastslot fi ;; *) answer=`_ ' %s: bad slot name "%s"' "$pname" "$slotparm"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 ;; esac ;; *) usage=1 ;; esac if [ $usage -eq 1 ]; then answer=`_ ' usage: %s {-reset | -slot [|current|next|prev|advance] | -info | -eject}' "$pname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi # check for legal move if [ $checkgravity -eq 1 ] && [ $gravity -ne 0 ] ; then if [ $newslot -lt $curslot ] || [ "$slotparm" = "prev" ] ; then answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi fi # Do the 'mt offline' style of stacker control if applicable if [ $multieject -eq 1 ] && [ $loadslot -eq 1 ] && [ $newslot -ne $curslot ] then # XXX put changer-specific load command here, if applicable curloaded=0 # unless something goes wrong slotempty=0 while [ $curslot -ne $newslot ]; do device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null` if [ "$device" = "" ]; then answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi echo `_ ' -> offline'` "$device" >> $logfile if ! try_eject_device $device; then answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi [ $ejectdelay -gt 0 ] && sleep $ejectdelay echo `_ ' -> running'` $posteject $device >> $logfile $posteject $device >> $logfile 2>&1 status=$? if [ $status -ne 0 ]; then answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi curslot=`$EXPR $curslot + 1` if [ $curslot -gt $lastslot ] ; then curslot=$firstslot fi done fi if [ $ejectonly -eq 1 ] \ || ([ $needeject -eq 1 ] \ && [ $loadslot -eq 1 ] \ && [ $curloaded -eq 1 ] \ && [ $newslot -ne $curslot ]) then # XXX put changer-specific load command here, if applicable curloaded=0 # unless something goes wrong slotempty=0 # try to unload the current device device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null` if [ "$device" = "" ]; then answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi echo `_ ' -> offline'` $device >> $logfile try_eject_device $device if [ $? -ne 0 ]; then # # XXX if the changer-specific eject command can distinguish # betweeen "slot empty" and more serious errors, return 1 # for the first case, 2 for the second case. Generically, # we just presume an error signifies an empty slot. # slotempty=1 else [ $ejectonly -eq 0 ] && [ $ejectdelay -gt 0 ] && sleep $ejectdelay echo `_ ' -> running '` $posteject $device >> $logfile $posteject $device >> $logfile 2>&1 status=$? if [ $status -ne 0 ]; then answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi fi fi if [ $loadslot -eq 1 ]; then # load the tape from the slot # XXX put changer-specific load command here, if applicable curloaded=1 # unless something goes wrong slotempty=0 curslot=$newslot # try to rewind the device device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null` if [ "$device" = "" ]; then answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 2 fi amdevcheck_status $device if [ $? -ne 0 ]; then # # XXX if the changer-specific load command can distinguish # betweeen "slot empty" and more serious errors, return 1 # for the first case, 2 for the second case. Generically, # we just presume an error signifies an empty slot. # slotempty=1 curloaded=0 fi fi # update state echo `_ '# multi-changer state cache: DO NOT EDIT!'` > $ourstate echo curslot $newslot >> $ourstate echo curloaded $curloaded >> $ourstate # return slot info if [ $slotempty -eq 1 ]; then answer=`_ '%s %s: slot is empty: %s' "$newslot" "$pname" "$amdevcheck_message"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 fi if [ "$command" = -slot -a "$slotparm" = advance ]; then device=/dev/null fi answer="$newslot $device" echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 0 amanda-3.3.6/changer-src/Makefile.am0000664000076400007640000000062512357250001020666 0ustar00martineamartinea00000000000000# Makefile for Amanda tape changer programs. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/scripts.am include $(top_srcdir)/config/automake/installperms.am SCRIPTS_SHELL = \ chg-manual \ chg-multi \ chg-zd-mtx \ chg-disk SCRIPTS_INCLUDE = \ chg-lib.sh EXTRA_DIST += chg-lib.sh.in amlibexec_SCRIPTS = $(SCRIPTS_SHELL) amlibexec_DATA = $(SCRIPTS_INCLUDE) amanda-3.3.6/changer-src/chg-zd-mtx.sh0000664000076400007640000013147412357250001021157 0ustar00martineamartinea00000000000000#!@SHELL@ # # Exit Status: # 0 Alles Ok # 1 Illegal Request # 2 Fatal Error # # Contributed by Eric DOUTRELEAU # This is supposed to work with Zubkoff/Dandelion version of mtx # # Modified by Joe Rhett # to work with MTX 1.2.9 by Eric Lee Green http://mtx.sourceforge.net # # Modified by Jason Hollinden on 13-Feb-2001 # to work with MTX 1.2.10, >9 slots, has barcode support, and works with # multiple configs at once. # NOTE: Only tested the 2 additions with an ADIC Scalar 100. ################################################################################ # Here are the things you need to do and know to configure this script: # # * Figure out what the robot device name is and what the tape drive # device name is. They will be different! # # You cannot send robot commands to a tape drive and vice versa. # Both should respond to "mtx -f /dev/... inquiry". Hopefully, # that output will make it obvious which is which. # # For instance, here is what mtx has to say about my current robot: # # Product Type: Medium Changer # Vendor ID: 'ATL ' # Product ID: 'ACL2640 206 ' # Revision: '2A5A' # Attached Changer: No # # and here is what it says about a tape drive: # # Product Type: Tape Drive # Vendor ID: 'Quantum ' # Product ID: 'DLT4000 ' # Revision: 'CD50' # Attached Changer: No # # Note the "Product Type" value makes it clear which is which. # # If it is not obvious, "mf -f /dev/... rewind" should be happy when # talking to a (loaded) tape drive but the changer should give some # kind of error. Similarly, "mtx -f /dev/... status" should show good # results with the changer but fail with a tape drive device name. # # Once you have this figured out, set "changerdev" in amanda.conf # to the changer device and "tapedev" to the tape device. # # * Find out what the first and last storage slots are. Running # "mtx -f /dev/... status" should give you something like this # (although the output will vary widely based on the version of mtx # and the specifics of your robot): # # Storage Changer /dev/changer:1 Drives, 9 Slots ( 0 Import/Export ) # Data Transfer Element 0:Empty # Storage Element 1:Full :VolumeTag=SR0001 # Storage Element 2:Full :VolumeTag=SR0002 # Storage Element 3:Full :VolumeTag=SR0003 # Storage Element 4:Full :VolumeTag=SR0004 # Storage Element 5:Full :VolumeTag=SR0005 # Storage Element 6:Full :VolumeTag=SR0006 # Storage Element 7:Full :VolumeTag=SR0007 # Storage Element 8:Full :VolumeTag=SR0008 # Storage Element 9:Full :VolumeTag=SR0009 # Storage Element 10 IMPORT/EXPORT:Full :VolumeTag=SR0009 # # This says the first storage slot (element) is "1" and the last # is "9". If you allocate the entire robot to Amanda, you do not need # to set the "firstslot" or "lastslot" configuration file variables -- # the script will compute these values for you. # # You do not have to allocate all of the slots for Amanda use, # but whatever slots you use must be contiguous (i.e. 4 through 9 # in the above would be OK but 1, 2, 5, 6, 9 would not). The one # exception to this is that if one of the slots contains a cleaning # cartridge, it may be in any slot (Amanda will just skip over it if # it is between firstslot and lastslot). # # * Speaking of cleaning cartridges, if you have a storage slot dedicated # to one, figure out what slot it is in. That slot number will go in # the "cleanslot" variable. # # Also, decide if you want the changer script to automatically run # the cleaning tape through the drive after every so many mounts, # and how many mounts you want to do between cleanings. If you # want the script to do this, set the "autoclean" variable to 1 and # the "autocleancount" to the number of mounts between cleanings. # If you do not want to do automatic cleanings (including not having # a cleaning cartridge in the robot), set "autoclean" to 0. # # Note that only a count of mounts is used to determine when it is # time to clean. The script does not try to detect if the drive is # requesting cleaning, or how much the drive was used on a given # mount. # # * If you tell Amanda about a cleaning cartridge, whether for automatic # operation or manual (amtape clean), you must also tell # the script how long it takes to run the cleaning cycle. It is # impossible for the script to determine when the cleaning operation # is done, so the "cleancycle" variable is the number of seconds # the longest cleaning operation takes (you'll just have to figure # this out by watching it a few times, or maybe finding it in a tape # drive hardware manual). The script will sleep for this length of # time whenever the cleaning tape is referenced. The default is 120 # seconds (two minutes). # # * Figure out the drive slot number. By default, it is set to 0. # In the example above, the tape drive ("Data Transfer Element") # is in slot 0. If your drive slot is not 0, you # need to set the drive slot number with the "driveslot" variable. # # * Figure out whether your robot has a barcode reader and whether # your version of mtx supports it. If you see "VolumeTag" entries # in the "mtx -f /dev/xxx status" output you did above, you have # a reader and mtx can work with it, so you may set the "havereader" # variable to 1. The default is 0 (do not use a reader). # # * Pick any tape to load and then determine if the robot can put it # away directly or whether an "offline" must be done first. # # With the tape still mounted and ready, try to put the tape away # with "mtx". If you get some kind of error, which is the most # common response, try "mt -f /dev/... offline", wait for the drive # to unload and make sure the robot takes no action on its own to # store the tape. Assuming it does not, try the "mtx" command again # to store the tape. # # If you had to issue the "mt -f /dev/... offline" before you could # use "mtx" to store the tape, set the "offline_before_unload" # variable to 1. If "mtx" unloaded the drive and put the tape away # all by itself, set it to 0. # # * Some drives and robots require a small delay between unloading the # tape and instructing the robot to move it back to storage. # For instance, if you try to grab the tape too soon on an ATL robot # with DLT tape drives, it will rip the leader out of the drive and # require sincerely painful hardware maintenance. # # If you need a little delay, set the "unloadpause" variable to # the number of seconds to wait before trying to take a tape from # a drive back to storage. The default is 0. # # * Some drives also require a short pause after loading, or the drive # will return an I/O error during a test to see if it's online (which # this script uses "mt rewind" to test). My drives don't recover from # this, and must be reloaded before they will come online after failing # such a test. For this reason there is an "initial_poll_delay" # variable which will pause for a certain number of seconds before # looping through the online test for the first time. The default is 0. #### #### # Now you are ready to set up the variables in the changer configuration # file. # # All variables are in "changerfile".conf where "changerfile" is set # in amanda.conf. For example, if amanda.conf has: # # changerfile="/etc/amanda/Dailyset1/CHANGER" # or changerfile="/etc/amanda/Dailyset1/CHANGER.conf" # # the variables must be in "/etc/amanda/Dailyset1/CHANGER.conf". # The ".conf" is appended only if it's not there". # # If "changerfile" is a relative path, it is relative to the directory # that contains amanda.conf. That also happens to be the directory Amanda # makes current before running this script. # # Here is a commented out example file with all the variables and showing # their default value (if any): #### # firstslot=? #### First storage slot (element) -- required # lastslot=? #### Last storage slot (element) -- required # cleanslot=-1 #### Slot with cleaner tape -- default is "-1" # #### Set negative to indicate no cleaner available # driveslot=0 #### Drive slot number. Defaults to 0 # #### Use the 'Data Transfer Element' you want # # # Do you want to clean the drive after a certain number of accesses? # # NOTE - This is unreliable, since 'accesses' aren't 'uses', and we # # have no reliable way to count this. A single amcheck could # # generate as many accesses as slots you have, plus 1. # # ALSO NOTE - many modern tape loaders handle this automatically. # # autoclean=0 #### Set to '1' or greater to enable # # autocleancount=99 #### Number of access before a clean. # # havereader=0 #### If you have a barcode reader, set to 1. # # offline_before_unload=0 #### Does your robot require an # #### 'mt offline' before mtx unload? # # poll_drive_ready=NN #### Time (seconds) between tests to see if # #### the tape drive has gone ready (default: 3). # # max_drive_wait=NN #### Maximum time (seconds) to wait for the # #### tape drive to become ready (default: 120). # # initial_poll_delay=NN #### initial delay after load before polling for # #### readiness # # slotinfofile=FILENAME #### record slot information to this file, in # #### the line-based format "SLOT LABEL\n" # #### #### # Now it is time to test the setup. Do all of the following in the # directory that contains the amanda.conf file, and do all of it as # the Amanda user. # # * Run this: # # .../chg-zd-mtx -info # echo $? #### (or "echo $status" if you use csh/tcsh) # # You should get a single line from the script like this (the actual # numbers will vary): # # 5 9 1 1 # # The first number (5) is the "current" slot. This may or may not be # the slot actually loaded at the moment (if any). It is the slot # Amanda will try to use next. # # The second number (9) is the number of slots. # # The third number will always be "1" and indicates the changer is # capable of going backward. # # The fourth number is optional. If you set $havereader to 1, it # will be "1", otherwise it will not be present. # # The exit code ($? or $status) should be zero. # # * Run this: # # .../chg-zd-mtx -reset # echo $? # # The script should output a line like this: # # 1 /dev/rmt/0mn # # The number at the first should match $firstslot. The device name # after that should be your tape device. # # The exit code ($? or $status) should be zero. # # * Run this: # # .../chg-zd-mtx -slot next # echo $? # # The script should output a line like this: # # 2 /dev/rmt/0mn # # The number at the first should be one higher than $firstslot. # The device name after that should be your tape device. # # The exit code ($? or $status) should be zero. # # * Run this: # # .../chg-zd-mtx -slot current # echo $? # # Assuming the tape is still loaded from the previous test, the # robot should not move and the script should report the same thing # the previous command did. # # * If you continue to run "-slot next" commands, the robot should load # each tape in turn then wrap back around to the first when it # reaches $lasttape. If $cleanslot is within the $firstslot to # $lastslot range, the script will skip over that entry. # # * Finally, try some of the amtape commands and make sure they work: # # amtape reset # amtape slot next # amtape slot current # # * If you set $havereader non-zero, now would be a good time to create # the initial barcode database: # # amtape update #### ################################################################################ # To debug this script, first look in @AMANDA_DBGDIR@. The script # uses one of two log files there, depending on what version of Amanda # is calling it. It may be chg-zd-mtx.YYYYMMDD*.debug, or it may be # changer.debug.driveN where 'N' is the drive number. # # If the log file does not help, try running the script, **as the Amanda # user**, in the amanda.conf directory with whatever set of args the log # said were used when you had a problem. If nothing else useful shows up # in the output, try running the script with the DEBUG environment variable # set non-null, e.g.: # # env DEBUG=yes .../chg-zd-mtx ... ################################################################################ # source utility functions and values from configure prefix=@prefix@ exec_prefix=@exec_prefix@ amlibexecdir=@amlibexecdir@ . ${amlibexecdir}/chg-lib.sh test -n "$DEBUG" && set -x TMPDIR="@AMANDA_TMPDIR@" DBGDIR="@AMANDA_DBGDIR@" argv0=$0 myname=`expr "$argv0" : '.*/\(.*\)'` config=`pwd 2>/dev/null` config=`expr "$config" : '.*/\(.*\)'` ### # Functions to write a new log file entry and append more log information. ### ds=`date '+%H:%M:%S' 2>/dev/null` if [ $? -eq 0 -a -n "$ds" ]; then logprefix=`echo "$ds" | sed 's/./ /g'` else logprefix="" fi LogAppend() { if [ -z "$logprefix" ]; then echo "$@" >> $DBGFILE else echo "$logprefix" "$@" >> $DBGFILE fi } Log() { if [ -z "$logprefix" ]; then echo "===" "`date`" "===" >> $DBGFILE echo "$@" >> $DBGFILE else ds=`date '+%H:%M:%S' 2>/dev/null` echo "$ds" "$@" >> $DBGFILE fi } ### # Common exit function. # # $1 = exit code # $2 = slot result # $3 = additional information (error message, tape devive, etc) ### internal_call=0 Exit() { if [ $internal_call -gt 0 ]; then call_type=Return else call_type=Exit fi code=$1 shift exit_slot=$1 shift exit_answer="$@" Log $call_type "($code) -> $exit_slot $@" echo "$exit_slot" "$@" if [ $call_type = Return ]; then return $code fi amgetconf dbclose.$myname:$DBGFILE > /dev/null 2>&1 exit $code } ### # Function to run another command and log it. ### Run() { Log `_ 'Running: %s' "$*"` rm -f $stdout $stderr "$@" > $stdout 2> $stderr exitcode=$? Log `_ 'Exit code: %s' "$exitcode"` if [ -s $stdout ] then LogAppend Stdout: cat $stdout >> $DBGFILE fi if [ -s $stderr ] then LogAppend Stderr: cat $stderr >> $DBGFILE fi cat $stdout cat $stderr 1>&2 return $exitcode } ### # Return success if the arg is numeric. ### IsNumeric() { test -z "$1" && return 1 x="`expr -- "$1" : "\([-0-9][0-9]*\)" 2>/dev/null`" return `expr X"$1" != X"$x"` } ### # Run $MTX status unless the previous output is still valid. ### mtx_status_valid=0 get_mtx_status() { test -n "$DEBUG" && set -x if [ $mtx_status_valid -ne 0 ]; then return 0 fi rm -f $mtx_status Run $MTX status > $mtx_status 2>&1 status=$? if [ $status -eq 0 ]; then mtx_status_valid=1 fi # shim this in here so that we get a completely new slotinfofile # every time we run mtx status regenerate_slotinfo_from_mtx return $status } ### # Determine the slot currently loaded. Set $loadedslot to the slot # currently loaded, or "-1", and $loadedbarcode to the corresponding # barcode (or nothing). ### get_loaded_info() { test -n "$DEBUG" && set -x get_mtx_status if [ $mtx_status_valid -eq 0 ]; then Exit 2 \ `_ ''` \ `head -1 $mtx_status` return $? fi set x `sed -n ' /^Data Transfer Element:Empty/ { s/.*/-1/p q } /^Data Transfer Element '$driveslot':Empty/ { s/.*/-1/p q } /^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/ { s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p q } /^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/ { s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^ ]*\)/\1 \2/p q } /^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded):VolumeTag *= *\([^ ]*\)/ { s/.*:VolumeTag *= *\([^ ]*\)/-2 \1/p q } /^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ { s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p q } /^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ { s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p q } /^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ { s/.*/-2/p q } ' < $mtx_status 2>&1` shift # get rid of the "x" loadedslot=$1 loadedbarcode=$2 if [ -z "$loadedslot" ]; then Exit 2 \ `_ ''` \ "could not determine current slot, are you sure your drive slot is $driveslot" return $? # in case we are internal fi #Use the current slot if it's empty and we don't know which slot is loaded' if [ $loadedslot -eq -2 ]; then set x `sed -n ' { /^.*Storage Element '$currentslot':Empty/ { s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p q } /^.*Storage Element '$currentslot':Full/ { s/.*Storage Element \([0-9][0-9]*\):Full/-2/p q } /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Empty/ { s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p q } /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Full/ { s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/-2/p q } } ' < $mtx_status 2>& 1` shift # get rid of the "x" loadedslotx=$1 if [ ! -z $loadedslotx ]; then loadedslot=$loadedslotx fi fi #Use the first empty slot if we don't know which slot is loaded' if [ $loadedslot -eq -2 ]; then set x `sed -n ' { /^.*Storage Element \([0-9][0-9]*\):Empty/ { s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p q } /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/ { s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p q } } ' < $mtx_status 2>& 1` shift # get rid of the "x" loadedslot=$1 fi if IsNumeric "$loadedslot" ; then : else Exit 2 \ `_ ''` \ "currently loaded slot ($loadedslot) not numeric" return $? # in case we are internal fi Log `_ 'STATUS -> currently loaded slot = %s' "$loadedslot"` LogAppend `_ ' -> currently loaded barcode = "%s"' "$loadedbarcode"` } ### # Get a list of slots between $firstslot and $lastslot, if they are set. # If they are not set, set them to the first and last slot seen on the # assumption the entire robot is to be used (???). ### slot_list= get_slot_list() { test -n "$DEBUG" && set -x if [ -n "$slot_list" ]; then return fi get_mtx_status if [ $mtx_status_valid -eq 0 ]; then Exit 2 \ `_ ''` \ `head -1 $mtx_status` return $? fi slot_list=`sed -n ' /^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ { s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p } /^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ { s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p } /^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ { : loop n /^.*Storage Element \([0-9][0-9]*\):Full/ { s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p b loop } /^.*Storage Element \([0-9][0-9]*\):Empty/ { s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p } } /^.*Storage Element \([0-9][0-9]*\):Full/ { s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p } /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/ { s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full.*/\1/p } ' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n` slot_list=`echo $slot_list` # remove the newlines if [ $firstslot -lt 0 -o $lastslot -lt 0 ]; then last=$lastslot for slot in $slot_list; do if [ $firstslot -lt 0 ]; then Log `_ 'SLOTLIST -> firstslot set to %s' "$slot"` firstslot=$slot fi if [ $lastslot -lt 0 ]; then last=$slot fi done if [ $lastslot -lt 0 -a $last -ge 0 ]; then Log `_ 'SLOTLIST -> lastslot set to %s' "$last"` lastslot=$last fi if [ $firstslot -lt 0 ]; then Exit 2 \ `_ ''` \ `_ 'cannot determine first slot'` return $? # in case we are internal elif [ $lastslot -lt 0 ]; then Exit 2 \ `_ ''` \ `_ 'cannot determine last slot'` return $? # in case we are internal fi fi amanda_slot_list= for slot in $slot_list; do if [ $slot -ge $firstslot -a $slot -le $lastslot ]; then amanda_slot_list="$amanda_slot_list $slot" fi done if [ -z "$amanda_slot_list" ]; then Exit 2 \ `_ ''` \ "no slots available" return $? # in case we are internal fi slot_list="$amanda_slot_list" } ### # Read the labelfile and scan for a particular entry. ### read_labelfile() { labelfile_entry_found=0 labelfile_label= labelfile_barcode= lbl_search=$1 bc_search=$2 line=0 while read lbl bc junk; do line=`expr $line + 1` if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then Log `_ 'ERROR -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 2 \ `_ ''` \ `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"` return $? # in case we are internal fi if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then if [ $labelfile_entry_found -ne 0 ]; then Log `_ 'ERROR -> Duplicate entries: %s line %s' "$labelfile" "$line"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 2 \ `_ ''` \ `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"` return $? # in case we are internal fi labelfile_entry_found=1 labelfile_label=$lbl labelfile_barcode=$bc fi done } lookup_label_by_barcode() { [ -z "$1" ] && return read_labelfile "" "$1" < $labelfile echo "$labelfile_label" } lookup_barcode_by_label() { [ -z "$1" ] && return read_labelfile "$1" "" < $labelfile echo "$labelfile_barcode" } remove_from_labelfile() { labelfile=$1 lbl_search=$2 bc_search=$3 internal_remove_from_labelfile "$lbl_search" "$bc_search" < $labelfile >$labelfile.new if [ $labelfile_entry_found -ne 0 ]; then mv -f $labelfile.new $labelfile LogAppend `_ 'Removed Entry "%s %s" from barcode database' "$labelfile_label" "$labelfile_barcode"` fi } internal_remove_from_labelfile() { labelfile_entry_found=0 labelfile_label= labelfile_barcode= lbl_search=$1 bc_search=$2 line=0 while read lbl bc junk; do line=`expr $line + 1` if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then Log `_ 'ERROR -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 2 \ `_ ''` \ `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"` return $? # in case we are internal fi if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then if [ $labelfile_entry_found -ne 0 ]; then Log `_ 'ERROR -> Duplicate entries: %s line %s' "$labelfile" "$line"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 2 \ `_ ''` \ `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"` return $? # in case we are internal fi labelfile_entry_found=1 labelfile_label=$lbl labelfile_barcode=$bc else echo $lbl $bc fi done } ### # Add a new slot -> label correspondance to the slotinfo file, removing any previous # information about that slot. ### record_label_in_slot() { [ -z "$slotinfofile" ] && return newlabel="$1" newslot="$2" ( if [ -f "$slotinfofile" ]; then grep -v "^$newslot " < "$slotinfofile" fi echo "$newslot $newlabel" ) > "$slotinfofile~" mv "$slotinfofile~" "$slotinfofile" } ### # Remove a slot from the slotinfo file ### remove_slot_from_slotinfo() { [ -z "$slotinfofile" ] && return emptyslot="$1" ( if [ -f "$slotinfofile" ]; then grep -v "^$emptyslot " < "$slotinfofile" fi ) > "$slotinfofile~" mv "$slotinfofile~" "$slotinfofile" } ### # Assuming get_mtx_status has been run, # - if we have barcodes, regenerate the slotinfo file completely by # mapping barcodes in the status into labels using the labelfile # - otherwise, remove all empty slots from the slotinfo file ### regenerate_slotinfo_from_mtx() { [ -z "$slotinfofile" ] && return [ "$mtx_status_valid" = "1" ] || return if [ "$havereader" = "1" ]; then # rewrite slotinfo entirely based on the status, since it has barcodes :> "$slotinfofile~" sed -n '/.*Storage Element \([0-9][0-9]*\).*VolumeTag *= *\([^ ]*\) *$/{ s/.*Storage Element \([0-9][0-9]*\).*VolumeTag *= *\([^ ]*\) *$/\1 \2/ p }' < $mtx_status | while read newslot newbarcode; do newlabel=`lookup_label_by_barcode "$newbarcode"` if [ -n "$newlabel" ]; then echo "$newslot $newlabel" >> "$slotinfofile~" fi done mv "$slotinfofile~" "$slotinfofile" else # just remove empty slots from slotinfo # first determine which slots are not really empty, but are # loaded into a data transfer element loadedslots=`sed -n '/.*(Storage Element \([0-9][0-9]*\) Loaded).*/{ s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/g p }' < $mtx_status` # now look for any slots which are empty, but which aren't # in the set of loaded slots sed -n '/.*Storage Element \([0-9][0-9]*\): *Empty.*/{ s/.*Storage Element \([0-9][0-9]*\): *Empty.*/\1/g p }' < $mtx_status | while read emptyslot; do reallyempty=1 if [ -n "$loadedslots" ]; then for loadedslot in $loadedslots; do [ "$loadedslot" = "$emptyslot" ] && reallyempty=0 done fi if [ "$reallyempty" = "1" ]; then remove_slot_from_slotinfo "$emptyslot" fi done fi } DBGFILE=`amgetconf dbopen.$myname 2>/dev/null` if [ -z "$DBGFILE" ] then DBGFILE=/dev/null # will try this again below fi changerfile=`amgetconf changerfile 2>/dev/null` if [ -z "$changerfile" ]; then Exit 2 \ `_ ''` \ "changerfile must be specified in amanda.conf" fi rawtape=`amgetconf tapedev 2>/dev/null` if [ -z "$rawtape" ]; then Exit 2 \ `_ ''` \ "tapedev may not be empty" fi tape=`tape_device_filename "$rawtape"` if [ -z "$tape" ]; then Exit 2 \ ` _ ''` \ "tapedev $rawtape is not a tape device." elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then Exit 2 \ `_ ''` \ "tapedev ($tape) may not be the null device" fi # Confusingly, TAPE is the name of the changer device... TAPE=`amgetconf changerdev 2>/dev/null` if [ -z "$TAPE" ]; then Exit 2 \ `_ ''` \ "changerdev may not be empty" elif [ $TAPE = "/dev/null" ]; then Exit 2 \ `_ ''` \ "changerdev ($TAPE) may not be the null device" fi export TAPE # for mtx command CHANGER=$TAPE export CHANGER # for mtx command #### Set up the various config files. conf_match=`expr "$changerfile" : .\*\.conf\$` if [ $conf_match -ge 6 ]; then configfile=$changerfile changerfile=`echo $changerfile | sed 's/.conf$//g'` else configfile=$changerfile.conf fi if [ ! -e $configfile ]; then Exit 2 \ `_ ''` \ "configuration file \"$configfile\" doesn't exist" fi if [ ! -f $configfile ]; then Exit 2 \ `_ ''` \ "configuration file \"$configfile\" is not a file" fi cleanfile=$changerfile-clean accessfile=$changerfile-access slotfile=$changerfile-slot labelfile=$changerfile-barcodes slotinfofile="" [ ! -s $cleanfile ] && echo 0 > $cleanfile [ ! -s $accessfile ] && echo 0 > $accessfile [ ! -s $slotfile ] && echo -1 > $slotfile [ ! -f $labelfile ] && > $labelfile cleancount=`cat $cleanfile` accesscount=`cat $accessfile` #### Dig out of the config file what is needed varlist= varlist="$varlist firstslot" varlist="$varlist lastslot" varlist="$varlist cleanslot" varlist="$varlist cleancycle" varlist="$varlist OFFLINE_BEFORE_UNLOAD" # old name varlist="$varlist offline_before_unload" varlist="$varlist unloadpause" varlist="$varlist AUTOCLEAN" # old name varlist="$varlist autoclean" varlist="$varlist autocleancount" varlist="$varlist havereader" varlist="$varlist driveslot" varlist="$varlist poll_drive_ready" varlist="$varlist initial_poll_delay" varlist="$varlist max_drive_wait" varlist="$varlist slotinfofile" for var in $varlist do val="`cat $configfile 2>/dev/null | sed -n ' # Ignore comment lines (anything starting with a #). /^[ ]*#/d # Find the first var=val line in the file, print the value and quit. /^[ ]*'$var'[ ]*=[ ]*\([^ ][^ ]*\).*/ { s/^[ ]*'$var'[ ]*=[ ]*\([^ ][^ ]*\).*/\1/p q } '`" eval $var=\"$val\" done # Deal with driveslot first so we can get DBGFILE set if we are still # using the old amgetconf. if [ -z "$driveslot" ]; then driveslot=0; fi # Get DBGFILE set if it is not already. if [ $DBGFILE = /dev/null ]; then if [ -d "$DBGDIR" ]; then DBGFILE=$DBGDIR/changer.debug.drive$driveslot else DBGFILE=/dev/null fi Log `_ '=== Start %s ===' "\`date\`"` fi stdout=$TMPDIR/$myname.1.$$ stderr=$TMPDIR/$myname.2.$$ mtx_status=$TMPDIR/$myname.status.$$ trap "rm -f $stdout $stderr $mtx_status" 0 # exit cleanup Log `_ 'Using config file %s' "$configfile"` # Log the argument list. Log `_ "Arg info:"` LogAppend "\$# = $#" i=0 LogAppend "\$$i = \"$argv0\"" for arg in "$@"; do i=`expr $i + 1` LogAppend "\$$i = \"$arg\"" done # Set the default config values for those not in the file. Log the # results and make sure each is valid (numeric). firstslot=${firstslot:-'-1'} # default: mtx status lastslot=${lastslot:-'-1'} # default: mtx status cleanslot=${cleanslot:-'-1'} # default: -1 cleancycle=${cleancycle:-'120'} # default: two minutes if [ -z "$offline_before_unload" -a -n "$OFFLINE_BEFORE_UNLOAD" ]; then offline_before_unload=$OFFLINE_BEFORE_UNLOAD # (old name) fi offline_before_unload=${offline_before_unload:-'0'} # default: 0 unloadpause=${unloadpause:-'0'} # default: 0 if [ -z "$autoclean" -a -n "$AUTOCLEAN" ]; then autoclean=$AUTOCLEAN # (old name) fi autoclean=${autoclean:-'0'} # default: 0 autocleancount=${autocleancount:-'99'} # default: 99 havereader=${havereader:-'0'} # default: 0 poll_drive_ready=${poll_drive_ready:-'3'} # default: three seconds initial_poll_delay=${initial_poll_delay:-'0'} # default: zero zeconds max_drive_wait=${max_drive_wait:-'120'} # default: two minutes # check MT and MTX for sanity if test "${MTX%${MTX#?}}" = "/"; then if ! test -f "${MTX}"; then Exit 2 \ `_ ''` \ `_ "mtx binary at '%s' not found" "$MTX"` fi if ! test -x "${MTX}"; then Exit 2 \ `_ ''` \ `_ "mtx binary at '%s' is not executable" "$MTX"` fi else # try running it to see if the shell can find it "$MTX" >/dev/null 2>/dev/null if test $? -eq 127 -o $? -eq 126; then Exit 2 \ `_ ''` \ `_ "Could not run mtx binary at '%s'" "$MTX"` fi fi error=`try_find_mt` if test $? -ne 0; then Exit 2 '' $error fi get_slot_list Log `_ "Config info:"` for var in $varlist; do if [ $var = "OFFLINE_BEFORE_UNLOAD" ]; then continue # old name elif [ $var = "AUTOCLEAN" ]; then continue # old name elif [ $var = "slotinfofile" ]; then continue # not numeric fi eval val=\"'$'$var\" if [ -z "$val" ]; then Exit 2 \ `_ ''` \ `_ '%s missing in %s' "$var" "$configfile"` fi if IsNumeric "$val" ; then : else Exit 2 \ `_ ''` \ `_ '%s (%s) not numeric in %s' "$var" "$val" "$configfile"` fi LogAppend $var = \"$val\" done # Run the rest of the config file sanity checks. if [ $firstslot -gt $lastslot ]; then Exit 2 \ `_ ''` \ `_ 'firstslot (%s) greater than lastslot (%s) in %s' "$firstslot" "$lastslot" "$configfile"` fi if [ $autoclean -ne 0 -a $cleanslot -lt 0 ]; then Exit 2 \ `_ ''` \ `_ 'autoclean set but cleanslot not valid (%s)' "$cleanslot"` fi # Set up the current slot currentslot=`cat $slotfile` if IsNumeric "$currentslot" ; then if [ $currentslot -lt $firstslot ]; then Log `_ 'SETUP -> current slot %s less than %s ... resetting to %s' "$currentslot" "$firstslot" "$firstslot"` currentslot=$firstslot elif [ $currentslot -gt $lastslot ]; then Log `_ 'SETUP -> current slot %s greater than %s ... resetting to %s' "$currentslot" "$lastslot" "$lastslot"` currentslot=$lastslot fi else Log `_ 'SETUP -> contents of %s (%s) invalid, setting current slot to first slot (%s)' "$slotfile" "$currentslot" "$firstslot"` currentslot=$firstslot fi found_current=0 first_slot_in_list=-1 next_slot_after_current=-1 for slot in $slot_list; do if [ $first_slot_in_list -lt 0 ]; then first_slot_in_list=$slot # in case $firstslot is missing fi if [ $slot -eq $currentslot ]; then found_current=1 break elif [ $slot -gt $currentslot ]; then next_slot_after_current=$slot # $currentslot is missing break fi done if [ $found_current -eq 0 ]; then if [ $next_slot_after_current -lt 0 ]; then new_currentslot=$first_slot_in_list else new_currentslot=$next_slot_after_current fi Log `_ 'WARNING -> current slot %s not available, setting current slot to next slot (%s)' "$currentslot" "$new_currentslot"` currentslot=$new_currentslot fi # More routines. ### # Eject the current tape and put it away. ### eject() { test -n "$DEBUG" && set -x Log `_ 'EJECT -> ejecting tape from %s' "$tape"` get_loaded_info if [ $loadedslot -gt 0 ]; then Log `_ 'EJECT -> moving tape from drive %s to storage slot %s' "$driveslot" "$loadedslot"` if [ $offline_before_unload -ne 0 ]; then Run try_eject_device $tape fi sleep $unloadpause result=`Run $MTX unload $loadedslot $driveslot 2>&1` status=$? Log `_ ' -> status %s, result "%s"' "$status" "$result"` mtx_status_valid=0 if [ $status -ne 0 ]; then answer="$result" code=2 else answer="$rawtape" code=0 fi else answer=`_ 'Drive was not loaded'` code=1 fi Exit $code "$loadedslot" "$answer" return $? # in case we are internal } ### # Reset the robot back to the first slot. ### reset() { test -n "$DEBUG" && set -x Log `_ 'RESET -> loading tape from slot %s to drive %s (%s)' "$firstslot" "$driveslot" "$tape"` # Call loadslot without doing it as an internal and let it finish # things up. loadslot $firstslot # NOTREACHED Exit 2 `_ ''` `_ 'reset: should not get here'` return $? # in case we are internal } ### # Unload the current tape (if necessary) and load a new one (unless # "advance"). If no tape is loaded, get the value of "current" from # $slotfile. ### loadslot() { test -n "$DEBUG" && set -x if [ $# -lt 1 ]; then Exit 2 `_ ''` `_ 'Missing -slot argument'` return $? # in case we are internal fi whichslot=$1 Log `_ 'LOADSLOT -> load drive %s (%s) from slot %s' "$driveslot" "$tape" "$whichslot"` numeric=`echo $whichslot | sed 's/[^0-9]//g'` case $whichslot in current|prev|next|advance) find_slot=$currentslot ;; first) find_slot=$firstslot ;; last) find_slot=$lastslot ;; $numeric) find_slot=$numeric ;; clean) find_slot=$cleanslot ;; *) Exit 2 `_ ''` `_ 'Illegal slot: "%s"' "$whichslot"` return $? # in case we are internal ;; esac # Find the requested slot in the slot list. By loading the "set" # command with multiple copies, we guarantee that if the slot is # found, we can look both forward and backward without running # off the end. Putting $cleanslot at the end allows us to find # that slot since it is not in $slot_list. get_slot_list set x $slot_list $slot_list $slot_list $cleanslot shift # get rid of the "x" prev_slot=$1 shift while [ $# -gt 0 ]; do if [ $1 -eq $find_slot ]; then break fi prev_slot=$1 shift done if [ $# -le 0 ]; then if [ $find_slot -ge $firstslot -a $find_slot -le $lastslot ]; then Exit 2 \ `_ ''` \ `_ 'Cannot find a tape in slot %s' "$find_slot "` return $? # in case we are internal else Exit 2 \ `_ ''` \ `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"` return $? # in case we are internal fi fi # Determine the slot to load. case $whichslot in next|advance) shift loadslot=$1 ;; prev) loadslot=$prev_slot ;; *) loadslot=$find_slot esac # If the desired slot is already loaded, we are done. Only update # current slot if this is not the cleaning slot. get_loaded_info if [ $loadslot = $loadedslot ]; then if [ $loadslot -ne $cleanslot ]; then rm -f $slotfile echo $loadslot > $slotfile fi Exit 0 "$loadedslot" "$rawtape" return $? # in case we are internal fi if [ $loadedslot -eq -2 ]; then Exit 0 "$loadedslot" "$rawtape" return $? # in case we are internal fi # If we are loading the cleaning tape, bump the cleaning count # and reset the access count. Otherwise, bump the access count # and see if it is time to do a cleaning. if [ $loadslot = $cleanslot ]; then rm -f $cleanfile $accessfile expr $cleancount + 1 > $cleanfile echo 0 > $accessfile else rm -f $accessfile expr $accesscount + 1 > $accessfile if [ $autoclean -ne 0 -a $accesscount -gt $autocleancount ] then internal_call=`expr $internal_call + 1` loadslot clean > /dev/null 2>&1 status=$? internal_call=`expr $internal_call - 1` if [ $status -ne 0 ]; then Exit $status "$loadslot" "$exit_answer" return $? # in case we are internal fi # Slot $cleanslot might contain an ordinary tape # rather than a cleaning tape. A cleaning tape # *MIGHT* auto-eject; an ordinary tape does not. # We therefore have to read the status again to # check what actually happened. mtx_status_valid=0 get_loaded_info fi fi # Unload whatever tape is in the drive. internal_call=`expr $internal_call + 1` eject > /dev/null 2>&1 status=$? internal_call=`expr $internal_call - 1` if [ $status -gt 1 ]; then Exit $status "$exit_slot" "$exit_answer" return $? # in case we are internal fi # If we were doing an "advance", we are done. if [ $whichslot = advance ]; then if [ $loadslot -ne $cleanslot ]; then rm -f $slotfile echo $loadslot > $slotfile fi Exit 0 "$loadslot" "/dev/null" return $? # in case we are internal fi # Load the tape, finally! Log `_ "LOADSLOT -> loading tape from slot %s to drive %s (%s)" "$loadslot" "$driveslot" "$tape"` result=`Run $MTX load $loadslot $driveslot 2>&1` status=$? Log `_ ' -> status %s, result "%s"' "$status" "$result"` mtx_status_valid=0 if [ $status -ne 0 ]; then Exit 2 "$loadslot" "$result" return $? # in case we are internal fi ### # Cleaning tapes never go "ready", so instead we just sit here # for "long enough" (as determined empirically by the user), # then return success. ### if [ $loadslot -eq $cleanslot ]; then Run sleep $cleancycle Exit 0 "$loadslot" "$rawtape" return $? # in case we are internal fi ### # Wait for the drive to go online. ### waittime=0 ready=0 sleep $initial_poll_delay while [ $waittime -lt $max_drive_wait ]; do amdevcheck_status $tape if [ $? -eq 0 ]; then ready=1 break fi sleep $poll_drive_ready waittime=`expr $waittime + $poll_drive_ready` done if [ $ready -eq 0 ]; then Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds: %s' "$max_drive_wait" "$amdevcheck_message"` return $? # in case we are internal fi if [ $loadslot -ne $cleanslot ]; then rm -f $slotfile echo $loadslot > $slotfile fi Exit 0 "$loadslot" "$rawtape" return $? # in case we are internal } ### # Return information about how the changer is configured and the current # state of the robot. ### info() { test -n "$DEBUG" && set -x get_loaded_info get_slot_list Log `_ 'INFO -> first slot: %s' "$firstslot"` LogAppend `_ ' -> current slot: %s' "$currentslot"` LogAppend `_ ' -> loaded slot: %s' "$loadedslot"` LogAppend `_ ' -> last slot: %s' "$lastslot"` LogAppend `_ ' -> slot list: %s' "$slot_list"` LogAppend `_ ' -> can go backwards: 1'` LogAppend `_ ' -> havereader: %s' "$havereader"` ### # Check if a barcode reader is configured or not. If so, it # passes the 4th item in the echo back to amtape signifying it # can search based on barcodes. ### reader= if [ $havereader -eq 1 ]; then reader=1 fi if [ $currentslot -lt $firstslot -o $currentslot -gt $lastslot ]; then currentslot=$firstslot # what "current" will get fi numslots=`expr $lastslot - $firstslot + 1` Exit 0 "$currentslot" "$numslots 1 $reader" return $? # in case we are internal } ### # Adds the label and barcode for the currently loaded tape to the # barcode file. Return an error if the database is messed up. ### addlabel() { test -n "$DEBUG" && set -x if [ $# -lt 1 ]; then Exit 2 `_ ''` `_ 'Missing -label argument'` return $? # in case we are internal fi tapelabel=$1 get_loaded_info if [ $loadedslot -lt 0 ]; then Exit 1 `_ ''` `_ 'No tape currently loaded'` return $? # in case we are internal fi record_label_in_slot "$tapelabel" "$loadedslot" if [ $havereader -eq 0 ]; then Exit 0 "$loadedslot" "$rawtape" # that's all we needed return $? # in case we are internal fi if [ -z "$loadedbarcode" ]; then Exit 1 `_ ''` `_ 'No barcode found for tape %s.' $tapelabel` return $? # in case we are internal fi Log `_ 'LABEL -> Adding label "%s" with barcode "%s" for slot %s into %s' "$tapelabel" "$loadedbarcode" "$loadedslot" "$labelfile"` read_labelfile "$tapelabel" "$loadedbarcode" < $labelfile if [ $labelfile_entry_found -ne 0 ]; then lf_val= if [ "$labelfile_barcode" != "$loadedbarcode" ]; then lf_type=label lf_val=$tapelabel val_type=barcode old_val=$labelfile_barcode new_val=$loadedbarcode elif [ "$labelfile_label" != "$tapelabel" ]; then lf_type=barcode lf_val=$loadedbarcode val_type=label old_val=$labelfile_label new_val=$tapelabel fi if [ -n "$lf_val" ]; then if [ "$val_type" = "barcode" ]; then remove_from_labelfile $labelfile "" "$old_val" else remove_from_labelfile $labelfile "$old_val" "" fi echo "$tapelabel $loadedbarcode" >> $labelfile LogAppend `_ ' -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"` else LogAppend `_ " -> already synced"` fi else echo "$tapelabel $loadedbarcode" >> $labelfile LogAppend `_ ' -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"` fi Exit 0 "$loadedslot" "$rawtape" return $? # in case we are internal } ### # Look for a label in the barcode file. If found, locate the slot it's # in by looking for the barcode in the mtx output, then load that tape. ### searchtape() { test -n "$DEBUG" && set -x if [ $# -lt 1 ]; then Exit 2 `_ ''` `_ 'Missing -search argument'` return $? # in case we are internal fi tapelabel=$1 if [ $havereader -eq 0 ]; then Exit 2 `_ ''` `_ 'Not configured with barcode reader'` return $? # in case we are internal fi Log `_ 'SEARCH -> Hunting for label "%s"' "$tapelabel"` read_labelfile "$tapelabel" "" < $labelfile if [ $labelfile_entry_found -eq 0 ]; then LogAppend `_ ' -> !!! label "%s" not found in %s !!!' "$tapelabel" "$labelfile"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 1 \ `_ ''` \ `_ '%s: label "%s" not found in %s' "$tapelabel" "$tapelabel" "$labelfile"` return $? # in case we are internal fi LogAppend `_ ' -> barcode is "%s"' "$labelfile_barcode"` get_mtx_status if [ $mtx_status_valid -eq 0 ]; then Exit 2 \ `_ ''` \ `head -1 $mtx_status` return $? fi foundslot=`sed -n ' /VolumeTag *= *'$labelfile_barcode' *$/ { s/.*Storage Element \([0-9][0-9]*\).*/\1/p q } ' < $mtx_status` LogAppend `_ ' -> foundslot is %s' "$foundslot"` if [ -z "$foundslot" ]; then LogAppend `_ 'ERROR -> !!! Could not find slot for barcode "%s"!!!' "$labelfile_barcode"` LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` Exit 1 \ `_ ''` \ `_ 'barcode "%s" not found in mtx status output' "$labelfile_barcode"` return $? # in case we are internal fi # Call loadslot without doing it as an internal and let it finish # things up. loadslot $foundslot # NOTREACHED Exit 2 `_ ''` `_ 'searchtape: should not get here'` return $? # in case we are internal } ### # Program invocation begins here ### if [ $# -lt 1 ]; then Exit 2 `_ ''` `_ 'Usage: %s -command args' "$myname"` fi cmd=$1 shift case "$cmd" in -slot) loadslot "$@" ;; -info) info "$@" ;; -reset) reset "$@" ;; -eject) eject "$@" ;; -label) addlabel "$@" ;; -search) searchtape "$@" ;; -clean) loadslot clean ;; *) Exit 2 `_ ''` `_ 'unknown option: %s' "$cmd"` ;; esac Exit 2 `_ ''` `_ '%s: should not get here' "$myname"` amanda-3.3.6/changer-src/chg-disk.sh0000664000076400007640000001737112357250001020665 0ustar00martineamartinea00000000000000#! @SHELL@ # # Amanda, The Advanced Maryland Automatic Network Disk Archiver # Copyright (c) 1991-1999 University of Maryland at College Park # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # All Rights Reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of U.M. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. U.M. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Author: Jean-Christian SIMONETTI, System and Network Engineer # Wanadoo Portails # Sophia Antipolis, France # # This changer script is based on a directory structure like: # slot_root_dir -| # |- info # |- data -> slot1 # |- slot1 # |- slot2 # |- ... # |- slotn # where 'slot_root_dir' is the tapedev 'file:xxx' parameter and 'n' # is the LASTSLOT value of your changerfile config file. If LASTSLOT is # not defined, the value of the tapecycle parameter is used. # # To use this driver, just put the line 'tpchanger "chg-disk"' in your # amanda.conf. # # Example of use (amanda.conf): # --- cut here --- # tapedev "file:/BACKUP2/slots/" # changerdev "/dev/null" # changerfile "chg-disk" # tpchanger "chg-disk" # changerfile "/usr/local/amanda/etc/changer" # tapetype HARD-DISK # define tapetype HARD-DISK { # length 12000 mbytes # } # --- cut here --- # # Example changerfile (chg-disk.conf): # --- cut here --- # LASTSLOT=12 # --- cut here --- # # The number of slot is equal to your LASTSLOT or tapecycle. # You must create the slots and data directory. # prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" amlibexecdir="@amlibexecdir@" . "${amlibexecdir}/amanda-sh-lib.sh" # add sbin and ucb dirs PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" export PATH MYNAME=$0 TAPE=`amgetconf tapedev` if test X"$TAPE" = X""; then echo `_ ' tapedev not specified in amanda.conf.'` exit 2 fi SLOTDIR=`echo $TAPE | sed 's/^file://'` isinteger() { # should be exactly one arg [ $# = 1 ] || return 1 # if arg is null, no expr needed [ "${1}" = '' ] && return 1 # expr will return 0 on match expr "$1" : '[0-9][0-9]*$' > /dev/null 2>&1 } # Need rwx access to the virtual tape itself. if ! test -d $SLOTDIR; then echo `_ ' Virtual-tape directory %s does not exist.' "$SLOTDIR"` exit 2 fi if ! test -w $SLOTDIR; then echo `_ ' Virtual-tape directory %s is not writable.' "$SLOTDIR"` exit 2 fi # need rwx access to directory of changer file CHANGERFILE=`amgetconf changerfile` conf_match=`expr "$CHANGERFILE" : .\*\.conf\$` if [ $conf_match -ge 6 ]; then CONFIGFILE=$CHANGERFILE CHANGERFILE=`echo $CHANGERFILE | sed 's/.conf$//g'` else CONFIGFILE=$CHANGERFILE.conf fi CFDir=`dirname ${CHANGERFILE}` [ -d ${CFDir} -a -r ${CFDir} -a -w ${CFDir} -a -x ${CFDir} ] || { echo `_ " %s: need 'rwx' access to '%s'" "$MYNAME" "$CFDir"` ; exit 2 ; } # check or create changer metadata files ACCESSFILE=$CHANGERFILE-access [ -f $ACCESSFILE -a -r $ACCESSFILE -a -w $ACCESSFILE ] || echo 0 > $ACCESSFILE || { echo `_ " %s: could not access or create '%s'" "$MYNAME" "$ACCESSFILE"` ; exit 2; } CLEANFILE=$CHANGERFILE-clean [ -f $CLEANFILE -a -r $CLEANFILE -a -w $CLEANFILE ] || echo 0 > $CLEANFILE || { echo `_ " %s: could not access or create '%s'" "$MYNAME" "$CLEANFILE"` ; exit 2 ; } SLOTFILE=$CHANGERFILE-slot [ -f $SLOTFILE -a -r $SLOTFILE -a -w $SLOTFILE ] || echo 0 > $SLOTFILE || { echo `_ " %s: could not access or create '%s'" "$MYNAME" "$SLOTFILE"` ; exit 2; } # read and check metadata ACCESSCOUNT=`cat $ACCESSFILE` isinteger $ACCESSCOUNT || { ACCESSCOUNT=0 ; echo 0 > $ACCESSFILE ; } CLEANCOUNT=`cat $CLEANFILE` isinteger $CLEANCOUNT || { CLEANCOUNT=0 ; echo 0 > $CLEANFILE ; } FIRSTSLOT=1 LASTSLOT=`amgetconf tapecycle` if test -r $CONFIGFILE; then . $CONFIGFILE fi CURSLOT=0 CLEANSLOT=$LASTSLOT NSLOT=`expr $LASTSLOT - $FIRSTSLOT + 1` load() { WHICHSLOT=$1; # unload should have been called, but just in case ... [ -h $SLOTDIR/data ] && unload ln -s $SLOTDIR/slot$WHICHSLOT $SLOTDIR/data echo $WHICHSLOT > $SLOTFILE } unload() { rm -f $SLOTDIR/data echo "0" > $SLOTFILE } readstatus() { CURSLOT=`cat $SLOTFILE` } loadslot() { WHICHSLOT=$1 TYPE=string # default if not numeric isinteger $WHICHSLOT && TYPE=digit readstatus NEWSLOT=0 if [ $WHICHSLOT = "current" ]; then if [ $CURSLOT -le 0 ]; then load $FIRSTSLOT echo "$FIRSTSLOT $TAPE" exit 0 else echo "$CURSLOT $TAPE" exit 0 fi elif [ $WHICHSLOT = "next" -o $WHICHSLOT = "advance" ]; then NEWSLOT=`expr $CURSLOT + 1` [ $NEWSLOT -gt $LASTSLOT ] && NEWSLOT=$FIRSTSLOT elif [ $WHICHSLOT = "prev" ]; then NEWSLOT=`expr $CURSLOT - 1` [ $NEWSLOT -lt $FIRSTSLOT ] && NEWSLOT=$LASTSLOT elif [ $WHICHSLOT = "first" ]; then NEWSLOT=$FIRSTSLOT elif [ $WHICHSLOT = "last" ]; then NEWSLOT=$LASTSLOT elif [ $TYPE = "digit" ]; then if [ $WHICHSLOT -ge $FIRSTSLOT -a $WHICHSLOT -le $LASTSLOT ]; then NEWSLOT=$WHICHSLOT else echo `_ '%s illegal slot' "$WHICHSLOT"` exit 1 fi elif [ $WHICHSLOT = "clean" ]; then NEWSLOT=$CLEANSLOT else echo `_ '%s illegal request' "$WHICHSLOT"` exit 1 fi if [ $NEWSLOT = $CURSLOT ]; then echo "$CURSLOT $TAPE" exit 0 fi if [ $NEWSLOT = $CLEANSLOT ]; then expr ${CLEANCOUNT:=0} + 1 > $CLEANFILE echo 0 > $ACCESSFILE else expr ${ACCESSCOUNT:=0} + 1 > $ACCESSFILE if [ $ACCESSCOUNT -gt $LASTSLOT ]; then $MYNAME -slot clean >/dev/null fi fi readstatus if [ $CURSLOT -ne 0 ]; then unload fi if [ $WHICHSLOT = "advance" ]; then echo "$NEWSLOT /dev/null" exit 0 fi load $NEWSLOT echo "$NEWSLOT $TAPE" exit 0 } info() { readstatus echo "$CURSLOT $NSLOT 1" exit 0 } reset() { readstatus [ $CURSLOT -gt 0 ] && unload load $FIRSTSLOT echo "$FIRSTSLOT $tape" exit 0 } eject() { readstatus if [ $CURSLOT -le 0 ]; then echo `_ '0 Drive was not loaded'` exit 1 else unload echo $CURSLOT exit 0 fi } while [ $# -ge 1 ];do case $1 in -slot) shift loadslot $* ;; -clean) shift loadslot clean ;; -current) shift loadslot current ;; -next) shift loadslot next ;; -advance) shift loadslot advance ;; -prev) shift loadslot prev ;; -first) shift loadslot first ;; -last) shift loadslot last ;; -info) shift info ;; -reset) shift reset ;; -eject) shift eject ;; *) echo `_ ' Unknown option %s' "$1"` exit 2 ;; esac done amanda-3.3.6/changer-src/chg-lib.sh.in0000664000076400007640000001007612357250001021101 0ustar00martineamartinea00000000000000################################################################################ # You may want to customize these values ################################################################################ # These are the defaults discovered by configure when Amanda was installed. # They can be overridden here, or by by 'mt_binary' and 'mtx_binary', # respectively, in the changerfile (currently only for chg-zd-mtx.sh and # chg-manual.sh). MT=@MT@ MTX=@MTX@ # This is the flag used to specify a device filename to 'mt', usually '-f' MTF=@MT_FILE_FLAG@ ################################################################################ # No user-level customization should be required beyond this point. ################################################################################ prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" libexecdir="@libexecdir@" amlibexecdir="@amlibexecdir@" . "${amlibexecdir}/amanda-sh-lib.sh" #### # Eponymous functions to access various amanda apps # TODO: move to amanda-sh-lib.sh amgetconf() { "${sbindir}/amgetconf" "${@}" } amdevcheck() { "${sbindir}/amdevcheck" "${@}" } # This function tries to find a useable mt binary. If a fully-qualified path # was provided at configure time or via a config file, we check that it # exists and is executable. If an incomplete path was specified (e.g., "mt"), # we ask the shell to search the path. Returns 0 on success, 1 on failure. try_find_mt() { # Only do this once. if test -n $mt_found; then return 0 fi if test -z $MT; then MT=mt fi if "`echo $MT | dd bs=1 count=1`" = "/"; then if ! test -f "${MT}"; then echo `_ "mt binary at '%s' not found" "$MTX"` return 1 fi if ! test -x "${MT}"; then echo `_ "mt binary at '%s' is not executable" "$MTX"` return 1 fi else # try running it to see if the shell can find it "$MT" >/dev/null 2>/dev/null if test $? -eq 127 -o $? -eq 126; then echo `_ "Could not run mt binary at '%s'" "$MTX"` return 1 fi fi mt_found=yes return 0 } # This function strips the tape: from the front of device names. # Capture its output with ``. tape_device_filename() { if echo "$1"|grep '^tape:' >/dev/null; then echo "$1" | sed 's/^tape://' else if echo "$1"|grep '^/' >/dev/null; then echo "$1" fi fi } # Invoke amdevcheck to determine whether the device is ready for use. # # @return 0 if a tape is loaded or error # @return 1 if a tape is tape offline or busy # # @side-effect: $amdevcheck_message is the contents of all MESSAGE lines from # amdevcheck, suitable for use in higher-level error messages amdevcheck_status() { amdevcheck_message= local amdevcheck_output=`amdevcheck . $@` local amdevcheck_status=$? test "$amdevcheck_status" -ne 0 && return 0 # extract any messages amdevcheck_message=`echo "$amdevcheck_output" | sed -n -e '/^MESSAGE /{' -e 's/^MESSAGE //' -e 'p' -e 'q' -e '}'` # Return 1 if it's possible that the device is offline or busy; if the device cannot # distinguish this state from an error condition, then our caller will just have to # time out if echo "$amdevcheck_output" | $EGREP "VOLUME_MISSING|DEVICE_BUSY" > /dev/null; then return 1 else return 0 fi } # This attempts to eject a device using whatever system tools are available. # At the moment, that means mt for tapes, and nothing otherwise, but might # be extended at some later time. try_eject_device() { if echo "$1" | grep '^tape:' > /dev/null; then try_eject_device_tape="`echo \"$1\" | cut -b6-`" elif echo "$1" | grep -v : > /dev/null; then try_eject_device_tape="$1" else try_eject_device_tape= fi if test -n "$try_eject_device_tape"; then if try_find_mt; then $MT $MTF "$try_eject_device_tape" offline fi else # Technically we failed to eject the device, but we presume that's # because it doesn't require ejection. return 0 fi } amanda-3.3.6/Makefile.in0000664000076400007640000021753712357750237016537 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/vars.am $(top_srcdir)/configure \ AUTHORS ChangeLog INSTALL NEWS @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive 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)$(pkgdatadir)" DATA = $(pkgdata_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = . gnulib config common-src amar-src amandad-src \ xfer-src ndmp-src client-src application-src device-src \ server-src changer-src recover-src oldrecover-src amplot perl \ po man example packaging installcheck 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__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 distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.10 foreign SUFFIXES = EXTRA_DIST = $(SNAPSHOT_STAMP) $(pkgdata_DATA) autogen contrib/README \ contrib/dbbackup.README contrib/dbbackup.ksh \ contrib/dbbackup.sql contrib/dbbackup.tcl contrib/mkamandisk \ contrib/set_prod_link.pl contrib/gsc/README \ contrib/gsc/cfggsc.c contrib/gsc/defgsc.c contrib/gsc/gsc.add \ contrib/gsc/gscdd.c contrib/gsc/gscdds.h contrib/gsc/makefile \ contrib/gsc/tstinq.c contrib/gsc/ucfggsc.c \ patches/regex-3.6alpha.patch patches/samba-largefs.patch \ patches/tar-1.12.patch UPGRADING DEVELOPING VERSION \ FULL_VERSION BUILT_SOURCES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done ACLOCAL_AMFLAGS = --force -I config -I . -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive @WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src application-src @WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src @WANT_RECOVER_TRUE@RECOVER_SUBDIRS = recover-src oldrecover-src @WANT_AMPLOT_TRUE@PLOT_SUBDIRS = amplot @WANT_NDMP_TRUE@NDMP_SUBDIRS = ndmp-src # order is significant, don't change it arbitrarily SUBDIRS = . \ gnulib \ config \ common-src \ amar-src \ amandad-src \ xfer-src \ $(NDMP_SUBDIRS) \ $(TAPE_SUBDIRS) \ $(CLIENT_SUBDIRS) \ $(SERVER_SUBDIRS) \ $(RESTORE_SUBDIRS) \ $(RECOVER_SUBDIRS) \ $(PLOT_SUBDIRS) \ perl \ po \ man \ example \ packaging \ installcheck pkgdata_DATA = \ ReleaseNotes \ COPYRIGHT \ NEWS \ ChangeLog CONFIG_STATUS = config.status # ensure that configure gets the right arguments for distcheck; this keeps the # user/group through to the distcheck, rather than defaulting back to 'amanda'. DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-amperldir --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes CLOBBER_MY_CONFIG=OK all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am: $(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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || 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)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-pkgdataDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-data-am \ install-exec-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-exec-local install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgdataDATA 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-recursive uninstall uninstall-am \ uninstall-pkgdataDATA installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" FULL_VERSION: VERSION $(srcdir)/config/set_full_version $(top_srcdir) config.status: FULL_VERSION libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck # empty out the installperms manifest file when we start install-exec-local: installperms-init install-data-local: installperms-init $(CONFIG_STATUS): $(SNAPSHOT_STAMP) SNAPSHOT: : SNAPSHOT file was removed, will reconfigure... lint: (cd amandad-src; make lint) (cd changer-src; make lint) (cd client-src; make lint) (cd common-src; make lint) (cd oldrecover-src; make lint) (cd recover-src; make lint) (cd server-src; make lint) (cd xfer-src; make lint) dist-hook: find $(distdir)/. -name '*.test.c' -exec rm {} \; # 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: amanda-3.3.6/client-src/0000775000076400007640000000000012357750430016511 5ustar00martineamartinea00000000000000amanda-3.3.6/client-src/Makefile.in0000664000076400007640000024431312357750240020564 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda client programs. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) amlibexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \ rundump$(EXEEXT) runtar$(EXEEXT) selfcheck$(EXEEXT) \ sendbackup$(EXEEXT) sendsize$(EXEEXT) @WANT_SAMBA_TRUE@am__append_2 = findpass.c EXTRA_PROGRAMS = $(am__EXEEXT_1) subdir = client-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \ "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" LTLIBRARIES = $(amlib_LTLIBRARIES) libamclient_la_DEPENDENCIES = ../common-src/libamanda.la am__libamclient_la_SOURCES_DIST = amandates.c getfsent.c unctime.c \ client_util.c findpass.c @WANT_SAMBA_TRUE@am__objects_1 = findpass.lo am_libamclient_la_OBJECTS = amandates.lo getfsent.lo unctime.lo \ client_util.lo $(am__objects_1) libamclient_la_OBJECTS = $(am_libamclient_la_OBJECTS) libamclient_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamclient_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = getfsent$(EXEEXT) PROGRAMS = $(amlibexec_PROGRAMS) calcsize_SOURCES = calcsize.c calcsize_OBJECTS = calcsize.$(OBJEXT) calcsize_LDADD = $(LDADD) calcsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la am_getfsent_OBJECTS = getfsent.test.$(OBJEXT) getfsent_OBJECTS = $(am_getfsent_OBJECTS) getfsent_LDADD = $(LDADD) getfsent_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la killpgrp_SOURCES = killpgrp.c killpgrp_OBJECTS = killpgrp.$(OBJEXT) killpgrp_LDADD = $(LDADD) killpgrp_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la noop_SOURCES = noop.c noop_OBJECTS = noop.$(OBJEXT) noop_LDADD = $(LDADD) noop_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la rundump_SOURCES = rundump.c rundump_OBJECTS = rundump.$(OBJEXT) rundump_LDADD = $(LDADD) rundump_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la runtar_SOURCES = runtar.c runtar_OBJECTS = runtar.$(OBJEXT) runtar_LDADD = $(LDADD) runtar_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la selfcheck_SOURCES = selfcheck.c selfcheck_OBJECTS = selfcheck.$(OBJEXT) selfcheck_LDADD = $(LDADD) selfcheck_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la am_sendbackup_OBJECTS = sendbackup.$(OBJEXT) sendbackup-dump.$(OBJEXT) \ sendbackup-gnutar.$(OBJEXT) sendbackup_OBJECTS = $(am_sendbackup_OBJECTS) sendbackup_LDADD = $(LDADD) sendbackup_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la sendsize_SOURCES = sendsize.c sendsize_OBJECTS = sendsize.$(OBJEXT) sendsize_LDADD = $(LDADD) sendsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../amandad-src/libamandad.la ../common-src/libamanda.la \ ../gnulib/libgnu.la SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamclient_la_SOURCES) calcsize.c $(getfsent_SOURCES) \ killpgrp.c noop.c rundump.c runtar.c selfcheck.c \ $(sendbackup_SOURCES) sendsize.c DIST_SOURCES = $(am__libamclient_la_SOURCES_DIST) calcsize.c \ $(getfsent_SOURCES) killpgrp.c noop.c rundump.c runtar.c \ selfcheck.c $(sendbackup_SOURCES) sendsize.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log *.test.c # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ $(SCRIPTS_INCLUDE) $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/amandad-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) amlib_LTLIBRARIES = libamclient.la amlibexec_SCRIPTS_SHELL = patch-system sbin_SCRIPTS_PERL = amdump_client SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) SCRIPTS_SHELL = $(amlibexec_SCRIPTS_SHELL) sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_SHELL) libamclient_la_SOURCES = amandates.c getfsent.c unctime.c \ client_util.c $(am__append_2) libamclient_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamclient_la_LIBADD = ../common-src/libamanda.la ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ libamclient.la \ ../amandad-src/libamandad.la \ ../common-src/libamanda.la \ ../gnulib/libgnu.la # these are used for testing only: TEST_PROGS = getfsent sendbackup_SOURCES = sendbackup.c sendbackup.h \ sendbackup-dump.c sendbackup-gnutar.c noinst_HEADERS = amandates.h getfsent.h \ findpass.h client_util.h @WANT_SETUID_CLIENT_TRUE@INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \ @WANT_SETUID_CLIENT_TRUE@ calcsize killpgrp rundump runtar getfsent_SOURCES = getfsent.test.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu client-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu client-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || 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)$(amlibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \ } uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \ done clean-amlibLTLIBRARIES: -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libamclient.la: $(libamclient_la_OBJECTS) $(libamclient_la_DEPENDENCIES) $(EXTRA_libamclient_la_DEPENDENCIES) $(libamclient_la_LINK) -rpath $(amlibdir) $(libamclient_la_OBJECTS) $(libamclient_la_LIBADD) $(LIBS) install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || 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)$(amlibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files clean-amlibexecPROGRAMS: @list='$(amlibexec_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 calcsize$(EXEEXT): $(calcsize_OBJECTS) $(calcsize_DEPENDENCIES) $(EXTRA_calcsize_DEPENDENCIES) @rm -f calcsize$(EXEEXT) $(LINK) $(calcsize_OBJECTS) $(calcsize_LDADD) $(LIBS) getfsent$(EXEEXT): $(getfsent_OBJECTS) $(getfsent_DEPENDENCIES) $(EXTRA_getfsent_DEPENDENCIES) @rm -f getfsent$(EXEEXT) $(LINK) $(getfsent_OBJECTS) $(getfsent_LDADD) $(LIBS) killpgrp$(EXEEXT): $(killpgrp_OBJECTS) $(killpgrp_DEPENDENCIES) $(EXTRA_killpgrp_DEPENDENCIES) @rm -f killpgrp$(EXEEXT) $(LINK) $(killpgrp_OBJECTS) $(killpgrp_LDADD) $(LIBS) noop$(EXEEXT): $(noop_OBJECTS) $(noop_DEPENDENCIES) $(EXTRA_noop_DEPENDENCIES) @rm -f noop$(EXEEXT) $(LINK) $(noop_OBJECTS) $(noop_LDADD) $(LIBS) rundump$(EXEEXT): $(rundump_OBJECTS) $(rundump_DEPENDENCIES) $(EXTRA_rundump_DEPENDENCIES) @rm -f rundump$(EXEEXT) $(LINK) $(rundump_OBJECTS) $(rundump_LDADD) $(LIBS) runtar$(EXEEXT): $(runtar_OBJECTS) $(runtar_DEPENDENCIES) $(EXTRA_runtar_DEPENDENCIES) @rm -f runtar$(EXEEXT) $(LINK) $(runtar_OBJECTS) $(runtar_LDADD) $(LIBS) selfcheck$(EXEEXT): $(selfcheck_OBJECTS) $(selfcheck_DEPENDENCIES) $(EXTRA_selfcheck_DEPENDENCIES) @rm -f selfcheck$(EXEEXT) $(LINK) $(selfcheck_OBJECTS) $(selfcheck_LDADD) $(LIBS) sendbackup$(EXEEXT): $(sendbackup_OBJECTS) $(sendbackup_DEPENDENCIES) $(EXTRA_sendbackup_DEPENDENCIES) @rm -f sendbackup$(EXEEXT) $(LINK) $(sendbackup_OBJECTS) $(sendbackup_LDADD) $(LIBS) sendsize$(EXEEXT): $(sendsize_OBJECTS) $(sendsize_DEPENDENCIES) $(EXTRA_sendsize_DEPENDENCIES) @rm -f sendsize$(EXEEXT) $(LINK) $(sendsize_OBJECTS) $(sendsize_LDADD) $(LIBS) install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(amlibexecdir)'; $(am__uninstall_files_from_dir) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; 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 \ 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)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calcsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findpass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfsent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfsent.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/killpgrp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rundump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selfcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendbackup-dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendbackup-gnutar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendbackup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unctime.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @SYNTAX_CHECKS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-amlibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \ install-sbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool ctags dist-hook distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-amlibLTLIBRARIES install-amlibexecPROGRAMS \ install-amlibexecSCRIPTS install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ @SYNTAX_CHECKS_TRUE@ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ @SYNTAX_CHECKS_TRUE@ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ @SYNTAX_CHECKS_TRUE@ rm $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ else \ @SYNTAX_CHECKS_TRUE@ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ @SYNTAX_CHECKS_TRUE@ fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-perl # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-shell # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< lint: @ for p in $(amlibexec_PROGRAMS); do \ p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamclient_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ done; \ exit 0 %.test.c: $(srcdir)/%.c echo '#define TEST' >$@ echo '#include "$<"' >>$@ # 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: amanda-3.3.6/client-src/amdump_client.pl0000664000076400007640000001153412357250002021661 0ustar00martineamartinea00000000000000#! @PERL@ # Copyright (c) 2010-2013 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use lib '@amperldir@'; use strict; use warnings; use Getopt::Long; use Symbol; use IPC::Open3; use Amanda::Util qw( :constants ); use Amanda::Config qw( :init :getconf ); use Amanda::Paths; use Amanda::Util qw ( match_disk ); use Amanda::Debug qw( debug ); Amanda::Util::setup_application("amdump_client", "client", $CONTEXT_CMDLINE); my $config; my $config_overrides = new_config_overrides($#ARGV+1); my @config_overrides_opts; debug("Arguments: " . join(' ', @ARGV)); Getopt::Long::Configure(qw{bundling}); GetOptions( 'version' => \&Amanda::Util::version_opt, 'config=s' => sub { $config = $_[1]; }, 'o=s' => sub { push @config_overrides_opts, "-o" . $_[1]; add_config_override_opt($config_overrides, $_[1]); }, ) or usage(); if (@ARGV < 1) { die "USAGE: amdump_client [--config ] [list|dump|check] "; } my $cmd = $ARGV[0]; set_config_overrides($config_overrides); config_init($CONFIG_INIT_CLIENT, undef); $config = getconf($CNF_CONF) if !defined $config; print "config: $config\n"; config_init($CONFIG_INIT_CLIENT | $CONFIG_INIT_EXPLICIT_NAME | $CONFIG_INIT_OVERLAY, $config); my ($cfgerr_level, @cfgerr_errors) = config_errors(); if ($cfgerr_level >= $CFGERR_WARNINGS) { config_print_errors(); if ($cfgerr_level >= $CFGERR_ERRORS) { die "Errors processing config file"; } } #Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log); Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER); my $amservice = $sbindir . '/amservice'; my $amdump_server = getconf($CNF_AMDUMP_SERVER); my $auth = getconf($CNF_AUTH); my @cmd = ($amservice, '-f', '/dev/null', @config_overrides_opts, '-s', $amdump_server, $auth, 'amdumpd'); debug("cmd: @cmd"); my $amservice_out; my $amservice_in; my $err = Symbol::gensym; my $pid = open3($amservice_in, $amservice_out, $err, @cmd); my @disks; debug("send: CONFIG $config"); print {$amservice_in} "CONFIG $config\n"; if ($cmd eq 'list') { debug("send: LIST"); print {$amservice_in} "LIST\n"; get_list(1); } elsif ($cmd eq 'dump') { # check if diskname on the command line if ($ARGV[1]) { # get the list of dle debug ("send: LIST"); print {$amservice_in} "LIST\n"; get_list(0); #find the diskname that match for (my $i=1; $i <= $#ARGV; $i++) { for my $diskname (@disks) { if (match_disk($ARGV[$i], $diskname)) { debug("send: DISK " . Amanda::Util::quote_string($diskname)); print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n"; my $a = <$amservice_out>; print if ($a !~ /^DISK /) } } } } debug("send: DUMP"); print {$amservice_in} "DUMP\n"; get_server_data(); } elsif ($cmd eq 'check') { # check if diskname on the command line if ($ARGV[1]) { # get the list of dle debug ("send: LIST"); print {$amservice_in} "LIST\n"; get_list(0); #find the diskname that match for (my $i=1; $i <= $#ARGV; $i++) { for my $diskname (@disks) { if (match_disk($ARGV[$i], $diskname)) { debug("send: DISK " . Amanda::Util::quote_string($diskname)); print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n"; my $a = <$amservice_out>; print if ($a != /^DISK /) } } } } debug("send: CHECK"); print {$amservice_in} "CHECK\n"; get_server_data(); } else { usage(); } debug("send: END"); print {$amservice_in} "END\n"; sub get_list { my $verbose = shift; while (<$amservice_out>) { return if /^CONFIG/; return if /^ENDLIST/; print if $verbose; chomp; push @disks, Amanda::Util::unquote_string($_); } } sub get_server_data { while (<$amservice_out>) { if (/^ENDDUMP/) { print "The backup is finished\n"; return; } if (/^ENDCHECK/) { print "The check is finished\n"; return; } print; return if /^CONFIG/; return if /^BUSY/; } } sub usage { print STDERR "USAGE: amdump_client [--config ] [list|dump|check] "; } Amanda::Util::finish_application(); exit; amanda-3.3.6/client-src/selfcheck.c0000664000076400007640000010624712357250002020604 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park */ /* * $Id: selfcheck.c 10421 2008-03-06 18:48:30Z martineau $ * * do self-check and send back any error messages */ #include "amanda.h" #include "fsusage.h" #include "getfsent.h" #include "amandates.h" #include "clock.h" #include "util.h" #include "pipespawn.h" #include "amfeatures.h" #include "client_util.h" #include "conffile.h" #include "amandad.h" #include "amxml.h" #include "base64.h" #ifdef SAMBA_CLIENT #include "findpass.h" #endif int need_samba=0; int need_rundump=0; int need_dump=0; int need_restore=0; int need_vdump=0; int need_vrestore=0; int need_xfsdump=0; int need_xfsrestore=0; int need_vxdump=0; int need_vxrestore=0; int need_runtar=0; int need_gnutar=0; int need_compress_path=0; int need_calcsize=0; int need_global_check=0; int program_is_application_api=0; static char *amandad_auth = NULL; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; static g_option_t *g_options = NULL; /* local functions */ int main(int argc, char **argv); static void check_options(dle_t *dle); static void check_disk(dle_t *dle); static void check_overall(void); static int check_file_exist(char *filename); static void check_space(char *dir, off_t kbytes); static void print_platform(void); int main( int argc, char ** argv) { char *line = NULL; char *qdisk = NULL; char *qamdevice = NULL; char *optstr = NULL; char *err_extra = NULL; char *s, *fp; int ch; dle_t *dle; int level; GSList *errlist; am_level_t *alevel; if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("selfcheck-%s\n", VERSION); return (0); } /* initialize */ /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); openbsd_fd_inform(); safe_cd(); set_pname("selfcheck"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); add_amanda_log_handler(amanda_log_stderr); add_amanda_log_handler(amanda_log_syslog); dbopen(DBG_SUBDIR_CLIENT); startclock(); dbprintf(_("version %s\n"), VERSION); g_printf("OK version %s\n", VERSION); print_platform(); if(argc > 2 && strcmp(argv[1], "amandad") == 0) { amandad_auth = stralloc(argv[2]); } config_init(CONFIG_INIT_CLIENT, NULL); /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); /* handle all service requests */ /*@ignore@*/ for(; (line = agets(stdin)) != NULL; free(line)) { /*@end@*/ if (line[0] == '\0') continue; if(strncmp_const(line, "OPTIONS ") == 0) { g_options = parse_g_options(line+8, 1); if(!g_options->hostname) { g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1); gethostname(g_options->hostname, MAX_HOSTNAME_LENGTH); g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0'; } g_printf("OPTIONS "); if(am_has_feature(g_options->features, fe_rep_options_features)) { g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { g_printf("hostname=%s;", g_options->hostname); } g_printf("\n"); fflush(stdout); if (g_options->config) { /* overlay this configuration on the existing (nameless) configuration */ config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); dbrename(get_config_name(), DBG_SUBDIR_CLIENT); } /* check for any config errors now */ if (config_errors(&errlist) >= CFGERR_ERRORS) { char *errstr = config_errors_to_error_string(errlist); g_printf("%s\n", errstr); dbclose(); return 1; } if (am_has_feature(g_options->features, fe_req_xml)) { break; } continue; } dle = alloc_dle(); s = line; ch = *s++; skip_whitespace(s, ch); /* find program name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the program name */ dle->program_is_application_api = 0; if(strcmp(dle->program,"APPLICATION")==0) { dle->program_is_application_api = 1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the program name */ } if(strncmp_const(dle->program, "CALCSIZE") == 0) { skip_whitespace(s, ch); /* find program name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; dle->estimatelist = g_slist_append(dle->estimatelist, GINT_TO_POINTER(ES_CALCSIZE)); } else { dle->estimatelist = g_slist_append(dle->estimatelist, GINT_TO_POINTER(ES_CLIENT)); } skip_whitespace(s, ch); /* find disk name */ if (ch == '\0') { goto err; /* no disk */ } qdisk = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the disk name */ dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { goto err; /* no device or level */ } if(!isdigit((int)s[-1])) { fp = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the device */ qamdevice = stralloc(fp); dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { dle->device = stralloc(dle->disk); qamdevice = stralloc(qdisk); } /* find level number */ if (ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { goto err; /* bad level */ } alevel = g_new0(am_level_t, 1); alevel->level = level; dle->levellist = g_slist_append(dle->levellist, alevel); skip_integer(s, ch); skip_whitespace(s, ch); if (ch && strncmp_const_skip(s - 1, "OPTIONS ", s, ch) == 0) { skip_whitespace(s, ch); /* find the option string */ if(ch == '\0') { goto err; /* bad options string */ } optstr = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the options */ parse_options(optstr, dle, g_options->features, 1); /*@ignore@*/ check_options(dle); check_disk(dle); /*@end@*/ } else if (ch == '\0') { /* check all since no option */ need_samba=1; need_rundump=1; need_dump=1; need_restore=1; need_vdump=1; need_vrestore=1; need_xfsdump=1; need_xfsrestore=1; need_vxdump=1; need_vxrestore=1; need_runtar=1; need_gnutar=1; need_compress_path=1; need_calcsize=1; need_global_check=1; /*@ignore@*/ check_disk(dle); /*@end@*/ } else { goto err; /* bad syntax */ } amfree(qamdevice); } if (g_options == NULL) { g_printf(_("ERROR [Missing OPTIONS line in selfcheck input]\n")); error(_("Missing OPTIONS line in selfcheck input\n")); /*NOTREACHED*/ } if (am_has_feature(g_options->features, fe_req_xml)) { char *errmsg = NULL; dle_t *dles, *dle, *dle_next; dles = amxml_parse_node_FILE(stdin, &errmsg); if (errmsg) { err_extra = errmsg; goto err; } if (merge_dles_properties(dles, 1) == 0) { goto checkoverall; } for (dle = dles; dle != NULL; dle = dle->next) { run_client_scripts(EXECUTE_ON_PRE_HOST_AMCHECK, g_options, dle, stdout); } for (dle = dles; dle != NULL; dle = dle->next) { check_options(dle); run_client_scripts(EXECUTE_ON_PRE_DLE_AMCHECK, g_options, dle, stdout); check_disk(dle); run_client_scripts(EXECUTE_ON_POST_DLE_AMCHECK, g_options, dle, stdout); } for (dle = dles; dle != NULL; dle = dle->next) { run_client_scripts(EXECUTE_ON_POST_HOST_AMCHECK, g_options, dle, stdout); } for (dle = dles; dle != NULL; dle = dle_next) { dle_next = dle->next; free_dle(dle); } } checkoverall: check_overall(); amfree(line); amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; free_g_options(g_options); dbclose(); return 0; err: if (err_extra) { g_printf(_("ERROR [FORMAT ERROR IN REQUEST PACKET %s]\n"), err_extra); dbprintf(_("REQ packet is bogus: %s\n"), err_extra); } else { g_printf(_("ERROR [FORMAT ERROR IN REQUEST PACKET]\n")); dbprintf(_("REQ packet is bogus\n")); } dbclose(); return 1; } static void check_options( dle_t *dle) { if (GPOINTER_TO_INT(dle->estimatelist->data) == ES_CALCSIZE) { need_calcsize=1; } if (strcmp(dle->program,"GNUTAR") == 0) { need_gnutar=1; if(dle->device && dle->device[0] == '/' && dle->device[1] == '/') { if(dle->exclude_file && dle->exclude_file->nb_element > 1) { g_printf(_("ERROR [samba support only one exclude file]\n")); } if (dle->exclude_list && dle->exclude_list->nb_element > 0 && dle->exclude_optional==0) { g_printf(_("ERROR [samba does not support exclude list]\n")); } if (dle->include_file && dle->include_file->nb_element > 0) { g_printf(_("ERROR [samba does not support include file]\n")); } if (dle->include_list && dle->include_list->nb_element > 0 && dle->include_optional==0) { g_printf(_("ERROR [samba does not support include list]\n")); } need_samba=1; } else { int nb_exclude = 0; int nb_include = 0; char *file_exclude = NULL; char *file_include = NULL; if (dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; if (dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; if (dle->include_file) nb_include += dle->include_file->nb_element; if (dle->include_list) nb_include += dle->include_list->nb_element; if (nb_exclude > 0) file_exclude = build_exclude(dle, 1); if (nb_include > 0) file_include = build_include(dle, 1); amfree(file_exclude); amfree(file_include); need_runtar=1; } } if (strcmp(dle->program,"DUMP") == 0) { if (dle->exclude_file && dle->exclude_file->nb_element > 0) { g_printf(_("ERROR [DUMP does not support exclude file]\n")); } if (dle->exclude_list && dle->exclude_list->nb_element > 0) { g_printf(_("ERROR [DUMP does not support exclude list]\n")); } if (dle->include_file && dle->include_file->nb_element > 0) { g_printf(_("ERROR [DUMP does not support include file]\n")); } if (dle->include_list && dle->include_list->nb_element > 0) { g_printf(_("ERROR [DUMP does not support include list]\n")); } #ifdef USE_RUNDUMP need_rundump=1; #endif #ifndef AIX_BACKUP #ifdef VDUMP #ifdef DUMP if (dle->device && strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else if (1) #endif { need_vdump=1; need_rundump=1; if (dle->create_index) need_vrestore=1; } else #endif /* VDUMP */ #ifdef XFSDUMP #ifdef DUMP if (dle->device && strcmp(amname_to_fstype(dle->device), "xfs") == 0) #else if (1) #endif { need_xfsdump=1; need_rundump=1; if (dle->create_index) need_xfsrestore=1; } else #endif /* XFSDUMP */ #ifdef VXDUMP #ifdef DUMP if (dle->device && strcmp(amname_to_fstype(dle->device), "vxfs") == 0) #else if (1) #endif { need_vxdump=1; if (dle->create_index) need_vxrestore=1; } else #endif /* VXDUMP */ { need_dump=1; if (dle->create_index) need_restore=1; } #else /* AIX backup program */ need_dump=1; if (dle->create_index) need_restore=1; #endif } if ((dle->compress == COMP_BEST) || (dle->compress == COMP_FAST) || (dle->compress == COMP_CUST)) { need_compress_path=1; } if (dle->auth && amandad_auth) { if (strcasecmp(dle->auth, amandad_auth) != 0) { g_fprintf(stdout,_("ERROR [client configured for auth=%s while server requested '%s']\n"), amandad_auth, dle->auth); if (strcmp(dle->auth, "ssh") == 0) { g_fprintf(stderr, _("ERROR [The auth in ~/.ssh/authorized_keys " "should be \"--auth=ssh\", or use another auth " " for the DLE]\n")); } else { g_fprintf(stderr, _("ERROR [The auth in the inetd/xinetd configuration " " must be the same as the DLE]\n")); } } } } static void check_disk( dle_t *dle) { char *device = NULL; char *err = NULL; char *user_and_password = NULL; char *domain = NULL; char *share = NULL, *subdir = NULL; size_t lpass = 0; int amode = R_OK; int access_result; char *access_type; char *extra_info = NULL; char *qdisk = NULL; char *qamdevice = NULL; char *qdevice = NULL; if (dle->disk) { need_global_check=1; qdisk = quote_string(dle->disk); qamdevice = quote_string(dle->device); device = stralloc("nodevice"); dbprintf(_("checking disk %s\n"), qdisk); if (GPOINTER_TO_INT(dle->estimatelist->data) == ES_CALCSIZE) { if (dle->device[0] == '/' && dle->device[1] == '/') { err = vstrallocf( _("Can't use CALCSIZE for samba estimate, use CLIENT: %s"), dle->device); goto common_exit; } } if (strcmp(dle->program, "GNUTAR")==0) { if(dle->device[0] == '/' && dle->device[1] == '/') { #ifdef SAMBA_CLIENT int nullfd, checkerr; int passwdfd; char *pwtext; size_t pwtext_len; pid_t checkpid; amwait_t retstat; pid_t wpid; int rc; char *line; char *sep; FILE *ferr; char *pw_fd_env; int errdos; parsesharename(dle->device, &share, &subdir); if (!share) { err = vstrallocf( _("cannot parse for share/subdir disk entry %s"), dle->device); goto common_exit; } if ((subdir) && (SAMBA_VERSION < 2)) { err = vstrallocf(_("subdirectory specified for share '%s' but, samba is not v2 or better"), dle->device); goto common_exit; } if ((user_and_password = findpass(share, &domain)) == NULL) { err = vstrallocf(_("cannot find password for %s"), dle->device); goto common_exit; } lpass = strlen(user_and_password); if ((pwtext = strchr(user_and_password, '%')) == NULL) { err = vstrallocf( _("password field not \'user%%pass\' for %s"), dle->device); goto common_exit; } *pwtext++ = '\0'; pwtext_len = (size_t)strlen(pwtext); amfree(device); if ((device = makesharename(share, 0)) == NULL) { err = vstrallocf(_("cannot make share name of %s"), share); goto common_exit; } if ((nullfd = open("/dev/null", O_RDWR)) == -1) { err = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); goto common_exit; } if (pwtext_len > 0) { pw_fd_env = "PASSWD_FD"; } else { pw_fd_env = "dummy_PASSWD_FD"; } checkpid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, 0, &nullfd, &nullfd, &checkerr, pw_fd_env, &passwdfd, "smbclient", device, *user_and_password ? "-U" : skip_argument, *user_and_password ? user_and_password : skip_argument, "-E", domain ? "-W" : skip_argument, domain ? domain : skip_argument, #if SAMBA_VERSION >= 2 subdir ? "-D" : skip_argument, subdir ? subdir : skip_argument, #endif "-c", "quit", NULL); checkpid = checkpid; amfree(domain); aclose(nullfd); /*@ignore@*/ if ((pwtext_len > 0) && full_write(passwdfd, pwtext, pwtext_len) < pwtext_len) { err = vstrallocf(_("password write failed: %s: %s"), dle->device, strerror(errno)); aclose(passwdfd); goto common_exit; } /*@end@*/ memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); aclose(passwdfd); ferr = fdopen(checkerr, "r"); if (!ferr) { g_printf(_("ERROR [Can't fdopen: %s]\n"), strerror(errno)); error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } sep = ""; errdos = 0; for(sep = ""; (line = agets(ferr)) != NULL; free(line)) { if (line[0] == '\0') continue; strappend(extra_info, sep); strappend(extra_info, line); sep = ": "; if(strstr(line, "ERRDOS") != NULL) { errdos = 1; } } afclose(ferr); checkerr = -1; rc = 0; sep = ""; while ((wpid = wait(&retstat)) != -1) { if (!WIFEXITED(retstat) || WEXITSTATUS(retstat) != 0) { char *exitstr = str_exit_status("smbclient", retstat); strappend(err, sep); strappend(err, exitstr); sep = "\n"; amfree(exitstr); rc = 1; } } if (errdos != 0 || rc != 0) { if (extra_info) { err = newvstrallocf(err, _("samba access error: %s: %s %s"), dle->device, extra_info, err); amfree(extra_info); } else { err = newvstrallocf(err, _("samba access error: %s: %s"), dle->device, err); } } #else err = vstrallocf( _("This client is not configured for samba: %s"), qdisk); #endif goto common_exit; } amode = F_OK; amfree(device); device = amname_to_dirname(dle->device); } else if (strcmp(dle->program, "DUMP") == 0) { if(dle->device[0] == '/' && dle->device[1] == '/') { err = vstrallocf( _("The DUMP program cannot handle samba shares, use GNUTAR: %s"), qdisk); goto common_exit; } #ifdef VDUMP /* { */ #ifdef DUMP /* { */ if (strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else /* }{*/ if (1) #endif /* } */ { amfree(device); device = amname_to_dirname(dle->device); amode = F_OK; } else #endif /* } */ { amfree(device); device = amname_to_devname(dle->device); #ifdef USE_RUNDUMP amode = F_OK; #else amode = R_OK; #endif } } } if (dle->program_is_application_api) { pid_t application_api_pid; backup_support_option_t *bsu; int app_err[2]; GPtrArray *errarray; bsu = backup_support_option(dle->program, g_options, dle->disk, dle->device, &errarray); if (!bsu) { char *line; guint i; for (i=0; i < errarray->len; i++) { line = g_ptr_array_index(errarray, i); fprintf(stdout, _("ERROR Application '%s': %s\n"), dle->program, line); amfree(line); } err = vstrallocf(_("Application '%s': can't run support command"), dle->program); goto common_exit; } if (dle->data_path == DATA_PATH_AMANDA && (bsu->data_path_set & DATA_PATH_AMANDA)==0) { g_printf("ERROR application %s doesn't support amanda data-path\n", dle->program); } if (dle->data_path == DATA_PATH_DIRECTTCP && (bsu->data_path_set & DATA_PATH_DIRECTTCP)==0) { g_printf("ERROR application %s doesn't support directtcp data-path\n", dle->program); } if (GPOINTER_TO_INT(dle->estimatelist->data) == ES_CALCSIZE && !bsu->calcsize) { g_printf("ERROR application %s doesn't support calcsize estimate\n", dle->program); } if (dle->include_file && dle->include_file->nb_element > 0 && !bsu->include_file) { g_printf("ERROR application %s doesn't support include-file\n", dle->program); } if (dle->include_list && dle->include_list->nb_element > 0 && !bsu->include_list) { g_printf("ERROR application %s doesn't support include-list\n", dle->program); } if (dle->include_optional && !bsu->include_optional) { g_printf("ERROR application %s doesn't support optional include\n", dle->program); } if (dle->exclude_file && dle->exclude_file->nb_element > 0 && !bsu->exclude_file) { g_printf("ERROR application %s doesn't support exclude-file\n", dle->program); } if (dle->exclude_list && dle->exclude_list->nb_element > 0 && !bsu->exclude_list) { g_printf("ERROR application %s doesn't support exclude-list\n", dle->program); } if (dle->exclude_optional && !bsu->exclude_optional) { g_printf("ERROR application %s doesn't support optional exclude\n", dle->program); } fflush(stdout);fflush(stderr); if (pipe(app_err) < 0) { err = vstrallocf(_("Application '%s': can't create pipe"), dle->program); goto common_exit; } switch (application_api_pid = fork()) { case -1: err = vstrallocf(_("fork failed: %s"), strerror(errno)); goto common_exit; case 0: /* child */ { GPtrArray *argv_ptr = g_ptr_array_new(); guint i; char *cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); GSList *scriptlist; script_t *script; estimatelist_t el; char *cmdline; aclose(app_err[0]); dup2(app_err[1], 2); g_ptr_array_add(argv_ptr, stralloc(dle->program)); g_ptr_array_add(argv_ptr, stralloc("selfcheck")); if (bsu->message_line == 1) { g_ptr_array_add(argv_ptr, stralloc("--message")); g_ptr_array_add(argv_ptr, stralloc("line")); } if (g_options->config != NULL && bsu->config == 1) { g_ptr_array_add(argv_ptr, stralloc("--config")); g_ptr_array_add(argv_ptr, stralloc(g_options->config)); } if (g_options->hostname != NULL && bsu->host == 1) { g_ptr_array_add(argv_ptr, stralloc("--host")); g_ptr_array_add(argv_ptr, stralloc(g_options->hostname)); } if (dle->disk != NULL && bsu->disk == 1) { g_ptr_array_add(argv_ptr, stralloc("--disk")); g_ptr_array_add(argv_ptr, stralloc(dle->disk)); } if (dle->device) { g_ptr_array_add(argv_ptr, stralloc("--device")); g_ptr_array_add(argv_ptr, stralloc(dle->device)); } if (dle->create_index && bsu->index_line == 1) { g_ptr_array_add(argv_ptr, stralloc("--index")); g_ptr_array_add(argv_ptr, stralloc("line")); } if (dle->record && bsu->record == 1) { g_ptr_array_add(argv_ptr, stralloc("--record")); } for (el = dle->estimatelist; el != NULL; el=el->next) { estimate_t estimate = (estimate_t)GPOINTER_TO_INT(el->data); if (estimate == ES_CALCSIZE && bsu->calcsize == 1) { g_ptr_array_add(argv_ptr, stralloc("--calcsize")); } } application_property_add_to_argv(argv_ptr, dle, bsu, g_options->features); for (scriptlist = dle->scriptlist; scriptlist != NULL; scriptlist = scriptlist->next) { script = (script_t *)scriptlist->data; if (script->result && script->result->proplist) { property_add_to_argv(argv_ptr, script->result->proplist); } } g_ptr_array_add(argv_ptr, NULL); cmdline = stralloc(cmd); for (i = 0; i < argv_ptr->len-1; i++) { char *quoted = quote_string( (char *)g_ptr_array_index(argv_ptr,i)); cmdline = vstrextend(&cmdline, " ", quoted, NULL); amfree(quoted); } dbprintf(_("Spawning \"%s\" in pipeline\n"), cmdline); amfree(cmdline); safe_fd(-1, 0); execve(cmd, (char **)argv_ptr->pdata, safe_env()); g_printf(_("ERROR [Can't execute %s: %s]\n"), cmd, strerror(errno)); exit(127); } default: /* parent */ { int status; FILE *app_stderr; char *line; aclose(app_err[1]); app_stderr = fdopen(app_err[0], "r"); while((line = agets(app_stderr)) != NULL) { if (strlen(line) > 0) { fprintf(stdout, "ERROR Application '%s': %s\n", dle->program, line); dbprintf("ERROR %s\n", line); } amfree(line); } fclose(app_stderr); if (waitpid(application_api_pid, &status, 0) < 0) { err = vstrallocf(_("waitpid failed: %s"), strerror(errno)); goto common_exit; } else if (!WIFEXITED(status)) { err = vstrallocf(_("Application '%s': exited with signal %d"), dle->program, WTERMSIG(status)); goto common_exit; } else if (WEXITSTATUS(status) != 0) { err = vstrallocf(_("Application '%s': exited with status %d"), dle->program, WEXITSTATUS(status)); goto common_exit; } } } amfree(bsu); fflush(stdout);fflush(stderr); amfree(device); amfree(qamdevice); amfree(qdisk); return; } if (device) { qdevice = quote_string(device); dbprintf(_("device %s\n"), qdevice); /* skip accessability test if this is an AFS entry */ if(strncmp_const(device, "afs:") != 0) { #ifdef CHECK_FOR_ACCESS_WITH_OPEN access_result = open(device, O_RDONLY); access_type = "open"; #else access_result = access(device, amode); access_type = "access"; #endif if(access_result == -1) { err = vstrallocf(_("Could not %s %s (%s): %s"), access_type, qdevice, qdisk, strerror(errno)); } #ifdef CHECK_FOR_ACCESS_WITH_OPEN aclose(access_result); #endif } } common_exit: if (!qdevice) qdevice = quote_string(device); amfree(share); amfree(subdir); if(user_and_password) { memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); } amfree(domain); if(err) { g_printf(_("ERROR %s\n"), err); dbprintf(_("%s\n"), err); amfree(err); } else { if (dle->disk) { g_printf("OK %s\n", qdisk); dbprintf(_("disk %s OK\n"), qdisk); } if (dle->device) { g_printf("OK %s\n", qamdevice); dbprintf(_("amdevice %s OK\n"), qamdevice); } if (device) { g_printf("OK %s\n", qdevice); dbprintf(_("device %s OK\n"), qdevice); } } if(extra_info) { dbprintf(_("extra info: %s\n"), extra_info); amfree(extra_info); } amfree(qdisk); amfree(qdevice); amfree(qamdevice); amfree(device); /* XXX perhaps do something with level: read dumpdates and sanity check */ } static void check_overall(void) { char *cmd; struct stat buf; int testfd; char *gnutar_list_dir; int need_amandates = 0; if( need_runtar ) { cmd = vstralloc(amlibexecdir, "/", "runtar", NULL); check_file(cmd,X_OK); check_suid(cmd); amfree(cmd); } if( need_rundump ) { cmd = vstralloc(amlibexecdir, "/", "rundump", NULL); check_file(cmd,X_OK); check_suid(cmd); amfree(cmd); } if( need_dump ) { #ifdef DUMP check_file(DUMP, X_OK); #else g_printf(_("ERROR [DUMP program not available]\n")); #endif } if( need_restore ) { #ifdef RESTORE check_file(RESTORE, X_OK); #else g_printf(_("ERROR [RESTORE program not available]\n")); #endif } if ( need_vdump ) { #ifdef VDUMP check_file(VDUMP, X_OK); #else g_printf(_("ERROR [VDUMP program not available]\n")); #endif } if ( need_vrestore ) { #ifdef VRESTORE check_file(VRESTORE, X_OK); #else g_printf(_("ERROR [VRESTORE program not available]\n")); #endif } if( need_xfsdump ) { #ifdef XFSDUMP check_file(XFSDUMP, F_OK); #else g_printf(_("ERROR [XFSDUMP program not available]\n")); #endif } if( need_xfsrestore ) { #ifdef XFSRESTORE check_file(XFSRESTORE, X_OK); #else g_printf(_("ERROR [XFSRESTORE program not available]\n")); #endif } if( need_vxdump ) { #ifdef VXDUMP check_file(VXDUMP, X_OK); #else g_printf(_("ERROR [VXDUMP program not available]\n")); #endif } if( need_vxrestore ) { #ifdef VXRESTORE check_file(VXRESTORE, X_OK); #else g_printf(_("ERROR [VXRESTORE program not available]\n")); #endif } if( need_gnutar ) { #ifdef GNUTAR check_file(GNUTAR, X_OK); #else g_printf(_("ERROR [GNUTAR program not available]\n")); #endif gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (strlen(gnutar_list_dir) == 0) gnutar_list_dir = NULL; if (gnutar_list_dir) { /* make sure our listed-incremental dir is ready */ check_dir(gnutar_list_dir, R_OK|W_OK); } else { /* no listed-incremental dir, so check that amandates is ready */ need_amandates = 1; } } if( need_calcsize ) { char *cmd; cmd = vstralloc(amlibexecdir, "/", "calcsize", NULL); check_file(cmd, X_OK); amfree(cmd); /* calcsize uses amandates */ need_amandates = 1; } if (need_amandates) { char *amandates_file; amandates_file = getconf_str(CNF_AMANDATES); check_file(amandates_file, R_OK|W_OK); } if( need_samba ) { #ifdef SAMBA_CLIENT check_file(SAMBA_CLIENT, X_OK); #else g_printf(_("ERROR [SMBCLIENT program not available]\n")); #endif testfd = open("/etc/amandapass", R_OK); if (testfd >= 0) { if(fstat(testfd, &buf) == 0) { if ((buf.st_mode & 0x7) != 0) { g_printf(_("ERROR [/etc/amandapass is world readable!]\n")); } else { g_printf(_("OK [/etc/amandapass is readable, but not by all]\n")); } } else { g_printf(_("OK [unable to stat /etc/amandapass: %s]\n"), strerror(errno)); } aclose(testfd); } else { g_printf(_("ERROR [unable to open /etc/amandapass: %s]\n"), strerror(errno)); } } if (need_compress_path ) check_file(COMPRESS_PATH, X_OK); if (need_dump || need_xfsdump ) { if (check_file_exist("/etc/dumpdates")) { check_file("/etc/dumpdates", #ifdef USE_RUNDUMP F_OK #else R_OK|W_OK #endif ); } else { #ifndef USE_RUNDUMP if (access("/etc", R_OK|W_OK) == -1) { g_printf(_("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n"), strerror(errno)); } #endif } } if (need_vdump) { if (check_file_exist("/etc/vdumpdates")) { check_file("/etc/vdumpdates", F_OK); } } if (need_global_check) { check_access("/dev/null", R_OK|W_OK); check_space(AMANDA_TMPDIR, (off_t)64); /* for amandad i/o */ #ifdef AMANDA_DBGDIR check_space(AMANDA_DBGDIR, (off_t)64); /* for amandad i/o */ #endif check_space("/etc", (off_t)64); /* for /etc/dumpdates writing */ } } static void check_space( char * dir, off_t kbytes) { struct fs_usage fsusage; char *quoted = quote_string(dir); intmax_t kb_avail; if(get_fs_usage(dir, NULL, &fsusage) == -1) { g_printf(_("ERROR [cannot get filesystem usage for %s: %s]\n"), quoted, strerror(errno)); amfree(quoted); return; } /* do the division first to avoid potential integer overflow */ kb_avail = fsusage.fsu_bavail / 1024 * fsusage.fsu_blocksize; if (fsusage.fsu_bavail_top_bit_set || fsusage.fsu_bavail == 0) { g_printf(_("ERROR [dir %s needs %lldKB, has nothing available.]\n"), quoted, (long long)kbytes); } else if (kb_avail < kbytes) { g_printf(_("ERROR [dir %s needs %lldKB, only has %lldKB available.]\n"), quoted, (long long)kbytes, (long long)kb_avail); } else { g_printf(_("OK %s has more than %lldKB available.\n"), quoted, (long long)kbytes); } amfree(quoted); } static int check_file_exist( char *filename) { struct stat stat_buf; if (stat(filename, &stat_buf) != 0) { if(errno == ENOENT) { return 0; } } return 1; } static void print_platform(void) { struct stat stat_buf; char *uname = NULL; char *distro = NULL; char *platform = NULL; char *productName = NULL; char *productVersion = NULL; char line[1025]; GPtrArray *argv_ptr; if (!stat("/usr/bin/lsb_release", &stat_buf)) { argv_ptr = g_ptr_array_new(); g_ptr_array_add(argv_ptr, "/usr/bin/lsb_release"); g_ptr_array_add(argv_ptr, "--id"); g_ptr_array_add(argv_ptr, "-s"); g_ptr_array_add(argv_ptr, NULL); distro = get_first_line(argv_ptr); if (distro && distro[0] == '"') { char *p= g_strdup(distro+1); p[strlen(p)-1] = '\0'; g_free(distro); distro = p; } g_ptr_array_free(argv_ptr, TRUE); argv_ptr = g_ptr_array_new(); g_ptr_array_add(argv_ptr, "/usr/bin/lsb_release"); g_ptr_array_add(argv_ptr, "--description"); g_ptr_array_add(argv_ptr, "-s"); g_ptr_array_add(argv_ptr, NULL); platform = get_first_line(argv_ptr); if (platform && platform[0] == '"') { char *p= g_strdup(platform+1); p[strlen(p)-1] = '\0'; g_free(platform); platform = p; } g_ptr_array_free(argv_ptr, TRUE); } else if (stat("/etc/redhat-release", &stat_buf) == 0) { FILE *release = fopen("/etc/redhat-release", "r"); distro = g_strdup("RPM"); if (release) { char *result; result = fgets(line, 1024, release); if (result) { platform = g_strdup(line); } fclose(release); } } else if (stat("/etc/lsb-release", &stat_buf) == 0) { FILE *release = fopen("/etc/lsb-release", "r"); distro = g_strdup("Ubuntu"); if (release) { while (fgets(line, 1024, release)) { if (strstr(line, "DESCRIPTION")) { char *p = strchr(line, '='); if (p) { g_free(platform); platform = g_strdup(p+1); } } } fclose(release); } } else if (stat("/etc/debian_version", &stat_buf) == 0) { FILE *release = fopen("/etc/debian_version", "r"); distro = g_strdup("Debian"); if (release) { char *result; result = fgets(line, 1024, release); if (result) { platform = g_strdup(line); } fclose(release); } } else { argv_ptr = g_ptr_array_new(); g_ptr_array_add(argv_ptr, UNAME_PATH); g_ptr_array_add(argv_ptr, "-s"); g_ptr_array_add(argv_ptr, NULL); uname = get_first_line(argv_ptr); g_ptr_array_free(argv_ptr, TRUE); if (uname && strncmp(uname, "SunOS", 5) == 0) { FILE *release = fopen("/etc/release", "r"); distro = g_strdup("Solaris"); if (release) { char *result; result = fgets(line, 1024, release); if (result) { platform = g_strdup(line); } fclose(release); } amfree(uname); } else { amfree(uname); argv_ptr = g_ptr_array_new(); g_ptr_array_add(argv_ptr, "/usr/bin/sw_vers"); g_ptr_array_add(argv_ptr, "-productName"); g_ptr_array_add(argv_ptr, NULL); productName = get_first_line(argv_ptr); g_ptr_array_free(argv_ptr, TRUE); argv_ptr = g_ptr_array_new(); g_ptr_array_add(argv_ptr, "/usr/bin/sw_vers"); g_ptr_array_add(argv_ptr, "-productVersion"); g_ptr_array_add(argv_ptr, NULL); productVersion = get_first_line(argv_ptr); g_ptr_array_free(argv_ptr, TRUE); if (productName && productVersion && !g_str_equal(productName, "unknown") && !g_str_equal(productVersion, "unknown")) { distro = g_strdup("mac"); platform = g_strdup_printf("%s %s", productVersion, productVersion); } } } if (!distro) { distro = g_strdup("Unknown"); } if (!platform) { platform = g_strdup("Unknown"); } if (platform[strlen(platform) -1] == '\n') { platform[strlen(platform) -1] = '\0'; } g_fprintf(stdout, "OK distro %s\n", distro); g_fprintf(stdout, "OK platform %s\n", platform); amfree(distro); amfree(platform); amfree(productName); amfree(productVersion); } amanda-3.3.6/client-src/amandates.c0000664000076400007640000002014012357250002020575 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amandates.c,v 1.21 2006/07/25 18:35:21 martinea Exp $ * * manage amandates file, that mimics /etc/dumpdates, but stores * GNUTAR dates */ #include "amanda.h" #include "getfsent.h" #include "util.h" #include "amandates.h" static amandates_t *amandates_list = NULL; static FILE *amdf = NULL; static int updated, readonly; static char *g_amandates_file = NULL; static void import_dumpdates(amandates_t *); static void enter_record(char *, int , time_t); static amandates_t *lookup(char *name, int import); int start_amandates( char *amandates_file, int open_readwrite) { int rc, level = 0; long ldate = 0L; char *line; char *name; char *s; int ch; char *qname; if (amandates_file == NULL) { errno = 0; return 0; } /* clean up from previous invocation */ if(amdf != NULL) finish_amandates(); if(amandates_list != NULL) free_amandates(); amfree(g_amandates_file); /* initialize state */ updated = 0; readonly = !open_readwrite; amdf = NULL; amandates_list = NULL; g_amandates_file = stralloc(amandates_file); /* open the file */ if (access(amandates_file,F_OK)) /* not yet existing */ if ( (rc = open(amandates_file,(O_CREAT|O_RDWR),0644)) != -1 ) /* open/create successfull */ aclose(rc); if(open_readwrite) amdf = fopen(amandates_file, "r+"); else amdf = fopen(amandates_file, "r"); /* create it if we need to */ if(amdf == NULL && (errno == EINTR || errno == ENOENT) && open_readwrite) amdf = fopen(amandates_file, "w"); if(amdf == NULL) return 0; if(open_readwrite) rc = amflock(fileno(amdf), amandates_file); else rc = amroflock(fileno(amdf), amandates_file); if(rc == -1) { error(_("could not lock %s: %s"), amandates_file, strerror(errno)); /*NOTREACHED*/ } for(; (line = agets(amdf)) != NULL; free(line)) { if (line[0] == '\0') continue; s = line; ch = *s++; skip_whitespace(s, ch); if(ch == '\0') { continue; /* no name field */ } qname = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the name */ name = unquote_string(qname); skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%d %ld", &level, &ldate) != 2) { amfree(name); continue; /* no more fields */ } if(level < 0 || level >= DUMP_LEVELS) { amfree(name); continue; } enter_record(name, level, (time_t) ldate); amfree(name); } if(ferror(amdf)) { error(_("reading %s: %s"), amandates_file, strerror(errno)); /*NOTREACHED*/ } updated = 0; /* reset updated flag */ return 1; } void finish_amandates(void) { amandates_t *amdp; int level; char *qname; if(amdf == NULL) return; if(updated) { if(readonly) { error(_("updated amandates after opening readonly")); /*NOTREACHED*/ } rewind(amdf); for(amdp = amandates_list; amdp != NULL; amdp = amdp->next) { for(level = 0; level < DUMP_LEVELS; level++) { if(amdp->dates[level] == EPOCH) continue; qname = quote_string(amdp->name); g_fprintf(amdf, "%s %d %ld\n", qname, level, (long) amdp->dates[level]); amfree(qname); } } } if(amfunlock(fileno(amdf), g_amandates_file) == -1) { error(_("could not unlock %s: %s"), g_amandates_file, strerror(errno)); /*NOTREACHED*/ } if (fclose(amdf) == EOF) { error(_("error [closing %s: %s]"), g_amandates_file, strerror(errno)); /*NOTREACHED*/ } amdf = NULL; } void free_amandates(void) { amandates_t *amdp, *nextp; for(amdp = amandates_list; amdp != NULL; amdp = nextp) { nextp = amdp->next; amfree(amdp->name); amfree(amdp); } amandates_list = NULL; } static amandates_t * lookup( char * name, int import) { amandates_t *prevp, *amdp; int rc, level; (void)import; /* Quiet unused parameter warning */ rc = 0; prevp = NULL; amdp = amandates_list; while (amdp != NULL) { if ((rc = strcmp(name, amdp->name)) <= 0) break; prevp = amdp; amdp = amdp->next; } if (!(amdp && (rc == 0))) { amandates_t *newp = alloc(SIZEOF(amandates_t)); newp->name = stralloc(name); for (level = 0; level < DUMP_LEVELS; level++) newp->dates[level] = EPOCH; newp->next = amdp; if (prevp != NULL) { #ifndef __lint /* Remove complaint about NULL pointer assignment */ prevp->next = newp; #else (void)prevp; #endif } else { amandates_list = newp; } import_dumpdates(newp); return newp; } return amdp; } amandates_t * amandates_lookup( char * name) { return lookup(name, 1); } static void enter_record( char * name, int level, time_t dumpdate) { amandates_t *amdp; char *qname; amdp = lookup(name, 0); if(level < 0 || level >= DUMP_LEVELS || dumpdate < amdp->dates[level]) { qname = quote_string(name); /* this is not allowed, but we can ignore it */ dbprintf(_("amandates botch: %s lev %d: new dumpdate %ld old %ld\n"), qname, level, (long) dumpdate, (long) amdp->dates[level]); amfree(qname); return; } amdp->dates[level] = dumpdate; } void amandates_updateone( char * name, int level, time_t dumpdate) { amandates_t *amdp; char *qname; assert(!readonly); amdp = lookup(name, 1); if(level < 0 || level >= DUMP_LEVELS || dumpdate < amdp->dates[level]) { /* this is not allowed, but we can ignore it */ qname = quote_string(name); dbprintf(_("amandates updateone: %s lev %d: new dumpdate %ld old %ld"), name, level, (long) dumpdate, (long) amdp->dates[level]); amfree(qname); return; } amdp->dates[level] = dumpdate; updated = 1; } /* -------------------------- */ static void import_dumpdates( amandates_t * amdp) { char *devname; char *line; char *fname; int level = 0; time_t dumpdate; FILE *dumpdf; char *s; int ch; devname = amname_to_devname(amdp->name); if((dumpdf = fopen("/etc/dumpdates", "r")) == NULL) { amfree(devname); return; } for(; (line = agets(dumpdf)) != NULL; free(line)) { if (line[0] == '\0') continue; s = line; ch = *s++; skip_whitespace(s, ch); if(ch == '\0') { continue; /* no fname field */ } fname = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate fname */ skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { continue; /* no level field */ } skip_integer(s, ch); skip_whitespace(s, ch); if(ch == '\0') { continue; /* no dumpdate field */ } dumpdate = unctime(s-1); if(strcmp(fname, devname) != 0 || level < 0 || level >= DUMP_LEVELS) { continue; } if(dumpdate != -1 && dumpdate > amdp->dates[level]) { if(!readonly) updated = 1; amdp->dates[level] = dumpdate; } } afclose(dumpdf); amfree(devname); } amanda-3.3.6/client-src/client_util.h0000664000076400007640000001413212357250002021164 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: client_util.h,v 1.14 2006/05/25 01:47:11 johnfranks Exp $ * */ #ifndef CLIENT_UTIL_H #define CLIENT_UTIL_H #include "amanda.h" #include "conffile.h" #include "amfeatures.h" #include "am_sl.h" #include "util.h" /* for bstrncmp() */ #include "amandad.h" /* for g_option_t */ #include "amxml.h" /* for dle_t */ typedef enum { RECOVER_PATH_CWD = 0, RECOVER_PATH_REMOTE = 1, } recover_path_t; typedef struct backup_support_option_s { int config; int host; int disk; int max_level; int index_line; int index_xml; int message_line; int message_xml; int record; int include_file; int include_list; int include_list_glob; int include_optional; int exclude_file; int exclude_list; int exclude_list_glob; int exclude_optional; int collection; int calcsize; int client_estimate; int multi_estimate; int smb_recover_mode; int features; data_path_t data_path_set; /* bitfield of all allowed data-path */ recover_path_t recover_path; } backup_support_option_t; typedef struct client_script_result_s { int exit_code; proplist_t proplist; GPtrArray *output; GPtrArray *err; } client_script_result_t; typedef enum { DMP_NORMAL, DMP_IGNORE, DMP_STRANGE, DMP_SIZE, DMP_ERROR } dmpline_t; typedef struct regex_s { char *regex; int srcline; int scale; /* only used for size lines */ int field; dmpline_t typ; } amregex_t; #define AM_NORMAL_RE(re) {(re), __LINE__, 0, 0, DMP_NORMAL} #define AM_IGNORE_RE(re) {(re), __LINE__, 0, 0, DMP_IGNORE} #define AM_STRANGE_RE(re) {(re), __LINE__, 0, 0, DMP_STRANGE} #define AM_SIZE_RE(re,s,f) {(re), __LINE__, (s), (f), DMP_SIZE} #define AM_ERROR_RE(re) {(re), __LINE__, 0, 0, DMP_ERROR} char *build_exclude(dle_t *dle, int verbose); char *build_include(dle_t *dle, int verbose); void parse_options(char *str, dle_t *dle, am_feature_t *features, int verbose); /* Add all properties of an application for a dle to an ARGV. * include/exclude options are converted to properties. * * @param argv_ptr: the ARGV where to store properties. * @param dle: the dle. * @returns: Number of argument added to ARGV. */ void application_property_add_to_argv(GPtrArray *argv_ptr, dle_t *dle, backup_support_option_t *bsu, am_feature_t *amfeatures); /* Merge properties from amanda-client.conf files to dles (application and scripts) * * @param dle: the dle list. * @returns: Return 1 on success * Return 0 on failure */ int merge_dles_properties(dle_t *dles, int verbose); char *fixup_relative(char *name, char *device); backup_support_option_t *backup_support_option(char *program, g_option_t *g_options, char *disk, char *amdevice, GPtrArray **errarray); void run_client_script(script_t *script, execute_on_t execute_on, g_option_t *g_options, dle_t *dle); void run_client_scripts(execute_on_t execute_on, g_option_t *g_options, dle_t *dle, FILE *streamout); void run_calcsize(char *config, char *program, char *disk, char *dirname, GSList *levels, char *file_exclude, char *file_include); gboolean check_access(char *filename, int mode); gboolean check_file(char *filename, int mode); gboolean check_dir(char *dirname, int mode); gboolean check_suid(char *filename); double the_num(char * str, int pos); /* Convert a GSList returned from config_errors into an "ERROR " * line suitable for inclusion in a NAK or REP packet. Because we only * get one ERROR line per packet, this includes only the first * error, with an indication that there are more to follow. * * @param errlist: the list of errors from config_errors * @returns: newly allocated string containing the error messages */ char *config_errors_to_error_string(GSList *errlist); amregex_t *build_re_table(amregex_t *orig_re_table, GSList *normal_message, GSList *ignore_message, GSList *strange_message); void add_type_table(dmpline_t typ, amregex_t **re_table, amregex_t *orig_re_table, GSList *normal_message, GSList *ignore_message, GSList *strange_message); void add_list_table(dmpline_t typ, amregex_t **re_table, GSList *message); /* Merge properties from conf_proplist to dle_proplist If verbose is 1, then dle->disk and name are used in output. * @returns: Return 1 on success * Return 0 on failure */ int merge_properties(dle_t *dle, char *name, proplist_t dle_proplist, proplist_t conf_proplist, int verbose); #endif amanda-3.3.6/client-src/calcsize.c0000664000076400007640000004271012357250002020444 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: calcsize.c,v 1.44 2006/07/25 18:27:56 martinea Exp $ * * traverse directory tree to get backup size estimates * * argv[0] is the calcsize program name * argv[1] is the config name or NOCONFIG */ #include "amanda.h" #include "match.h" #include "conffile.h" #include "fsusage.h" #include "am_sl.h" #include "util.h" #define ROUND(n,x) ((x) + (n) - 1 - (((x) + (n) - 1) % (n))) /* static off_t round_function(n, x) off_t n, off_t x) { unsigned long remainder = x % n; if (remainder) x += n - remainder; return x; } */ #define ST_BLOCKS(s) \ (((((off_t)(s).st_blocks * (off_t)512) <= (s).st_size)) ? \ ((off_t)(s).st_blocks + (off_t)1) : \ ((s).st_size / (off_t)512 + \ (off_t)((((s).st_size % (off_t)512) != (off_t)0) ? \ (off_t)1 : (off_t)0))) #define FILETYPES (S_IFREG|S_IFLNK|S_IFDIR) typedef struct name_s { struct name_s *next; char *str; } Name; Name *name_stack; #define MAXDUMPS 10 struct { int max_inode; int total_dirs; int total_files; off_t total_size; off_t total_size_name; } dumpstats[MAXDUMPS]; time_t dumpdate[MAXDUMPS]; int dumplevel[MAXDUMPS]; int ndumps; void (*add_file_name)(int, char *); void (*add_file)(int, struct stat *); off_t (*final_size)(int, char *); int main(int, char **); void traverse_dirs(char *, char *); void add_file_name_bsdtar(int, char *); void add_file_bsdtar(int, struct stat *); off_t final_size_bsdtar(int, char *); void add_file_name_dump(int, char *); void add_file_dump(int, struct stat *); off_t final_size_dump(int, char *); void add_file_name_star(int, char *); void add_file_star(int, struct stat *); off_t final_size_star(int, char *); void add_file_name_gnutar(int, char *); void add_file_gnutar(int, struct stat *); off_t final_size_gnutar(int, char *); void add_file_name_unknown(int, char *); void add_file_unknown(int, struct stat *); off_t final_size_unknown(int, char *); am_sl_t *calc_load_file(char *filename); int calc_check_exclude(char *filename); int use_star_excl = 0; int use_gtar_excl = 0; am_sl_t *include_sl=NULL, *exclude_sl=NULL; int main( int argc, char ** argv) { #ifdef TEST /* standalone test to ckeck wether the calculated file size is ok */ struct stat finfo; int i; off_t dump_total = (off_t)0; off_t gtar_total = (off_t)0; char *d; int l, w; /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); set_pname("calcsize"); dbopen(NULL); config_init(CONFIG_INIT_CLIENT, NULL); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); if (argc < 2) { g_fprintf(stderr,_("Usage: %s file[s]\n"),argv[0]); return 1; } for(i=1; i 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("calcsize-%s\n", VERSION); return (0); } safe_fd(-1, 0); safe_cd(); set_pname("calcsize"); dbopen(DBG_SUBDIR_CLIENT); config_init(CONFIG_INIT_CLIENT, NULL); dbprintf(_("version %s\n"), VERSION); /* drop root privileges; we'll regain them for the required operations */ #ifdef WANT_SETUID_CLIENT check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY); if (!set_root_privs(0)) { error(_("calcsize must be run setuid root")); } #else check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif argc--, argv++; /* skip program name */ /* need at least program, amname, and directory name */ if(argc < 4) { error(_("Usage: %s config [BSDTAR|DUMP|STAR|GNUTAR] name dir [-X exclude-file] [-I include-file] [level date]*"), get_pname()); /*NOTREACHED*/ } dbprintf(_("config: %s\n"), *argv); if (strcmp(*argv, "NOCONFIG") != 0) { dbrename(*argv, DBG_SUBDIR_CLIENT); } argc--; argv++; /* parse backup program name */ if(strcmp(*argv, "DUMP") == 0) { #if !defined(DUMP) && !defined(XFSDUMP) error("dump not available on this system"); /*NOTREACHED*/ #else add_file_name = add_file_name_dump; add_file = add_file_dump; final_size = final_size_dump; #endif } else if(strcmp(*argv, "GNUTAR") == 0) { #ifndef GNUTAR error("gnutar not available on this system"); /*NOTREACHED*/ #else add_file_name = add_file_name_gnutar; add_file = add_file_gnutar; final_size = final_size_gnutar; use_gtar_excl++; #endif } else if(strcmp(*argv, "BSDTAR") == 0) { add_file_name = add_file_name_gnutar; add_file = add_file_gnutar; final_size = final_size_gnutar; use_gtar_excl++; } else { add_file_name = add_file_name_unknown; add_file = add_file_unknown; final_size = final_size_unknown; } argc--, argv++; /* the amanda name can be different from the directory name */ if (argc > 0) { amname = *argv; qamname = quote_string(amname); argc--, argv++; } else { error("missing "); /*NOTREACHED*/ } /* the toplevel directory name to search from */ if (argc > 0) { dirname = *argv; argc--, argv++; } else { error("missing "); /*NOTREACHED*/ } if ((argc > 1) && strcmp(*argv,"-X") == 0) { argv++; if (!(use_gtar_excl || use_star_excl)) { error("exclusion specification not supported"); /*NOTREACHED*/ } filename = stralloc(*argv); qfilename = quote_string(filename); if (access(filename, R_OK) != 0) { g_fprintf(stderr,"Cannot open exclude file %s\n", qfilename); use_gtar_excl = use_star_excl = 0; } else { exclude_sl = calc_load_file(filename); if (!exclude_sl) { g_fprintf(stderr,"Cannot open exclude file %s: %s\n", qfilename, strerror(errno)); use_gtar_excl = use_star_excl = 0; } } amfree(qfilename); amfree(filename); argc -= 2; argv++; } else { use_gtar_excl = use_star_excl = 0; } if ((argc > 1) && strcmp(*argv,"-I") == 0) { argv++; filename = stralloc(*argv); qfilename = quote_string(filename); if (access(filename, R_OK) != 0) { g_fprintf(stderr,"Cannot open include file %s\n", qfilename); use_gtar_excl = use_star_excl = 0; } else { include_sl = calc_load_file(filename); if (!include_sl) { g_fprintf(stderr,"Cannot open include file %s: %s\n", qfilename, strerror(errno)); use_gtar_excl = use_star_excl = 0; } } amfree(qfilename); amfree(filename); argc -= 2; argv++; } /* the dump levels to calculate sizes for */ ndumps = 0; while(argc >= 2) { if(ndumps < MAXDUMPS) { dumplevel[ndumps] = atoi(argv[0]); dumpdate [ndumps] = (time_t) atol(argv[1]); ndumps++; argc -= 2, argv += 2; } } if(argc) { error("leftover arg \"%s\", expected and ", *argv); /*NOTREACHED*/ } if(is_empty_sl(include_sl)) { traverse_dirs(dirname,"."); } else { sle_t *an_include = include_sl->first; while(an_include != NULL) { /* char *adirname = stralloc2(dirname, an_include->name+1); traverse_dirs(adirname); amfree(adirname); */ traverse_dirs(dirname, an_include->name); an_include = an_include->next; } } for(i = 0; i < ndumps; i++) { amflock(1, "size"); dbprintf("calcsize: %s %d SIZE %lld\n", qamname, dumplevel[i], (long long)final_size(i, dirname)); g_fprintf(stderr, "%s %d SIZE %lld\n", qamname, dumplevel[i], (long long)final_size(i, dirname)); fflush(stderr); amfunlock(1, "size"); } amfree(qamname); return 0; #endif } /* * ========================================================================= */ #if !defined(HAVE_BASENAME) && defined(BUILTIN_EXCLUDE_SUPPORT) static char * basename( char * file) { char *cp; if ( (cp = strrchr(file,'/')) ) return cp+1; return file; } #endif void push_name(char *str); char *pop_name(void); void traverse_dirs( char * parent_dir, char * include) { DIR *d; struct dirent *f; struct stat finfo; char *dirname, *newname = NULL; char *newbase = NULL; dev_t parent_dev = (dev_t)0; int i; size_t l; size_t parent_len; int has_exclude; char *aparent; if(parent_dir == NULL || include == NULL) return; has_exclude = !is_empty_sl(exclude_sl) && (use_gtar_excl || use_star_excl); aparent = vstralloc(parent_dir, "/", include, NULL); /* We (may) need root privs for the *stat() calls here. */ set_root_privs(1); if(stat(parent_dir, &finfo) != -1) parent_dev = finfo.st_dev; parent_len = strlen(parent_dir); push_name(aparent); for(; (dirname = pop_name()) != NULL; free(dirname)) { if(has_exclude && calc_check_exclude(dirname+parent_len+1)) { continue; } if((d = opendir(dirname)) == NULL) { perror(dirname); continue; } l = strlen(dirname); if(l > 0 && dirname[l - 1] != '/') { newbase = newstralloc2(newbase, dirname, "/"); } else { newbase = newstralloc(newbase, dirname); } while((f = readdir(d)) != NULL) { int is_symlink = 0; int is_dir; int is_file; if(is_dot_or_dotdot(f->d_name)) { continue; } newname = newstralloc2(newname, newbase, f->d_name); if(lstat(newname, &finfo) == -1) { g_fprintf(stderr, "%s/%s: %s\n", dirname, f->d_name, strerror(errno)); continue; } if(finfo.st_dev != parent_dev) continue; #ifdef S_IFLNK is_symlink = ((finfo.st_mode & S_IFMT) == S_IFLNK); #endif is_dir = ((finfo.st_mode & S_IFMT) == S_IFDIR); is_file = ((finfo.st_mode & S_IFMT) == S_IFREG); if (!(is_file || is_dir || is_symlink)) { continue; } { int is_excluded = -1; for(i = 0; i < ndumps; i++) { add_file_name(i, newname); if(is_file && (time_t)finfo.st_ctime >= dumpdate[i]) { if(has_exclude) { if(is_excluded == -1) is_excluded = calc_check_exclude(newname+parent_len+1); if(is_excluded == 1) { i = ndumps; continue; } } add_file(i, &finfo); } } if(is_dir) { if(has_exclude && calc_check_exclude(newname+parent_len+1)) continue; push_name(newname); } } } #ifdef CLOSEDIR_VOID closedir(d); #else if(closedir(d) == -1) perror(dirname); #endif } /* drop root privs -- we're done with the permission-sensitive calls */ set_root_privs(0); amfree(newbase); amfree(newname); amfree(aparent); } void push_name( char * str) { Name *newp; newp = alloc(SIZEOF(*newp)); newp->str = stralloc(str); newp->next = name_stack; name_stack = newp; } char * pop_name(void) { Name *newp = name_stack; char *str; if(!newp) return NULL; name_stack = newp->next; str = newp->str; amfree(newp); return str; } /* * ========================================================================= * Backup size calculations for DUMP program * * Given the system-dependent nature of dump, it's impossible to pin this * down accurately. Luckily, that's not necessary. * * Dump rounds each file up to TP_BSIZE bytes, which is 1k in the BSD dump, * others are unknown. In addition, dump stores three bitmaps at the * beginning of the dump: a used inode map, a dumped dir map, and a dumped * inode map. These are sized by the number of inodes in the filesystem. * * We don't take into account the complexities of BSD dump's indirect block * requirements for files with holes, nor the dumping of directories that * are not themselves modified. */ void add_file_name_dump( int level, char * name) { (void)level; /* Quiet unused parameter warning */ (void)name; /* Quiet unused parameter warning */ return; } void add_file_dump( int level, struct stat * sp) { /* keep the size in kbytes, rounded up, plus a 1k header block */ if((sp->st_mode & S_IFMT) == S_IFREG || (sp->st_mode & S_IFMT) == S_IFDIR) dumpstats[level].total_size += (ST_BLOCKS(*sp) + (off_t)1) / (off_t)2 + (off_t)1; } off_t final_size_dump( int level, char * topdir) { struct fs_usage fsusage; off_t mapsize; char *s; int rc; int saved_errno; /* calculate the map sizes */ s = stralloc2(topdir, "/."); set_root_privs(1); rc = get_fs_usage(s, NULL, &fsusage); saved_errno = errno; set_root_privs(0); if (rc == -1) { error("statfs %s: %s", s, strerror(saved_errno)); /*NOTREACHED*/ } amfree(s); mapsize = (fsusage.fsu_files + (off_t)7) / (off_t)8; /* in bytes */ mapsize = (mapsize + (off_t)1023) / (off_t)1024; /* in kbytes */ /* the dump contains three maps plus the files */ return (mapsize * (off_t)3) + dumpstats[level].total_size; } /* * ========================================================================= * Backup size calculations for GNUTAR program * * Gnutar's basic blocksize is 512 bytes. Each file is rounded up to that * size, plus one header block. Gnutar stores directories' file lists in * incremental dumps - we'll pick up size of the modified dirs here. These * will be larger than a simple filelist of their contents, but that's ok. * * As with DUMP, we only need a reasonable estimate, not an exact figure. */ void add_file_name_gnutar( int level, char * name) { (void)name; /* Quiet unused parameter warning */ /* dumpstats[level].total_size_name += strlen(name) + 64;*/ dumpstats[level].total_size += (off_t)1; } void add_file_gnutar( int level, struct stat * sp) { /* the header takes one additional block */ dumpstats[level].total_size += ST_BLOCKS(*sp); } off_t final_size_gnutar( int level, char * topdir) { (void)topdir; /* Quiet unused parameter warning */ /* divide by two to get kbytes, rounded up */ /* + 4 blocks for security */ return (dumpstats[level].total_size + (off_t)5 + (dumpstats[level].total_size_name/(off_t)512)) / (off_t)2; } /* * ========================================================================= * Backup size calculations for unknown backup programs. * * Here we'll just add up the file sizes and output that. */ void add_file_name_unknown( int level, char * name) { (void)level; /* Quiet unused parameter warning */ (void)name; /* Quiet unused parameter warning */ return; } void add_file_unknown( int level, struct stat * sp) { /* just add up the block counts */ if((sp->st_mode & S_IFMT) == S_IFREG || (sp->st_mode & S_IFMT) == S_IFDIR) dumpstats[level].total_size += ST_BLOCKS(*sp); } off_t final_size_unknown( int level, char * topdir) { (void)topdir; /* Quiet unused parameter warning */ /* divide by two to get kbytes, rounded up */ return (dumpstats[level].total_size + (off_t)1) / (off_t)2; } /* * ========================================================================= */ am_sl_t * calc_load_file( char * filename) { char pattern[1025]; am_sl_t *sl_list; FILE *file = fopen(filename, "r"); if (!file) { return NULL; } sl_list = new_sl(); while(fgets(pattern, 1025, file)) { if(strlen(pattern)>0 && pattern[strlen(pattern)-1] == '\n') pattern[strlen(pattern)-1] = '\0'; sl_list = append_sl(sl_list, pattern); } fclose(file); return sl_list; } int calc_check_exclude( char * filename) { sle_t *an_exclude; if(is_empty_sl(exclude_sl)) return 0; an_exclude=exclude_sl->first; while(an_exclude != NULL) { if(match_tar(an_exclude->name, filename)) { return 1; } an_exclude=an_exclude->next; } return 0; } amanda-3.3.6/client-src/Makefile.am0000664000076400007640000000500612357250002020534 0ustar00martineamartinea00000000000000# Makefile for Amanda client programs. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/scripts.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/amandad-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) LINT=$(AMLINT) LINTFLAGS=$(AMLINTFLAGS) amlib_LTLIBRARIES = libamclient.la amlibexec_PROGRAMS = noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize amlibexec_SCRIPTS_SHELL = patch-system sbin_SCRIPTS_PERL = amdump_client SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) SCRIPTS_SHELL = $(amlibexec_SCRIPTS_SHELL) sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_SHELL) libamclient_la_SOURCES= amandates.c getfsent.c \ unctime.c client_util.c if WANT_SAMBA libamclient_la_SOURCES += findpass.c endif libamclient_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamclient_la_LIBADD = ../common-src/libamanda.la ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ libamclient.la \ ../amandad-src/libamandad.la \ ../common-src/libamanda.la \ ../gnulib/libgnu.la # these are used for testing only: TEST_PROGS = getfsent EXTRA_PROGRAMS = $(TEST_PROGS) CLEANFILES += *.test.c sendbackup_SOURCES = sendbackup.c sendbackup.h \ sendbackup-dump.c sendbackup-gnutar.c noinst_HEADERS = amandates.h getfsent.h \ findpass.h client_util.h if WANT_SETUID_CLIENT INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \ calcsize killpgrp rundump runtar endif lint: @ for p in $(amlibexec_PROGRAMS); do \ p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamclient_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ done; \ exit 0 getfsent_SOURCES = getfsent.test.c %.test.c: $(srcdir)/%.c echo '#define TEST' >$@ echo '#include "$<"' >>$@ amanda-3.3.6/client-src/killpgrp.c0000664000076400007640000001167012357250002020474 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: killpgrp.c,v 1.17 2006/07/25 18:27:56 martinea Exp $ * * if it is the process group leader, it kills all processes in its * process group when it is killed itself. * * argv[0] is the killpgrp program name * argv[1] is the config name or NOCONFIG * */ #include "amanda.h" #include "util.h" #include "conffile.h" #ifdef HAVE_GETPGRP #ifdef GETPGRP_VOID #define AM_GETPGRP() getpgrp() #else #define AM_GETPGRP() getpgrp(getpid()) #endif #else /* we cannot check it, so let us assume it is ok */ #define AM_GETPGRP() getpid() #endif int main(int argc, char **argv); static void term_kill_soft(int sig); static void term_kill_hard(int sig); int main( int argc, char ** argv) { int ch; char *exitstr; amwait_t status; if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("killpgrp-%s\n", VERSION); return (0); } /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); safe_cd(); set_pname("killpgrp"); dbopen(DBG_SUBDIR_CLIENT); config_init(CONFIG_INIT_CLIENT, NULL); if (argc < 2) { error("Need at least 2 arguments\n"); /*NOTREACHED*/ } dbprintf(_("version %s\n"), VERSION); dbprintf(_("config: %s\n"), argv[1]); if (strcmp(argv[1], "NOCONFIG") != 0) dbrename(argv[1], DBG_SUBDIR_CLIENT); #ifdef WANT_SETUID_CLIENT check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY); if (!become_root()) { error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname()); /*NOTREACHED*/ } #else check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif if (AM_GETPGRP() != getpid()) { error(_("error [must be the process group leader]")); /*NOTREACHED*/ } signal(SIGTERM, term_kill_soft); /* Consume any extranious input */ do { ch = getchar(); /* wait until EOF */ } while (ch != EOF); term_kill_soft(0); for(;;) { if (wait(&status) != -1) break; if (errno != EINTR) { error(_("error [wait() failed: %s]"), strerror(errno)); /*NOTREACHED*/ } } exitstr = str_exit_status("child", status); dbprintf("%s\n", exitstr); amfree(exitstr); /*@ignore@*/ return WIFEXITED(status)?WEXITSTATUS(status):1; /*@end@*/ } static void term_kill_soft( int sig) { pid_t dumppid = getpid(); int killerr; (void)sig; /* Quiet unused parameter warning */ signal(SIGTERM, SIG_IGN); signal(SIGALRM, term_kill_hard); alarm(3); /* * First, try to kill the dump process nicely. If it ignores us * for three seconds, hit it harder. */ dbprintf(_("sending SIGTERM to process group %ld\n"), (long) dumppid); killerr = kill(-dumppid, SIGTERM); if (killerr == -1) { dbprintf(_("kill failed: %s\n"), strerror(errno)); } } static void term_kill_hard( int sig) { pid_t dumppid = getpid(); int killerr; (void)sig; /* Quiet unused parameter warning */ dbprintf(_("It won\'t die with SIGTERM, but SIGKILL should do.\n")); dbprintf(_("Don't expect any further output, this will be suicide.\n")); killerr = kill(-dumppid, SIGKILL); /* should never reach this point, but so what? */ if (killerr == -1) { dbprintf(_("kill failed: %s\n"), strerror(errno)); dbprintf(_("waiting until child terminates\n")); } } amanda-3.3.6/client-src/sendbackup-dump.c0000664000076400007640000003207612357250002021735 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1999 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: sendbackup-dump.c,v 1.90 2006/07/25 18:10:07 martinea Exp $ * * send backup data using BSD dump */ #include "amanda.h" #include "sendbackup.h" #include "getfsent.h" #include "clock.h" #define LEAF_AND_DIRS "sed -e \'\ns/^leaf[ \t]*[0-9]*[ \t]*\\.//\nt\n/^dir[ \t]/ {\ns/^dir[ \t]*[0-9]*[ \t]*\\.//\ns%$%/%\nt\n}\nd\n\'" static amregex_t re_table[] = { /* the various encodings of dump size */ /* this should also match BSDI pre-3.0's buggy dump program, that produced doubled DUMP: DUMP: messages */ AM_SIZE_RE("DUMP: [0-9][0-9]* tape blocks", 1024, 1), AM_SIZE_RE("dump: Actual: [0-9][0-9]* tape blocks", 1024, 1), AM_SIZE_RE("backup: There are [0-9][0-9]* tape blocks on [0-9][0-9]* tapes", 1024, 1), AM_SIZE_RE("backup: [0-9][0-9]* tape blocks on [0-9][0-9]* tape\\(s\\)", 1024, 1), AM_SIZE_RE("backup: [0-9][0-9]* 1k blocks on [0-9][0-9]* volume\\(s\\)", 1024, 1), AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\) on [0-9][0-9]* volume", 512, 1), AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\) on [0-9][0-9]* volume", 512, 1), AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\)", 1024, 2), AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\)", 1048576, 2), AM_SIZE_RE("DUMP: [0-9][0-9]* blocks", 512, 1), AM_SIZE_RE("DUMP: [0-9][0-9]* bytes were dumped", 1, 1), /* OSF's vdump */ AM_SIZE_RE("vdump: Dumped [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1), /* DU 4.0a dump */ AM_SIZE_RE("dump: Actual: [0-9][0-9]* blocks output to pipe", 1024, 1), /* DU 4.0 vdump */ AM_SIZE_RE("dump: Dumped [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1), /* HPUX dump */ AM_SIZE_RE("DUMP: [0-9][0-9]* KB actual output", 1024, 1), /* HPUX 10.20 and above vxdump */ AM_SIZE_RE("vxdump: [0-9][0-9]* tape blocks", 1024, 1), /* UnixWare vxdump */ AM_SIZE_RE("vxdump: [0-9][0-9]* blocks", 1024, 1), /* SINIX vxdump */ AM_SIZE_RE(" VXDUMP: [0-9][0-9]* blocks", 512, 1), /* SINIX ufsdump */ AM_SIZE_RE(" UFSDUMP: [0-9][0-9]* blocks", 512, 1), /* Irix 6.2 xfs dump */ AM_SIZE_RE("xfsdump: media file size [0-9][0-9]* bytes", 1, 1), /* NetApp dump */ AM_SIZE_RE("DUMP: [0-9][0-9]* KB", 1024, 1), /* strange dump lines */ AM_STRANGE_RE("should not happen"), AM_STRANGE_RE("Cannot open"), AM_STRANGE_RE("[Ee]rror"), AM_STRANGE_RE("[Ff]ail"), /* XXX add more ERROR entries here by scanning dump sources? */ /* any blank or non-strange DUMP: lines are marked as normal */ AM_NORMAL_RE("^ *DUMP:"), AM_NORMAL_RE("^dump:"), /* OSF/1 */ AM_NORMAL_RE("^vdump:"), /* OSF/1 */ AM_NORMAL_RE("^ *vxdump:"), /* HPUX10 */ AM_NORMAL_RE("^ *vxfs *vxdump:"), /* Solaris */ AM_NORMAL_RE("^Dumping .* to stdout"), /* Sol vxdump */ AM_NORMAL_RE("^xfsdump:"), /* IRIX xfs */ AM_NORMAL_RE("^ *VXDUMP:"), /* Sinix */ AM_NORMAL_RE("^ *UFSDUMP:"), /* Sinix */ #ifdef VDUMP /* this is for OSF/1 3.2's vdump for advfs */ AM_NORMAL_RE("^The -s option is ignored"), /* OSF/1 */ AM_NORMAL_RE("^path"), /* OSF/1 */ AM_NORMAL_RE("^dev/fset"), /* OSF/1 */ AM_NORMAL_RE("^type"), /* OSF/1 */ AM_NORMAL_RE("^advfs id"), /* OSF/1 */ AM_NORMAL_RE("^[A-Z][a-z][a-z] [A-Z][a-z][a-z] .[0-9] [0-9]"), /* OSF/1 */ #endif AM_NORMAL_RE("^backup:"), /* AIX */ AM_NORMAL_RE("^ Use the umount command to unmount the filesystem"), AM_NORMAL_RE("^[ \t]*$"), /* catch-all; DMP_STRANGE is returned for all other lines */ AM_STRANGE_RE(NULL) }; static void start_backup(dle_t *dle, char *host, int dataf, int mesgf, int indexf); static void end_backup(dle_t *dle, int status); /* * doing similar to $ dump | compression | encryption */ static void start_backup( dle_t *dle, char *host, int dataf, int mesgf, int indexf) { int dumpin, dumpout, compout; char *dumpkeys = NULL; char *device = NULL; char *fstype = NULL; char *cmd = NULL; char *cmdX = NULL; char *indexcmd = NULL; char level_str[NUM_STR_SIZE]; char *compopt = NULL; char *encryptopt = skip_argument; char *qdisk; char *config; am_level_t *alevel = (am_level_t *)dle->levellist->data; int level = alevel->level; g_snprintf(level_str, SIZEOF(level_str), "%d", level); qdisk = quote_string(dle->disk); dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), get_pname(), host, qdisk, level); amfree(qdisk); /* apply client-side encryption here */ if (dle->encrypt == ENCRYPT_CUST ) { encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, &compout, &dataf, &mesgf, dle->clnt_encrypt, encryptopt, NULL); dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); } else { compout = dataf; encpid = -1; } /* now do the client-side compression */ if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { compopt = skip_argument; #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) if(dle->compress == COMP_BEST) { compopt = COMPRESS_BEST_OPT; } else { compopt = COMPRESS_FAST_OPT; } #endif comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); dbprintf(_("dump: pid %ld: %s"), (long)comppid, COMPRESS_PATH); if(compopt != skip_argument) { dbprintf(" %s", compopt); } dbprintf("\n"); } else if (dle->compress == COMP_CUST) { compopt = skip_argument; comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, dle->compprog, compopt, NULL); dbprintf(_("gnutar-cust: pid %ld: %s"), (long)comppid, dle->compprog); if(compopt != skip_argument) { dbprintf(" %s", compopt); } dbprintf("\n"); } else { dumpout = compout; comppid = -1; } /* invoke dump */ device = amname_to_devname(dle->device); fstype = amname_to_fstype(dle->device); dbprintf(_("dumping device '%s' with '%s'\n"), device, fstype); #if defined(USE_RUNDUMP) || !defined(DUMP) cmd = vstralloc(amlibexecdir, "/", "rundump", NULL); cmdX = cmd; if (g_options->config) config = g_options->config; else config = "NOCONFIG"; #else cmd = stralloc(DUMP); cmdX = skip_argument; config = skip_argument; #endif #ifndef AIX_BACKUP /* { */ /* normal dump */ #ifdef XFSDUMP /* { */ #ifdef DUMP /* { */ if (strcmp(amname_to_fstype(dle->device), "xfs") == 0) #else /* } { */ if (1) #endif /* } */ { char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", NULL); cmdX = cmd; if (g_options->config) config = g_options->config; else config = "NOCONFIG"; program->backup_name = XFSDUMP; program->restore_name = XFSRESTORE; indexcmd = vstralloc(XFSRESTORE, " -t", " -v", " silent", " -", " 2>/dev/null", " | sed", " -e", " \'s/^/\\//\'", NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumpkeys = stralloc(level_str); dumppid = pipespawn(progname, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "xfsdump", !dle->record ? "-J" : skip_argument, "-F", "-l", dumpkeys, "-", device, NULL); } else #endif /* } */ #ifdef VXDUMP /* { */ #ifdef DUMP if (strcmp(amname_to_fstype(dle->device), "vxfs") == 0) #else if (1) #endif { #ifdef USE_RUNDUMP char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", NULL); cmdX = cmd; if (g_options->config) config = g_options->config; else config = "NOCONFIG"; #else char *progname = cmd = newvstralloc(cmd, VXDUMP, NULL); cmdX = skip_argument; config = skip_argument; #endif program->backup_name = VXDUMP; program->restore_name = VXRESTORE; dumpkeys = vstralloc(level_str, !dle->record ? "" : "u", "s", "f", NULL); indexcmd = vstralloc(VXRESTORE, " -tvf", " -", " 2>/dev/null", " | ", LEAF_AND_DIRS, NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumppid = pipespawn(progname, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "vxdump", dumpkeys, "1048576", "-", device, NULL); } else #endif /* } */ #ifdef VDUMP /* { */ #ifdef DUMP if (strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else if (1) #endif { cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", NULL); cmdX = cmd; if (g_options->config) config = g_options->config; else config = "NOCONFIG"; device = newstralloc(device, amname_to_dirname(dle->device)); program->backup_name = VDUMP; program->restore_name = VRESTORE; dumpkeys = vstralloc(level_str, !dle->record ? "" : "u", "b", "f", NULL); indexcmd = vstralloc(VRESTORE, " -tvf", " -", " 2>/dev/null", " | ", "sed -e \'\n/^\\./ {\ns/^\\.//\ns/, [0-9]*$//\ns/^\\.//\ns/ @-> .*$//\nt\n}\nd\n\'", NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "vdump", dumpkeys, "60", "-", device, NULL); } else #endif /* } */ { #ifndef RESTORE #define RESTORE "restore" #endif #ifdef HAVE_HONOR_NODUMP # define PARAM_HONOR_NODUMP "h" #else # define PARAM_HONOR_NODUMP "" #endif #ifdef __FreeBSD__ # if defined(__FreeBSD_version) && (__FreeBSD_version >= 500043) # define FREEBSD_EXTRA_KEYS "bL" # else # define FREEBSD_EXTRA_KEYS "b" # endif #else # define FREEBSD_EXTRA_KEYS "" #endif dumpkeys = vstralloc(level_str, !dle->record ? "" : "u", FREEBSD_EXTRA_KEYS, "s", PARAM_HONOR_NODUMP, "f", NULL); indexcmd = vstralloc(RESTORE, " -tvf", " -", " 2>&1", /* not to /dev/null because of DU's dump */ " | ", LEAF_AND_DIRS, NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "dump", dumpkeys, #ifdef __FreeBSD__ "64", #endif "1048576", #ifdef HAVE_HONOR_NODUMP "0", #endif "-", device, NULL); } #else /* } { */ /* AIX backup program */ dumpkeys = vstralloc("-", level_str, !dle->record ? "" : "u", "f", NULL); indexcmd = vstralloc(RESTORE, " -B", " -tvf", " -", " 2>/dev/null", " | ", LEAF_AND_DIRS, NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "backup", dumpkeys, "-", device, NULL); #endif /* } */ amfree(dumpkeys); amfree(fstype); amfree(device); amfree(cmd); amfree(indexcmd); /* close the write ends of the pipes */ aclose(dumpin); aclose(dumpout); aclose(compout); aclose(dataf); aclose(mesgf); if (dle->create_index) aclose(indexf); } static void end_backup( dle_t *dle, int status) { (void)dle; (void)status; /* Quiet unused parameter warning */ /* don't need to do anything for dump */ } backup_program_t dump_program = { "DUMP", #ifdef DUMP DUMP #else "dump" #endif , RESTORE , re_table, start_backup, end_backup }; amanda-3.3.6/client-src/amandates.h0000664000076400007640000000401712357250002020607 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amandates.h,v 1.5 2006/07/25 18:35:21 martinea Exp $ * * interface for amandates file */ #ifndef AMANDATES_H #define AMANDATES_H #include "amanda.h" #define EPOCH ((time_t)0) typedef struct amandates_s { struct amandates_s *next; char *name; /* filesystem name */ time_t dates[DUMP_LEVELS]; /* dump dates */ } amandates_t; int start_amandates (char *amandates_file, int open_readwrite); void finish_amandates (void); void free_amandates (void); amandates_t *amandates_lookup (char *name); void amandates_updateone (char *name, int level, time_t dumpdate); #endif /* ! AMANDATES_H */ amanda-3.3.6/client-src/sendbackup.h0000664000076400007640000000570712357250002021000 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: sendbackup.h,v 1.20 2006/07/25 18:10:07 martinea Exp $ * * a few common decls for the sendbackup-* sources */ #ifndef SENDBACKUP_H #define SENDBACKUP_H #include "amanda.h" #include "pipespawn.h" #include "client_util.h" #include "amandad.h" void info_tapeheader(dle_t *dle); void start_index(int createindex, int input, int mesg, int index, char *cmd); /* * Dump output lines are scanned for two types of regex matches. * * First, there are some cases, unfortunately, where dump detects an * error but does not return an error code. We would like to bring these * errors to the attention of the operators anyway. * * Second, we attempt to determine what dump thinks its output size is. * This is cheaper than putting a filter between dump and compress just * to determine the output size. The re_size table contains regexes to * match the size output by various vendors' dump programs. Some vendors * output the number in Kbytes, some in 512-byte blocks. Whenever an * entry in re_size matches, the first integer in the dump line is * multiplied by the scale field to get the dump size. */ extern pid_t comppid, dumppid, encpid, tarpid; extern pid_t indexpid; extern g_option_t *g_options; typedef struct backup_program_s { char *name, *backup_name, *restore_name; amregex_t *re_table; void (*start_backup)(dle_t *dle, char *host, int dataf, int mesgf, int indexf); void (*end_backup)(dle_t *dle, int goterror); } backup_program_t; extern backup_program_t *programs[], *program; #endif /* !SENDBACKUP_H */ amanda-3.3.6/client-src/rundump.c0000664000076400007640000001140412357250002020335 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: rundump.c,v 1.33 2006/07/25 18:27:56 martinea Exp $ * * runs DUMP program as root * * argv[0] is the rundump program name * argv[1] is the config name or NOCONFIG * argv[2] will be argv[0] of the DUMP program * ... */ #include "amanda.h" #include "util.h" #include "conffile.h" int main(int argc, char **argv); #if defined(VDUMP) || defined(XFSDUMP) # undef USE_RUNDUMP # define USE_RUNDUMP #endif #if !defined(USE_RUNDUMP) # define ERRMSG _("rundump not enabled on this system.\n") #else # if !defined(DUMP) && !defined(VXDUMP) && !defined(VDUMP) && !defined(XFSDUMP) # define ERRMSG _("DUMP not available on this system.\n") # else # undef ERRMSG # endif #endif int main( int argc, char ** argv) { #ifndef ERRMSG char *dump_program; int i; char *e; char *cmdline; #endif /* ERRMSG */ if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("rundump-%s\n", VERSION); return (0); } /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); safe_cd(); set_pname("rundump"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); dbopen(DBG_SUBDIR_CLIENT); config_init(CONFIG_INIT_CLIENT, NULL); if (argc < 3) { error(_("Need at least 3 arguments\n")); /*NOTREACHED*/ } dbprintf(_("version %s\n"), VERSION); #ifdef ERRMSG /* { */ g_fprintf(stderr, ERRMSG); dbprintf("%s: %s", argv[0], ERRMSG); dbclose(); return 1; #else /* } { */ #ifdef WANT_SETUID_CLIENT check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY); if (!become_root()) { error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname()); /*NOTREACHED*/ } #else check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif /* skip argv[0] */ argc--; argv++; dbprintf(_("config: %s\n"), argv[0]); if (strcmp(argv[0], "NOCONFIG") != 0) dbrename(argv[0], DBG_SUBDIR_CLIENT); argc--; argv++; #ifdef XFSDUMP if (strcmp(argv[0], "xfsdump") == 0) dump_program = XFSDUMP; else /* strcmp(argv[0], "xfsdump") != 0 */ #endif #ifdef VXDUMP if (strcmp(argv[0], "vxdump") == 0) dump_program = VXDUMP; else /* strcmp(argv[0], "vxdump") != 0 */ #endif #ifdef VDUMP if (strcmp(argv[0], "vdump") == 0) dump_program = VDUMP; else /* strcmp(argv[0], "vdump") != 0 */ #endif #if defined(DUMP) dump_program = DUMP; #else # if defined(XFSDUMP) dump_program = XFSDUMP; # else # if defined(VXDUMP) dump_program = VXDUMP; # else dump_program = "dump"; # endif # endif #endif cmdline = stralloc(dump_program); for (i = 1; argv[i]; i++) { char *quoted; quoted = quote_string(argv[i]); cmdline = vstrextend(&cmdline, " ", quoted, NULL); amfree(quoted); } dbprintf(_("running: %s\n"), cmdline); amfree(cmdline); execve(dump_program, argv, safe_env()); e = strerror(errno); dbprintf(_("failed (%s)\n"), e); dbclose(); g_fprintf(stderr, _("rundump: could not exec %s: %s\n"), dump_program, e); return 1; #endif /* } */ } amanda-3.3.6/client-src/getfsent.c0000664000076400007640000004210212357250002020461 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2001 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: getfsent.c,v 1.38 2006/07/19 17:41:14 martinea Exp $ * * generic version of code to read fstab */ #include "amanda.h" #include "util.h" #ifdef TEST # include # include #endif #include "getfsent.h" static char *dev2rdev(char *); /* * You are in a twisty maze of passages, all alike. * Geesh. */ #if defined(HAVE_FSTAB_H) && !defined(HAVE_MNTENT_H) /* { */ /* ** BSD (GETFSENT_BSD) */ #define GETFSENT_TYPE "BSD (Ultrix, AIX)" #include int open_fstab(void) { return setfsent(); } void close_fstab(void) { endfsent(); } int get_fstab_nextentry( generic_fsent_t * fsent) { struct fstab *sys_fsent = getfsent(); static char *xfsname = NULL, *xmntdir = NULL; static char *xfstype = NULL, *xmntopts = NULL; if(!sys_fsent) return 0; fsent->fsname = xfsname = newstralloc(xfsname, sys_fsent->fs_spec); fsent->mntdir = xmntdir = newstralloc(xmntdir, sys_fsent->fs_file); fsent->freq = sys_fsent->fs_freq; fsent->passno = sys_fsent->fs_passno; #ifdef STATFS_ULTRIX fsent->fstype = xfstype = newstralloc(xfstype, sys_fsent->fs_name); fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_opts); #else #if defined(_AIX) fsent->fstype = xfstype = newstralloc(xfstype, _("unknown")); fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_type); #else fsent->fstype = xfstype = newstralloc(xfstype, sys_fsent->fs_vfstype); fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_mntops); #endif #endif return 1; } #else #if defined(HAVE_SYS_VFSTAB_H) /* } { */ /* ** SVR4 (GETFSENT_SOLARIS) */ #define GETFSENT_TYPE "SVR4 (Solaris)" #include static FILE *fstabf = NULL; int open_fstab(void) { close_fstab(); return (fstabf = fopen(VFSTAB, "r")) != NULL; } void close_fstab(void) { if(fstabf) afclose(fstabf); fstabf = NULL; } int get_fstab_nextentry( generic_fsent_t * fsent) { struct vfstab sys_fsent; memset(&sys_fsent, 0, SIZEOF(sys_fsent)); if(getvfsent(fstabf, &sys_fsent) != 0) return 0; fsent->fsname = sys_fsent.vfs_special; fsent->fstype = sys_fsent.vfs_fstype; fsent->mntdir = sys_fsent.vfs_mountp; fsent->mntopts = sys_fsent.vfs_mntopts; fsent->freq = 1; /* N/A */ fsent->passno = sys_fsent.vfs_fsckpass? atoi(sys_fsent.vfs_fsckpass) : 0; return 1; } #else # if defined(HAVE_MNTENT_H) /* } { */ /* ** System V.3 (GETFSENT_SVR3, GETFSENT_LINUX) */ #define GETFSENT_TYPE "SVR3 (NeXTstep, Irix, Linux, HP-UX)" #include #if defined(HAVE_ENDMNTENT) #define AMCLOSE_MNTENT(x) endmntent(x) #else #define AMCLOSE_MNTENT(x) fclose(x) #endif static FILE *fstabf1 = NULL; /* /proc/mounts */ static FILE *fstabf2 = NULL; /* MOUNTED */ static FILE *fstabf3 = NULL; /* MNTTAB */ int open_fstab(void) { close_fstab(); #if defined(HAVE_SETMNTENT) fstabf1 = setmntent("/proc/mounts", "r"); # if defined(MOUNTED) fstabf2 = setmntent(MOUNTED, "r"); # endif # if defined(MNTTAB) fstabf3 = setmntent(MNTTAB, "r"); # endif #else # if defined(MNTTAB) fstabf3 = fopen(MNTTAB, "r"); # endif #endif return (fstabf1 != NULL || fstabf2 != NULL || fstabf3 != NULL); } void close_fstab(void) { if (fstabf1) { AMCLOSE_MNTENT(fstabf1); fstabf1 = NULL; } if (fstabf2) { AMCLOSE_MNTENT(fstabf2); fstabf2 = NULL; } if (fstabf3) { AMCLOSE_MNTENT(fstabf3); fstabf3 = NULL; } } int get_fstab_nextentry( generic_fsent_t * fsent) { struct mntent *sys_fsent = NULL; if(fstabf1) { sys_fsent = getmntent(fstabf1); if(!sys_fsent) { AMCLOSE_MNTENT(fstabf1); fstabf1 = NULL; } } if(!sys_fsent && fstabf2) { sys_fsent = getmntent(fstabf2); if(!sys_fsent) { AMCLOSE_MNTENT(fstabf2); fstabf2 = NULL; } } if(!sys_fsent && fstabf3) { sys_fsent = getmntent(fstabf3); if(!sys_fsent) { AMCLOSE_MNTENT(fstabf3); fstabf3 = NULL; } } if(!sys_fsent) { return 0; } fsent->fsname = sys_fsent->mnt_fsname; fsent->fstype = sys_fsent->mnt_type; fsent->mntdir = sys_fsent->mnt_dir; fsent->mntopts = sys_fsent->mnt_opts; fsent->freq = sys_fsent->mnt_freq; fsent->passno = sys_fsent->mnt_passno; return 1; } # else # if defined(HAVE_SYS_MNTTAB_H) || defined(STATFS_SCO_OS5) /* } { */ /* we won't actually include mnttab.h, since it contains nothing useful.. */ #define GETFSENT_TYPE "SVR3 (Interactive UNIX)" #include #include #include #define FSTAB "/etc/fstab" static FILE *fstabf = NULL; int open_fstab(void) { close_fstab(); return (fstabf = fopen(FSTAB, "r")) != NULL; } void close_fstab(void) { if(fstabf) afclose(fstabf); fstabf = NULL; } static generic_fsent_t _fsent; int get_fstab_nextentry( generic_fsent_t * fsent) { static char *lfsnam = NULL; static char *opts = NULL; static char *cp = NULL; char *s; int ch; amfree(cp); for (; (cp = agets(fstabf)) != NULL; free(cp)) { if (cp[0] == '\0') continue; fsent->fsname = strtok(cp, " \t"); if ( fsent->fsname && *fsent->fsname != '#' ) break; } if (cp == NULL) return 0; fsent->mntdir = strtok((char *)NULL, " \t"); fsent->mntopts = strtok((char *)NULL, " \t"); if ( *fsent->mntopts != '-' ) { fsent->fstype = fsent->mntopts; fsent->mntopts = "rw"; } else { fsent->fstype = ""; if (strcmp(fsent->mntopts, "-r") == 0) { fsent->mntopts = "ro"; } } if ((s = strchr(fsent->fstype, ',')) != NULL) { *s++ = '\0'; strappend(fsent->mntopts, ","); strappend(fsent->mntopts, s); } lfsnam = newstralloc(lfsnam, fsent->fstype); s = lfsnam; while((ch = *s++) != '\0') { if(isupper(ch)) ch = tolower(ch); s[-1] = ch; } fsent->fstype = lfsnam; if (strncmp_const(fsent->fstype, "hs") == 0) fsent->fstype = "iso9660"; fsent->freq = 0; fsent->passno = 0; return 1; } # else # if defined(HAVE_MNTTAB_H) /* } { */ #define GETFSENT_TYPE "SVR3 (SCO UNIX)" #include #include #include #define MNTTAB "/etc/mnttab" /* * If these are defined somewhere please let me know. */ #define MNT_READONLY 0101 #define MNT_READWRITE 0100 static FILE *fstabf = NULL; int open_fstab(void) { close_fstab(); return (fstabf = fopen(MNTTAB, "r")) != NULL; } void close_fstab(void) { if(fstabf) afclose(fstabf); fstabf = NULL; } static generic_fsent_t _fsent; int get_fstab_nextentry( generic_fsent_t *fsent) { struct statfs fsd; char typebuf[FSTYPSZ]; static struct mnttab mnt; char *dp, *ep; if(!fread (&mnt, SIZEOF(mnt), 1, fstabf)) return 0; fsent->fsname = mnt.mt_dev; fsent->mntdir = mnt.mt_filsys; fsent->fstype = ""; if (statfs (fsent->mntdir, &fsd, SIZEOF(fsd), 0) != -1 && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1) { dp = typebuf; ep = fsent->fstype = malloc(strlen(typebuf)+2); while (*dp) *ep++ = tolower(*dp++); *ep=0; } if ( mnt.mt_ro_flg == MNT_READONLY ) { fsent->mntopts = "ro"; } else { fsent->mntopts = "rw"; } fsent->freq = 0; fsent->passno = 0; return 1; } # else /* } { */ #define GETFSENT_TYPE "undefined" # endif # endif # endif #endif #endif /* } */ /* *===================================================================== * Convert either a block or character device name to a character (raw) * device name. * * static char *dev2rdev(const char *name); * * entry: name - device name to convert * exit: matching character device name if found, * otherwise returns the input * * The input must be an absolute path. * * The exit string area is always an alloc-d area that the caller is * responsible for releasing. *===================================================================== */ static char * dev2rdev( char * name) { char *fname = NULL; struct stat st; char *s; int ch; if(stat(name, &st) == 0 && !S_ISBLK(st.st_mode)) { /* * If the input is already a character device, just return it. */ return stralloc(name); } s = name; ch = *s++; if(ch == '\0' || ch != '/') return stralloc(name); ch = *s++; /* start after first '/' */ /* * Break the input path at each '/' and create a new name with an * 'r' before the right part. For instance: * * /dev/sd0a -> /dev/rsd0a * /dev/dsk/c0t0d0s0 -> /dev/rdsk/c0t0d0s0 -> /dev/dsk/rc0t0d0s0 */ while(ch) { if (ch == '/') { s[-1] = '\0'; fname = newvstralloc(fname, name, "/r", s, NULL); s[-1] = (char)ch; if(stat(fname, &st) == 0 && S_ISCHR(st.st_mode)) return fname; } ch = *s++; } amfree(fname); return stralloc(name); /* no match */ } #ifndef IGNORE_FSTAB static int samefile(struct stat[3], struct stat *); static int samefile( struct stat stats[3], struct stat *estat) { int i; for(i = 0; i < 3; ++i) { if (stats[i].st_dev == estat->st_dev && stats[i].st_ino == estat->st_ino) return 1; } return 0; } #endif /* !IGNORE_FSTAB */ int search_fstab( char * name, generic_fsent_t * fsent, int check_dev) { #ifdef IGNORE_FSTAB /* There is no real mount table so this will always fail and * we are using GNU tar so we can just return here. */ (void)name; /* Quiet unused parameter warning */ (void)fsent; /* Quiet unused parameter warning */ (void)check_dev; /* Quiet unused parameter warning */ return 0; #else struct stat stats[3]; char *fullname = NULL; char *rdev = NULL; int rc; if (!name) return 0; memset(stats, 0, SIZEOF(stats)); stats[0].st_dev = stats[1].st_dev = stats[2].st_dev = (dev_t)-1; if (stat(name, &stats[0]) == -1) stats[0].st_dev = (dev_t)-1; if (name[0] != '/') { fullname = stralloc2(DEV_PREFIX, name); if (stat(fullname, &stats[1]) == -1) stats[1].st_dev = (dev_t)-1; fullname = newstralloc2(fullname, RDEV_PREFIX, name); if (stat(fullname, &stats[2]) == -1) stats[2].st_dev = (dev_t)-1; amfree(fullname); } else if (stat((rdev = dev2rdev(name)), &stats[1]) == -1) stats[1].st_dev = (dev_t)-1; amfree(rdev); if (!open_fstab()) return 0; rc = 0; while(get_fstab_nextentry(fsent)) { struct stat mntstat; struct stat fsstat; struct stat fsrstat; int smnt = -1, sfs = -1, sfsr = -1; amfree(rdev); if(fsent->mntdir != NULL) smnt = stat(fsent->mntdir, &mntstat); if(fsent->fsname != NULL) { sfs = stat(fsent->fsname, &fsstat); sfsr = stat((rdev = dev2rdev(fsent->fsname)), &fsrstat); if(check_dev == 1 && sfs == -1 && sfsr == -1) continue; } if((fsent->mntdir != NULL && smnt != -1 && samefile(stats, &mntstat)) || (fsent->fsname != NULL && sfs != -1 && samefile(stats, &fsstat)) || (fsent->fsname != NULL && sfsr != -1 && samefile(stats, &fsrstat))) { rc = 1; break; } } amfree(rdev); close_fstab(); return rc; #endif /* !IGNORE_FSTAB */ } int is_local_fstype( generic_fsent_t * fsent) { if(fsent->fstype == NULL) /* unknown, assume local */ return 1; /* just eliminate fstypes known to be remote or unsavable */ return strcmp(fsent->fstype, "nfs") != 0 && /* NFS */ strcmp(fsent->fstype, "afs") != 0 && /* Andrew Filesystem */ strcmp(fsent->fstype, "swap") != 0 && /* Swap */ strcmp(fsent->fstype, "iso9660") != 0 && /* CDROM */ strcmp(fsent->fstype, "hs") != 0 && /* CDROM */ strcmp(fsent->fstype, "piofs") != 0; /* an AIX printer thing? */ } char * amname_to_devname( char * str) { generic_fsent_t fsent; if(search_fstab(str, &fsent, 1) && fsent.fsname != NULL) str = fsent.fsname; else if(search_fstab(str, &fsent, 0) && fsent.fsname != NULL) str = fsent.fsname; return dev2rdev(str); } char * amname_to_dirname( char * str) { generic_fsent_t fsent; if(search_fstab(str, &fsent, 1) && fsent.mntdir != NULL) str = fsent.mntdir; else if(search_fstab(str, &fsent, 0) && fsent.mntdir != NULL) str = fsent.mntdir; return stralloc(str); } char *amname_to_fstype( char * str) { generic_fsent_t fsent; if (!search_fstab(str, &fsent, 1) && !search_fstab(str, &fsent, 0)) return stralloc(""); return stralloc(fsent.fstype); } #ifdef TEST void print_entry(generic_fsent_t *fsent); void print_entry( generic_fsent_t * fsent) { #define nchk(s) ((s)? (s) : "") g_printf("%-20.20s %-14.14s %-7.7s %4d %5d %s\n", nchk(fsent->fsname), nchk(fsent->mntdir), nchk(fsent->fstype), fsent->freq, fsent->passno, nchk(fsent->mntopts)); } int main( int argc, char ** argv) { generic_fsent_t fsent; char *s; char *name = NULL; /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); set_pname("getfsent"); dbopen(NULL); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); if(!open_fstab()) { g_fprintf(stderr, _("getfsent_test: could not open fstab\n")); return 1; } g_printf("getfsent (%s)\n",GETFSENT_TYPE); g_printf("l/r fsname mntdir fstype freq pass# mntopts\n"); while(get_fstab_nextentry(&fsent)) { g_printf("%c ",is_local_fstype(&fsent)? 'l' : 'r'); print_entry(&fsent); } g_printf("--------\n"); close_fstab(); name = newstralloc(name, "/usr"); if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { g_printf(_("Found %s mount for %s:\n"), is_local_fstype(&fsent)? _("local") : _("remote"), name); print_entry(&fsent); } else g_printf(_("Mount for %s not found\n"), name); name = newstralloc(name, "/"); if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { g_printf(_("Found %s mount for %s:\n"), is_local_fstype(&fsent)? _("local") : _("remote"), name); print_entry(&fsent); } else g_printf(_("Mount for %s not found\n"), name); name = newstralloc(name, "/"); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/dev/root"); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/usr"); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "c0t3d0s0"); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/tmp/foo"); s = amname_to_devname(name); g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "./foo"); s = amname_to_devname(name); g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); while (--argc > 0) { name = newstralloc(name, *++argv); s = amname_to_devname(name); g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); } amfree(name); dbclose(); return 0; } #endif amanda-3.3.6/client-src/findpass.h0000664000076400007640000000336212357250002020463 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: findpass.h,v 1.7 2006/05/25 01:47:11 johnfranks Exp $ * * interface to findpass module */ #ifndef FINDPASS_H #define FINDPASS_H #include "amanda.h" extern char *findpass(char *disk, char **domain); extern char *makesharename(char *disk, int shell); void parsesharename(char *disk, char **share, char **subdir); #endif amanda-3.3.6/client-src/patch-system.sh0000664000076400007640000001166512357250002021465 0ustar00martineamartinea00000000000000#! @SHELL@ # # patch inetd.conf and services # originally by Axel Zinser (fifi@hiss.han.de) # prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" amlibexecdir="@amlibexecdir@" . "${amlibexecdir}/amanda-sh-lib.sh" SERVICE_SUFFIX="@SERVICE_SUFFIX@" USER="@CLIENT_LOGIN@" INETDCONF=/etc/inetd.conf [ ! -f $INETDCONF ] && INETDCONF=/usr/etc/inetd.conf SERVICES=/etc/services [ ! -f $SERVICES ] && SERVICES=/usr/etc/services ENABLE_AMANDAD=true case `uname -n` in "@DEFAULT_SERVER@" | "@DEFAULT_SERVER@".*) ENABLE_INDEX=true ENABLE_TAPE=true ;; *) ENABLE_INDEX=false ENABLE_TAPE=false ;; esac CLIENT_PORT=10080 KCLIENT_PORT=10081 INDEX_PORT=10082 TAPE_PORT=10083 while [ $# != 0 ]; do case "$1" in --service-suffix=*) SERVICE_SUFFIX=`echo $1 | sed -e 's/[^=]*=//'`;; --version-suffix=*) SUF=`echo $1 | sed -e 's/[^=]*=//'`;; --inetd=*) INETDCONF=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;; --services=*) SERVICES=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;; --libexecdir=?*) libexecdir=`echo $1 | sed -e 's/[^=]*=//'`;; --user=?*) USER=`echo $1 | sed -e 's/[^=]*=//'`;; --enable-client) ENABLE_AMANDAD=true;; --disable-client) ENABLE_AMANDAD=false;; --enable-index) ENABLE_INDEX=true;; --disable-index) ENABLE_INDEX=false;; --enable-tape) ENABLE_TAPE=true;; --disable-tape) ENABLE_TAPE=false;; --client-port=?*) CLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;; --kclient-port=?*) KCLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;; --index-port=?*) INDEX_PORT=`echo $1 | sed -e 's/[^=]*=//'`;; --tape-port=?*) TAPE_PORT=`echo $1 | sed -e 's/[^=]*=//'`;; --usage | --help | -h) echo `_ 'call this script with zero or more of the following arguments:'` echo `_ '--version-suffix=: deprecated option' ""` echo `_ '--service-suffix=: append to service names [%s]' "$SERVICE_SUFFIX"` echo `_ '--libexecdir=: where daemons should be looked for [%s]' "$libexecdir"` echo `_ '--inetd=: full pathname of inetd.conf [%s]' "$INETDCONF"` echo `_ '--services=: full pathname of services [%s]' "$SERVICES"` echo `_ '\tan empty pathname or /dev/null causes that file to be skipped'` echo `_ '--user=: run deamons as this user [%s]' "$USER"` echo `_ '--enable/disable-client: enable/disable amandad [%s]' \`$ENABLE_AMANDAD && echo enabled || echo disabled\`` echo `_ '--enable/disable-index: enable/disable index server [%s]' \`$ENABLE_INDEX && echo enabled || echo disabled\`` echo `_ '--enable/disable-tape: enable/disable tape server [%s]' \`$ENABLE_TAPE && echo enabled || echo disabled\`` echo `_ '--client-port=: amandad port number [%s]' "$CLIENT_PORT"` echo `_ '--kclient-port=: kamandad port number [%s]' "$KCLIENT_PORT"` echo `_ '--index-port=: index server port number [%s]' "$INDEX_PORT"` echo `_ '--tape-port=: tape server port number [%s]' "$TAPE_PORT"` exec true;; *) echo `_ '%s: invalid argument %s. run with -h for usage\n' "$0" "$1"` >&2 exec false;; esac shift done if [ "$SERVICES" = /dev/null ]; then : elif [ -f "$SERVICES" ]; then TEMP="$SERVICES.new" { egrep < "$SERVICES" -v "^(amanda|kamanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[ ]" echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/udp" echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/tcp" echo "kamanda${SERVICE_SUFFIX} ${KCLIENT_PORT}/udp" echo "amandaidx${SERVICE_SUFFIX} ${INDEX_PORT}/tcp" echo "amidxtape${SERVICE_SUFFIX} ${TAPE_PORT}/tcp" } > "$TEMP" if diff "$SERVICES" "$TEMP" >/dev/null 2>/dev/null; then echo `_ '%s is up to date' "$SERVICES"` else cp "$TEMP" "$SERVICES" || echo `_ 'cannot patch %s' "$SERVICES"` fi rm -f "$TEMP" else echo `_ '%s not found!' "$SERVICES"` fi if [ "$INETDCONF" = /dev/null ]; then : elif [ -f "$INETDCONF" ]; then err=`_ 'warning: %s/amandad%s does not exist' "$libexecdir" ""` $ENABLE_AMANDAD && test ! -f $libexecdir/amandad && echo "$err" >&2 err=`_ 'warning: %s/amindexd%s does not exist' "$libexecdir" ""` $ENABLE_INDEX && test ! -f $libexecdir/amindexd && echo "$err" >&2 err=`_ 'warning: %s/amidxtaped%s does not exist' "$libexecdir" ""` $ENABLE_TAPE && test ! -f $libexecdir/amidxtaped && echo "$err" >&2 TEMP="$INETDCONF.new" { egrep < "$INETDCONF" -v "^(amanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[ ]" $ENABLE_AMANDAD && echo "amanda${SERVICE_SUFFIX} dgram udp wait $USER $libexecdir/amandad amandad" $ENABLE_INDEX && echo "amandaidx${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amindexd amindexd" $ENABLE_TAPE && echo "amidxtape${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amidxtaped amidxtaped" } > "$TEMP" if diff "$INETDCONF" "$TEMP" >/dev/null 2>/dev/null; then fmt="%s is up to date\n" printf $fmt $INETDCONF else fmt="cannot patch %s\n" cp "$TEMP" "$INETDCONF" || printf $fmt $INETDCONF fi rm -f "$TEMP" else fmt="%s not found!\n" printf $fmt $INETDCONF fi amanda-3.3.6/client-src/sendbackup-gnutar.c0000664000076400007640000004621012357250002022263 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1999 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: sendbackup-gnutar.c,v 1.98 2006/07/25 18:35:21 martinea Exp $ * * send backup data using GNU tar */ #include "amanda.h" #include "sendbackup.h" #include "amandates.h" #include "clock.h" #include "util.h" #include "getfsent.h" /* for amname_to_dirname lookup */ #include "conffile.h" #ifdef SAMBA_CLIENT #include "findpass.h" #endif static amregex_t re_table[] = { /* tar prints the size in bytes */ AM_SIZE_RE("^ *Total bytes written: [0-9][0-9]*", 1, 1), AM_NORMAL_RE("^Elapsed time:"), AM_NORMAL_RE("^Throughput"), /* GNU tar 1.13.17 will print this warning when (not) backing up a Unix named socket. */ AM_NORMAL_RE(": socket ignored$"), /* GNUTAR produces a few error messages when files are modified or removed while it is running. They may cause data to be lost, but then they may not. We shouldn't consider them NORMAL until further investigation. */ #ifdef IGNORE_TAR_ERRORS AM_NORMAL_RE(": File .* shrunk by [0-9][0-9]* bytes, padding with zeros"), AM_NORMAL_RE(": Cannot add file .*: No such file or directory$"), AM_NORMAL_RE(": Error exit delayed from previous errors"), #endif /* samba may produce these output messages */ AM_NORMAL_RE("^[Aa]dded interface"), AM_NORMAL_RE("^session request to "), AM_NORMAL_RE("^tar: dumped [0-9][0-9]* (tar )?files"), #if SAMBA_VERSION < 2 AM_NORMAL_RE("^doing parameter"), AM_NORMAL_RE("^pm_process\\(\\)"), AM_NORMAL_RE("^adding IPC"), AM_NORMAL_RE("^Opening"), AM_NORMAL_RE("^Connect"), AM_NORMAL_RE("^Domain="), AM_NORMAL_RE("^max"), AM_NORMAL_RE("^security="), AM_NORMAL_RE("^capabilities"), AM_NORMAL_RE("^Sec mode "), AM_NORMAL_RE("^Got "), AM_NORMAL_RE("^Chose protocol "), AM_NORMAL_RE("^Server "), AM_NORMAL_RE("^Timezone "), AM_NORMAL_RE("^received"), AM_NORMAL_RE("^FINDFIRST"), AM_NORMAL_RE("^FINDNEXT"), AM_NORMAL_RE("^dos_clean_name"), AM_NORMAL_RE("^file"), AM_NORMAL_RE("^getting file"), AM_NORMAL_RE("^Rejected chained"), AM_NORMAL_RE("^nread="), AM_NORMAL_RE("^\\([0-9][0-9]* kb/s\\)"), AM_NORMAL_RE("^\\([0-9][0-9]*\\.[0-9][0-9]* kb/s\\)"), AM_NORMAL_RE("^[ \t]*[0-9][0-9]* \\([ \t]*[0-9][0-9]*\\.[0-9][0-9]* kb/s\\)"), AM_NORMAL_RE("^[ \t]*directory "), AM_NORMAL_RE("^load_client_codepage"), #endif #ifdef IGNORE_SMBCLIENT_ERRORS /* This will cause amanda to ignore real errors, but that may be * unavoidable when you're backing up system disks. It seems to be * a safe thing to do if you know what you're doing. */ AM_NORMAL_RE("^ERRDOS - ERRbadshare opening remote file"), AM_NORMAL_RE("^ERRDOS - ERRbadfile opening remote file"), AM_NORMAL_RE("^ERRDOS - ERRnoaccess opening remote file"), AM_NORMAL_RE("^ERRSRV - ERRaccess setting attributes on file"), AM_NORMAL_RE("^ERRDOS - ERRnoaccess setting attributes on file"), #endif #if SAMBA_VERSION >= 2 /* Backup attempt of nonexisting directory */ AM_ERROR_RE("ERRDOS - ERRbadpath (Directory invalid.)"), AM_NORMAL_RE("^Domain="), #endif /* catch-all: DMP_STRANGE is returned for all other lines */ AM_STRANGE_RE(NULL) }; extern char *efile; int cur_level; char *cur_disk; time_t cur_dumptime; static char *gnutar_list_dir = NULL; static char *incrname = NULL; /* * doing similar to $ gtar | compression | encryption */ static void start_backup( dle_t *dle, char *host, int dataf, int mesgf, int indexf) { char tmppath[PATH_MAX]; int dumpin, dumpout, compout; char *cmd = NULL; char *indexcmd = NULL; char *dirname = NULL; int l; char dumptimestr[80] = "UNUSED"; struct tm *gmtm; amandates_t *amdates = NULL; time_t prev_dumptime = 0; char *error_pn = NULL; char *compopt = NULL; char *encryptopt = skip_argument; char *tquoted; char *fquoted; char *qdisk; int infd, outfd; ssize_t nb; char buf[32768]; char *amandates_file = NULL; am_level_t *alevel = (am_level_t *)dle->levellist->data; int level = alevel->level; error_pn = stralloc2(get_pname(), "-smbclient"); qdisk = quote_string(dle->disk); dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), get_pname(), host, qdisk, level); /* apply client-side encryption here */ if ( dle->encrypt == ENCRYPT_CUST ) { encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, &compout, &dataf, &mesgf, dle->clnt_encrypt, encryptopt, NULL); dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); } else { compout = dataf; encpid = -1; } /* now do the client-side compression */ if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { compopt = skip_argument; #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) if(dle->compress == COMP_BEST) { compopt = COMPRESS_BEST_OPT; } else { compopt = COMPRESS_FAST_OPT; } #endif comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); dbprintf(_("gnutar: pid %ld: %s"), (long)comppid, COMPRESS_PATH); if(compopt != skip_argument) { dbprintf(_("pid %ld: %s %s\n"), (long)comppid, COMPRESS_PATH, compopt); } else { dbprintf(_("pid %ld: %s\n"), (long)comppid, COMPRESS_PATH); } } else if (dle->compress == COMP_CUST) { compopt = skip_argument; comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, dle->compprog, compopt, NULL); if(compopt != skip_argument) { dbprintf(_("pid %ld: %s %s\n"), (long)comppid, dle->compprog, compopt); } else { dbprintf(_("pid %ld: %s\n"), (long)comppid, dle->compprog); } } else { dumpout = compout; comppid = -1; } gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (strlen(gnutar_list_dir) == 0) gnutar_list_dir = NULL; #ifdef SAMBA_CLIENT /* { */ if (dle->device[0] == '/' && dle->device[1]=='/') amfree(incrname); else #endif /* } */ if (gnutar_list_dir) { char *basename = NULL; char number[NUM_STR_SIZE]; char *inputname = NULL; int baselevel; char *sdisk = sanitise_filename(dle->disk); basename = vstralloc(gnutar_list_dir, "/", host, sdisk, NULL); amfree(sdisk); g_snprintf(number, SIZEOF(number), "%d", level); incrname = vstralloc(basename, "_", number, ".new", NULL); unlink(incrname); /* * Open the listed incremental file from the previous level. Search * backward until one is found. If none are found (which will also * be true for a level 0), arrange to read from /dev/null. */ baselevel = level; infd = -1; while (infd == -1) { if (--baselevel >= 0) { g_snprintf(number, SIZEOF(number), "%d", baselevel); inputname = newvstralloc(inputname, basename, "_", number, NULL); } else { inputname = newstralloc(inputname, "/dev/null"); } if ((infd = open(inputname, O_RDONLY)) == -1) { int save_errno = errno; char *qname = quote_string(inputname); dbprintf(_("gnutar: error opening '%s': %s\n"), qname, strerror(save_errno)); if (baselevel < 0) { error(_("error [opening '%s': %s]"), qname, strerror(save_errno)); /*NOTREACHED*/ } amfree(qname); } } /* * Copy the previous listed incremental file to the new one. */ if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) { error(_("error [opening '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { if (full_write(outfd, &buf, (size_t)nb) < (size_t)nb) { error(_("error [writing to '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } } if (nb < 0) { error(_("error [reading from '%s': %s]"), inputname, strerror(errno)); /*NOTREACHED*/ } if (close(infd) != 0) { error(_("error [closing '%s': %s]"), inputname, strerror(errno)); /*NOTREACHED*/ } if (close(outfd) != 0) { error(_("error [closing '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } tquoted = quote_string(incrname); if(baselevel >= 0) { fquoted = quote_string(inputname); dbprintf(_("doing level %d dump as listed-incremental from '%s' to '%s'\n"), level, fquoted, tquoted); amfree(fquoted); } else { dbprintf(_("doing level %d dump as listed-incremental to '%s'\n"), level, tquoted); } amfree(tquoted); amfree(inputname); amfree(basename); } else { /* no gnutar-listdir, so we're using amandates */ /* find previous dump time, failing completely if there's a problem */ amandates_file = getconf_str(CNF_AMANDATES); if(!start_amandates(amandates_file, 0)) { error(_("error [opening %s: %s]"), amandates_file, strerror(errno)); /*NOTREACHED*/ } amdates = amandates_lookup(dle->disk); prev_dumptime = EPOCH; for(l = 0; l < level; l++) { if(amdates->dates[l] > prev_dumptime) prev_dumptime = amdates->dates[l]; } finish_amandates(); free_amandates(); gmtm = gmtime(&prev_dumptime); g_snprintf(dumptimestr, SIZEOF(dumptimestr), "%04d-%02d-%02d %2d:%02d:%02d GMT", gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); dbprintf(_("gnutar: doing level %d dump from amandates-derived date: %s\n"), level, dumptimestr); } dirname = amname_to_dirname(dle->device); cur_dumptime = time(0); cur_level = level; cur_disk = stralloc(dle->disk); #ifdef GNUTAR # define PROGRAM_GNUTAR GNUTAR #else # define PROGRAM_GNUTAR "tar" #endif indexcmd = vstralloc( PROGRAM_GNUTAR, " -tf", " -", " 2>/dev/null", " | sed", " -e", " \'s/^\\.//\'", NULL); #ifdef SAMBA_CLIENT /* { */ /* Use sambatar if the disk to back up is a PC disk */ if (dle->device[0] == '/' && dle->device[1]=='/') { char *sharename = NULL, *user_and_password = NULL, *domain = NULL; char *share = NULL, *subdir = NULL; char *pwtext = NULL; char *taropt; int passwdf = -1; size_t lpass; size_t pwtext_len; char *pw_fd_env; parsesharename(dle->device, &share, &subdir); if (!share) { amfree(share); amfree(subdir); set_pname(error_pn); amfree(error_pn); error(_("cannot parse disk entry %s for share/subdir"), qdisk); /*NOTREACHED*/ } if ((subdir) && (SAMBA_VERSION < 2)) { amfree(share); amfree(subdir); set_pname(error_pn); amfree(error_pn); error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk); /*NOTREACHED*/ } if ((user_and_password = findpass(share, &domain)) == NULL) { if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("error [invalid samba host or password not found?]")); /*NOTREACHED*/ } lpass = strlen(user_and_password); if ((pwtext = strchr(user_and_password, '%')) == NULL) { memset(user_and_password, '\0', lpass); amfree(user_and_password); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("password field not \'user%%pass\' for %s"), qdisk); /*NOTREACHED*/ } *pwtext++ = '\0'; pwtext_len = strlen(pwtext); if ((sharename = makesharename(share, 0)) == 0) { memset(user_and_password, '\0', lpass); amfree(user_and_password); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("error [can't make share name of %s]"), share); /*NOTREACHED*/ } taropt = stralloc("-T"); if(dle->exclude_file && dle->exclude_file->nb_element == 1) { strappend(taropt, "X"); } #if SAMBA_VERSION >= 2 strappend(taropt, "q"); #endif strappend(taropt, "c"); if (level != 0) { strappend(taropt, "g"); } else if (dle->record) { strappend(taropt, "a"); } if (subdir) { dbprintf(_("gnutar: backup of %s/%s\n"), sharename, subdir); } else { dbprintf(_("gnutar: backup of %s\n"), sharename); } program->backup_name = program->restore_name = SAMBA_CLIENT; cmd = stralloc(program->backup_name); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); if (pwtext_len > 0) { pw_fd_env = "PASSWD_FD"; } else { pw_fd_env = "dummy_PASSWD_FD"; } dumppid = pipespawn(cmd, STDIN_PIPE|PASSWD_PIPE, 0, &dumpin, &dumpout, &mesgf, pw_fd_env, &passwdf, "smbclient", sharename, *user_and_password ? "-U" : skip_argument, *user_and_password ? user_and_password : skip_argument, "-E", domain ? "-W" : skip_argument, domain ? domain : skip_argument, #if SAMBA_VERSION >= 2 subdir ? "-D" : skip_argument, subdir ? subdir : skip_argument, #endif "-d0", taropt, "-", dle->exclude_file && dle->exclude_file->nb_element == 1 ? dle->exclude_file->first->name : skip_argument, NULL); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } if(pwtext_len > 0 && full_write(passwdf, pwtext, pwtext_len) < pwtext_len) { int save_errno = errno; aclose(passwdf); memset(user_and_password, '\0', lpass); amfree(user_and_password); set_pname(error_pn); amfree(error_pn); error(_("error [password write failed: %s]"), strerror(save_errno)); /*NOTREACHED*/ } memset(user_and_password, '\0', lpass); amfree(user_and_password); aclose(passwdf); amfree(sharename); amfree(share); amfree(subdir); amfree(taropt); tarpid = dumppid; } else #endif /*end of samba */ { int nb_exclude = 0; int nb_include = 0; GPtrArray *argv_ptr = g_ptr_array_new(); char *file_exclude = NULL; char *file_include = NULL; if (dle->exclude_file) nb_exclude+=dle->exclude_file->nb_element; if (dle->exclude_list) nb_exclude+=dle->exclude_list->nb_element; if (dle->include_file) nb_include+=dle->include_file->nb_element; if (dle->include_list) nb_include+=dle->include_list->nb_element; if (nb_exclude > 0) file_exclude = build_exclude(dle, 0); if (nb_include > 0) file_include = build_include(dle, 0); cmd = vstralloc(amlibexecdir, "/", "runtar", NULL); info_tapeheader(dle); start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); g_ptr_array_add(argv_ptr, stralloc("runtar")); if (g_options->config) g_ptr_array_add(argv_ptr, stralloc(g_options->config)); else g_ptr_array_add(argv_ptr, stralloc("NOCONFIG")); #ifdef GNUTAR g_ptr_array_add(argv_ptr, stralloc(GNUTAR)); #else g_ptr_array_add(argv_ptr, stralloc("tar")); #endif g_ptr_array_add(argv_ptr, stralloc("--create")); g_ptr_array_add(argv_ptr, stralloc("--file")); g_ptr_array_add(argv_ptr, stralloc("-")); g_ptr_array_add(argv_ptr, stralloc("--directory")); canonicalize_pathname(dirname, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); g_ptr_array_add(argv_ptr, stralloc("--one-file-system")); if (gnutar_list_dir && incrname) { g_ptr_array_add(argv_ptr, stralloc("--listed-incremental")); g_ptr_array_add(argv_ptr, stralloc(incrname)); } else { g_ptr_array_add(argv_ptr, stralloc("--incremental")); g_ptr_array_add(argv_ptr, stralloc("--newer")); g_ptr_array_add(argv_ptr, stralloc(dumptimestr)); } #ifdef ENABLE_GNUTAR_ATIME_PRESERVE /* --atime-preserve causes gnutar to call * utime() after reading files in order to * adjust their atime. However, utime() * updates the file's ctime, so incremental * dumps will think the file has changed. */ g_ptr_array_add(argv_ptr, stralloc("--atime-preserve")); #endif g_ptr_array_add(argv_ptr, stralloc("--sparse")); g_ptr_array_add(argv_ptr, stralloc("--ignore-failed-read")); g_ptr_array_add(argv_ptr, stralloc("--totals")); if(file_exclude) { g_ptr_array_add(argv_ptr, stralloc("--exclude-from")); g_ptr_array_add(argv_ptr, stralloc(file_exclude)); } if(file_include) { g_ptr_array_add(argv_ptr, stralloc("--files-from")); g_ptr_array_add(argv_ptr, stralloc(file_include)); } else { g_ptr_array_add(argv_ptr, stralloc(".")); } g_ptr_array_add(argv_ptr, NULL); dumppid = pipespawnv(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, (char **)argv_ptr->pdata); tarpid = dumppid; amfree(file_exclude); amfree(file_include); g_ptr_array_free_full(argv_ptr); } dbprintf(_("gnutar: %s: pid %ld\n"), cmd, (long)dumppid); amfree(qdisk); amfree(dirname); amfree(cmd); amfree(indexcmd); amfree(error_pn); /* close the write ends of the pipes */ aclose(dumpin); aclose(dumpout); aclose(compout); aclose(dataf); aclose(mesgf); if (dle->create_index) aclose(indexf); } static void end_backup( dle_t *dle, int goterror) { char *amandates_file = NULL; if(dle->record && !goterror) { if (incrname != NULL && strlen(incrname) > 4) { char *nodotnew; nodotnew = stralloc(incrname); nodotnew[strlen(nodotnew)-4] = '\0'; if (rename(incrname, nodotnew)) { g_fprintf(stderr, _("%s: warning [renaming %s to %s: %s]\n"), get_pname(), incrname, nodotnew, strerror(errno)); } amfree(nodotnew); amfree(incrname); } /* update the amandates file */ amandates_file = getconf_str(CNF_AMANDATES); if(start_amandates(amandates_file, 1)) { amandates_updateone(cur_disk, cur_level, cur_dumptime); finish_amandates(); free_amandates(); } else { /* failure is only fatal if we didn't get a gnutar-listdir */ char *gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (!gnutar_list_dir || !*gnutar_list_dir) { error(_("error [opening %s for writing: %s]"), amandates_file, strerror(errno)); /* NOTREACHED */ } else { g_debug(_("non-fatal error opening '%s' for writing: %s]"), amandates_file, strerror(errno)); } } } } backup_program_t gnutar_program = { "GNUTAR", #ifdef GNUTAR GNUTAR, GNUTAR, #else "gtar", "gtar", #endif re_table, start_backup, end_backup }; amanda-3.3.6/client-src/sendsize.c0000664000076400007640000021352412357250002020476 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: sendsize.c 10421 2008-03-06 18:48:30Z martineau $ * * send estimated backup sizes using dump */ #include "amanda.h" #include "match.h" #include "pipespawn.h" #include "amfeatures.h" #include "amandates.h" #include "clock.h" #include "util.h" #include "getfsent.h" #include "client_util.h" #include "conffile.h" #ifdef SAMBA_CLIENT #include "findpass.h" #endif #define sendsize_debug(i, ...) do { \ if ((i) <= debug_sebdsize) { \ dbprintf(__VA_ARGS__); \ } \ } while (0) #ifdef HAVE_SETPGID # define SETPGRP setpgid(getpid(), getpid()) # define SETPGRP_FAILED() do { \ dbprintf(_("setpgid(%ld,%ld) failed: %s\n"), \ (long)getpid(), (long)getpid(), strerror(errno)); \ } while(0) #else /* () line 0 */ #if defined(SETPGRP_VOID) # define SETPGRP setpgrp() # define SETPGRP_FAILED() do { \ dbprintf(_("setpgrp() failed: %s\n"), strerror(errno)); \ } while(0) #else # define SETPGRP setpgrp(0, getpid()) # define SETPGRP_FAILED() do { \ dbprintf(_("setpgrp(0,%ld) failed: %s\n"), \ (long)getpid(), strerror(errno)); \ } while(0) #endif #endif typedef struct level_estimates_s { time_t dumpsince; int estsize; int needestimate; int server; /* server can do estimate */ } level_estimate_t; typedef struct disk_estimates_s { struct disk_estimates_s *next; char *qamname; char *qamdevice; char *dirname; char *qdirname; pid_t child; int done; dle_t *dle; level_estimate_t est[DUMP_LEVELS]; } disk_estimates_t; disk_estimates_t *est_list; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; static g_option_t *g_options = NULL; static gboolean amandates_started = FALSE; /* local functions */ int main(int argc, char **argv); void dle_add_diskest(dle_t *dle); void calc_estimates(disk_estimates_t *est); void free_estimates(disk_estimates_t *est); void dump_calc_estimates(disk_estimates_t *); void star_calc_estimates(disk_estimates_t *); void smbtar_calc_estimates(disk_estimates_t *); void gnutar_calc_estimates(disk_estimates_t *); void application_api_calc_estimate(disk_estimates_t *); void generic_calc_estimates(disk_estimates_t *); int main( int argc, char ** argv) { int level; char *dumpdate; disk_estimates_t *est; disk_estimates_t *est1; disk_estimates_t *est_prev; disk_estimates_t *est_next; char *line = NULL; char *s, *fp; int ch; char *err_extra = NULL; int done; int need_wait; int dumpsrunning; char *qdisk = NULL; char *qlist = NULL; char *qamdevice = NULL; dle_t *dle; GSList *errlist; am_level_t *alevel; (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("sendsize-%s\n", VERSION); return (0); } /* initialize */ /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); openbsd_fd_inform(); safe_cd(); set_pname("sendsize"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); add_amanda_log_handler(amanda_log_stderr); add_amanda_log_handler(amanda_log_syslog); dbopen(DBG_SUBDIR_CLIENT); startclock(); dbprintf(_("version %s\n"), VERSION); our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); config_init(CONFIG_INIT_CLIENT, NULL); /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); /* handle all service requests */ for(; (line = agets(stdin)) != NULL; free(line)) { if (line[0] == '\0') continue; if(strncmp_const(line, "OPTIONS ") == 0) { g_options = parse_g_options(line+8, 1); if(!g_options->hostname) { g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1); gethostname(g_options->hostname, MAX_HOSTNAME_LENGTH); g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0'; } g_printf("OPTIONS "); if(am_has_feature(g_options->features, fe_rep_options_features)) { g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_maxdumps)) { g_printf("maxdumps=%d;", g_options->maxdumps); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { g_printf("hostname=%s;", g_options->hostname); } g_printf("\n"); fflush(stdout); if (g_options->config) { /* overlay this configuration on the existing (nameless) configuration */ config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); dbrename(get_config_name(), DBG_SUBDIR_CLIENT); } /* check for any config errors now */ if (config_errors(&errlist) >= CFGERR_ERRORS) { char *errstr = config_errors_to_error_string(errlist); g_printf("%s\n", errstr); dbclose(); return 1; } if (am_has_feature(g_options->features, fe_req_xml)) { break; } continue; } dle = alloc_dle(); s = line; ch = *s++; skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { err_extra = stralloc(_("no program name")); goto err; /* no program name */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; dle->program_is_application_api=0; if(strncmp_const(dle->program, "CALCSIZE") == 0) { skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { err_extra = stralloc(_("no program name")); goto err; } dle->estimatelist = g_slist_append(dle->estimatelist, GINT_TO_POINTER(ES_CALCSIZE)); dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; if (strcmp(dle->program,"APPLICATION") == 0) { dle->program_is_application_api=1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; } } else { dle->estimatelist = g_slist_append(dle->estimatelist, GINT_TO_POINTER(ES_CLIENT)); if (strcmp(dle->program,"APPLICATION") == 0) { dle->program_is_application_api=1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; } } dle->program = stralloc(dle->program); skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { err_extra = stralloc(_("no disk name")); goto err; /* no disk name */ } if (qdisk != NULL) amfree(qdisk); fp = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the disk name */ qdisk = stralloc(fp); dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { err_extra = stralloc(_("bad level")); goto err; } if(!isdigit((int)s[-1])) { fp = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; qamdevice = stralloc(fp); dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { dle->device = stralloc(dle->disk); qamdevice = stralloc(qdisk); } /* find the level number */ if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { err_extra = stralloc(_("bad level")); goto err; /* bad level */ } if (level < 0 || level >= DUMP_LEVELS) { err_extra = stralloc(_("bad level")); goto err; } skip_integer(s, ch); alevel = g_new0(am_level_t, 1); alevel->level = level; dle->levellist = g_slist_append(dle->levellist, alevel); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { err_extra = stralloc(_("no dumpdate")); goto err; /* no dumpdate */ } dumpdate = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; (void)dumpdate; /* XXX: Set but not used */ dle->spindle = 0; /* default spindle */ skip_whitespace(s, ch); /* find the spindle */ if(ch != '\0') { if(sscanf(s - 1, "%d", &dle->spindle) != 1) { err_extra = stralloc(_("bad spindle")); goto err; /* bad spindle */ } skip_integer(s, ch); skip_whitespace(s, ch); /* find the parameters */ if(ch != '\0') { if(strncmp_const(s-1, "OPTIONS |;") == 0) { parse_options(s + 8, dle, g_options->features, 0); } else { while (ch != '\0') { if(strncmp_const(s-1, "exclude-file=") == 0) { qlist = unquote_string(s+12); dle->exclude_file = append_sl(dle->exclude_file, qlist); amfree(qlist); } else if(strncmp_const(s-1, "exclude-list=") == 0) { qlist = unquote_string(s+12); dle->exclude_list = append_sl(dle->exclude_list, qlist); amfree(qlist); } else if(strncmp_const(s-1, "include-file=") == 0) { qlist = unquote_string(s+12); dle->include_file = append_sl(dle->include_file, qlist); amfree(qlist); } else if(strncmp_const(s-1, "include-list=") == 0) { qlist = unquote_string(s+12); dle->include_list = append_sl(dle->include_list, qlist); amfree(qlist); } else { err_extra = vstrallocf(_("Invalid parameter (%s)"), s-1); goto err; /* should have gotten to end */ } skip_quoted_string(s, ch); skip_whitespace(s, ch); /* find the inclusion list */ amfree(qlist); } } } } /*@ignore@*/ dle_add_diskest(dle); /*@end@*/ } if (g_options == NULL) { g_printf(_("ERROR [Missing OPTIONS line in sendsize input]\n")); error(_("Missing OPTIONS line in sendsize input\n")); /*NOTREACHED*/ } amfree(line); if (am_has_feature(g_options->features, fe_req_xml)) { char *errmsg = NULL; dle_t *dles, *dle; dles = amxml_parse_node_FILE(stdin, &errmsg); if (errmsg) { err_extra = errmsg; goto err; } for (dle = dles; dle != NULL; dle = dle->next) { dle_add_diskest(dle); } } if (amandates_started) { finish_amandates(); free_amandates(); amandates_started = FALSE; } est_prev = NULL; for(est = est_list; est != NULL; est = est_next) { int good = merge_dles_properties(est->dle, 0); est_next = est->next; if (!good) { if (est == est_list) { est_list = est_next; } else { est_prev->next = est_next; } } else { est_prev = est; } } for(est = est_list; est != NULL; est = est->next) { run_client_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE, g_options, est->dle, stdout); } dumpsrunning = 0; need_wait = 0; done = 0; while(! done) { done = 1; /* * See if we need to wait for a child before we can do anything * else in this pass. */ if(need_wait) { pid_t child_pid; amwait_t child_status; need_wait = 0; dbprintf(_("waiting for any estimate child: %d running\n"), dumpsrunning); child_pid = wait(&child_status); if(child_pid == -1) { error(_("wait failed: %s"), strerror(errno)); /*NOTREACHED*/ } if (!WIFEXITED(child_status) || WEXITSTATUS(child_status) != 0) { char *child_name = vstrallocf(_("child %ld"), (long)child_pid); char *child_status_str = str_exit_status(child_name, child_status); dbprintf("%s\n", child_status_str); amfree(child_status_str); amfree(child_name); } /* * Find the child and mark it done. */ for(est = est_list; est != NULL; est = est->next) { if(est->child == child_pid) { break; } } if(est == NULL) { dbprintf(_("unexpected child %ld\n"), (long)child_pid); } else { est->done = 1; est->child = 0; dumpsrunning--; run_client_scripts(EXECUTE_ON_POST_DLE_ESTIMATE, g_options, est->dle, stdout); } } /* * If we are already running the maximum number of children * go back and wait until one of them finishes. */ if(dumpsrunning >= g_options->maxdumps) { done = 0; need_wait = 1; continue; /* have to wait first */ } /* * Find a new child to start. */ for(est = est_list; est != NULL; est = est->next) { if(est->done == 0) { done = 0; /* more to do */ } if(est->child != 0 || est->done) { continue; /* child is running or done */ } /* * Make sure there is no spindle conflict. */ if(est->dle->spindle != -1) { for(est1 = est_list; est1 != NULL; est1 = est1->next) { if(est1->child == 0 || est == est1 || est1->done) { /* * Ignore anything not yet started, ourself, * and anything completed. */ continue; } if(est1->dle->spindle == est->dle->spindle) { break; /* oops -- they match */ } } if(est1 != NULL) { continue; /* spindle conflict */ } } break; /* start this estimate */ } if(est == NULL) { if(dumpsrunning > 0) { need_wait = 1; /* nothing to do but wait */ } } else { done = 0; run_client_scripts(EXECUTE_ON_PRE_DLE_ESTIMATE, g_options, est->dle, stdout); if((est->child = fork()) == 0) { calc_estimates(est); /* child does the estimate */ exit(0); } else if(est->child == -1) { error(_("calc_estimates fork failed: %s"), strerror(errno)); /*NOTREACHED*/ } dumpsrunning++; /* parent */ } } for(est = est_list; est != NULL; est = est->next) { run_client_scripts(EXECUTE_ON_POST_HOST_ESTIMATE, g_options, est->dle, stdout); } est_prev = NULL; for(est = est_list; est != NULL; est = est->next) { free_estimates(est); amfree(est_prev); est_prev = est; } amfree(est_prev); amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; free_g_options(g_options); dbclose(); return 0; err: if (err_extra) { g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET '%s'\n"), err_extra); dbprintf(_("REQ packet is bogus: %s\n"), err_extra); amfree(err_extra); } else { g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET\n")); dbprintf(_("REQ packet is bogus\n")); } free_g_options(g_options); dbclose(); return 1; } void dle_add_diskest( dle_t *dle) { disk_estimates_t *newp, *curp; amandates_t *amdp; int dumplev, estlev; time_t dumpdate; levellist_t levellist; char *amandates_file; gboolean need_amandates = FALSE; estimatelist_t el; if (dle->levellist == NULL) { g_printf(_("ERROR Missing level in request\n")); return; } /* should we use amandates for this? */ for (el = dle->estimatelist; el != NULL; el=el->next) { estimate_t estimate = (estimate_t)GPOINTER_TO_INT(el->data); if (estimate == ES_CALCSIZE) need_amandates = TRUE; } if (strcmp(dle->program, "GNUTAR") == 0) { /* GNUTAR only needs amandates if gnutar_list_dir is NULL */ char *gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (!gnutar_list_dir || !*gnutar_list_dir) need_amandates = TRUE; } /* start amandates here, before adding this DLE to est_list, in case * we encounter an error. */ if (need_amandates) { if (!amandates_started) { amandates_file = getconf_str(CNF_AMANDATES); if(!start_amandates(amandates_file, 0)) { char *errstr = strerror(errno); char *qamname = quote_string(dle->disk); char *errmsg = vstrallocf(_("could not open %s: %s"), amandates_file, errstr); char *qerrmsg = quote_string(errmsg); g_printf(_("%s %d ERROR %s\n"), qamname, 0, qerrmsg); amfree(qamname); amfree(errmsg); amfree(qerrmsg); return; } amandates_started = TRUE; } } levellist = dle->levellist; while (levellist != NULL) { am_level_t *alevel = (am_level_t *)levellist->data; if (alevel->level < 0) alevel->level = 0; if (alevel->level >= DUMP_LEVELS) alevel->level = DUMP_LEVELS - 1; levellist = g_slist_next(levellist); } for(curp = est_list; curp != NULL; curp = curp->next) { if(strcmp(curp->dle->disk, dle->disk) == 0) { /* already have disk info, just note the level request */ levellist = dle->levellist; while (levellist != NULL) { am_level_t *alevel = (am_level_t *)levellist->data; int level = alevel->level; curp->est[level].needestimate = 1; curp->est[level].server = alevel->server; levellist = g_slist_next(levellist); } return; } } newp = (disk_estimates_t *) alloc(SIZEOF(disk_estimates_t)); memset(newp, 0, SIZEOF(*newp)); newp->next = est_list; est_list = newp; newp->qamname = quote_string(dle->disk); if (dle->device) { newp->qamdevice = quote_string(dle->device); newp->dirname = amname_to_dirname(dle->device); newp->qdirname = quote_string(newp->dirname); } else { newp->qamdevice = stralloc(""); newp->dirname = stralloc(""); newp->qdirname = stralloc(""); } levellist = dle->levellist; while (levellist != NULL) { am_level_t *alevel = (am_level_t *)levellist->data; newp->est[alevel->level].needestimate = 1; newp->est[alevel->level].server = alevel->server; levellist = g_slist_next(levellist); } newp->dle = dle; /* fill in dump-since dates */ if (need_amandates) { amdp = amandates_lookup(newp->dle->disk); newp->est[0].dumpsince = EPOCH; for(dumplev = 0; dumplev < DUMP_LEVELS; dumplev++) { dumpdate = amdp->dates[dumplev]; for(estlev = dumplev+1; estlev < DUMP_LEVELS; estlev++) { if(dumpdate > newp->est[estlev].dumpsince) newp->est[estlev].dumpsince = dumpdate; } } } else { /* just zero everything out */ for(dumplev = 0; dumplev < DUMP_LEVELS; dumplev++) { newp->est[dumplev].dumpsince = 0; } } } void free_estimates( disk_estimates_t * est) { amfree(est->qamname); amfree(est->qamdevice); amfree(est->dirname); amfree(est->qdirname); if (est->dle) { free_dle(est->dle); } } /* * ------------------------------------------------------------------------ * */ void calc_estimates( disk_estimates_t * est) { dbprintf(_("calculating for amname %s, dirname %s, spindle %d %s\n"), est->qamname, est->qdirname, est->dle->spindle, est->dle->program); if(est->dle->program_is_application_api == 1) application_api_calc_estimate(est); else { estimatelist_t el; estimate_t estimate; int level; estimate_t estimate_method = ES_ES; estimate_t client_method = ES_ES; /* find estimate method to use */ for (el = est->dle->estimatelist; el != NULL; el = el->next) { estimate = (estimate_t)GPOINTER_TO_INT(el->data); if (estimate == ES_SERVER) { if (estimate_method == ES_ES) estimate_method = ES_SERVER; } if (estimate == ES_CLIENT || (estimate == ES_CALCSIZE && (est->dle->device[0] != '/' || est->dle->device[1] != '/'))) { if (client_method == ES_ES) client_method = estimate; if (estimate_method == ES_ES) estimate_method = estimate; } } /* do server estimate */ if (estimate_method == ES_SERVER) { for (level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { if (est->est[level].server || client_method == ES_ES) { g_printf(_("%s %d SIZE -1\n"), est->qamname, level); est->est[level].needestimate = 0; } } } } if (client_method == ES_ES && estimate_method != ES_SERVER) { g_printf(_("%s %d SIZE -2\n"), est->qamname, 0); dbprintf(_("Can't use CALCSIZE for samba estimate: %s %s\n"), est->qamname, est->qdirname); } else if (client_method == ES_CALCSIZE) { generic_calc_estimates(est); } else if (client_method == ES_CLIENT) { #ifndef USE_GENERIC_CALCSIZE if (strcmp(est->dle->program, "DUMP") == 0) dump_calc_estimates(est); else #endif #ifdef SAMBA_CLIENT if (strcmp(est->dle->program, "GNUTAR") == 0 && est->dle->device[0] == '/' && est->dle->device[1] == '/') smbtar_calc_estimates(est); else #endif #ifdef GNUTAR if (strcmp(est->dle->program, "GNUTAR") == 0) gnutar_calc_estimates(est); else #endif dbprintf(_("Invalid program: %s %s %s\n"), est->qamname, est->qdirname, est->dle->program); } } dbprintf(_("done with amname %s dirname %s spindle %d\n"), est->qamname, est->qdirname, est->dle->spindle); } /* * ------------------------------------------------------------------------ * */ /* local functions */ off_t getsize_dump(dle_t *dle, int level, char **errmsg); off_t getsize_smbtar(dle_t *dle, int level, char **errmsg); off_t getsize_gnutar(dle_t *dle, int level, time_t dumpsince, char **errmsg); off_t getsize_application_api(disk_estimates_t *est, int nb_level, int *levels, backup_support_option_t *bsu); off_t handle_dumpline(char *str); double first_num(char *str); void application_api_calc_estimate( disk_estimates_t * est) { int level; int i; int levels[DUMP_LEVELS]; int nb_level = 0; backup_support_option_t *bsu; GPtrArray *errarray; estimatelist_t el; estimate_t estimate; estimate_t estimate_method = ES_ES; estimate_t client_method = ES_ES; int has_calcsize = 0; int has_client = 0; bsu = backup_support_option(est->dle->program, g_options, est->dle->disk, est->dle->device, &errarray); if (!bsu) { guint i; for (i=0; i < errarray->len; i++) { char *line; char *errmsg; char *qerrmsg; line = g_ptr_array_index(errarray, i); if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { errmsg = g_strdup_printf(_("Application '%s': %s"), est->dle->program, line); qerrmsg = quote_string(errmsg); for (level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { g_printf(_("%s %d ERROR %s\n"), est->dle->disk, level, qerrmsg); dbprintf(_("%s %d ERROR %s\n"), est->qamname, level, qerrmsg); } } amfree(errmsg); amfree(qerrmsg); } } if (i == 0) { /* nothing in errarray */ char *errmsg; char *qerrmsg; errmsg = g_strdup_printf( _("Application '%s': cannon execute support command"), est->dle->program); qerrmsg = quote_string(errmsg); for (level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { g_printf(_("%s %d ERROR %s\n"), est->dle->disk, level, qerrmsg); dbprintf(_("%s %d ERROR %s\n"), est->qamname, level, qerrmsg); } } amfree(errmsg); amfree(qerrmsg); } for (level = 0; level < DUMP_LEVELS; level++) { est->est[level].needestimate = 0; } g_ptr_array_free(errarray, TRUE); } if (est->dle->data_path == DATA_PATH_AMANDA && (bsu->data_path_set & DATA_PATH_AMANDA)==0) { g_printf("%s %d ERROR application %s doesn't support amanda data-path\n", est->qamname, 0, est->dle->program); amfree(bsu); return; } if (est->dle->data_path == DATA_PATH_DIRECTTCP && (bsu->data_path_set & DATA_PATH_DIRECTTCP)==0) { g_printf("%s %d ERROR application %s doesn't support directtcp data-path\n", est->qamname, 0, est->dle->program); amfree(bsu); return; } /* find estimate method to use */ for (el = est->dle->estimatelist; el != NULL; el = el->next) { estimate = (estimate_t)GPOINTER_TO_INT(el->data); if (estimate == ES_CLIENT) has_client = 1; if (estimate == ES_CALCSIZE) has_calcsize = 1; if (estimate == ES_SERVER) { if (estimate_method == ES_ES) estimate_method = ES_SERVER; } if ((estimate == ES_CLIENT && bsu->client_estimate) || (estimate == ES_CALCSIZE && bsu->calcsize)) { if (client_method == ES_ES) client_method = estimate; if (estimate_method == ES_ES) estimate_method = estimate; } } for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { if (level > bsu->max_level) { /* planner will not even consider this level */ g_printf("%s %d SIZE %lld\n", est->qamname, level, (long long)-2); est->est[level].needestimate = 0; dbprintf(_("Application '%s' can't estimate level %d\n"), est->dle->program, level); } else if (estimate_method == ES_ES) { g_printf("%s %d SIZE %lld\n", est->qamname, level, (long long)-2); est->est[level].needestimate = 0; if (am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { char *errmsg, *qerrmsg; if (has_client && !bsu->client_estimate && has_calcsize && !bsu->calcsize) { errmsg = vstrallocf(_("Application '%s' can't do CLIENT or CALCSIZE estimate"), est->dle->program); } else if (has_client && !bsu->client_estimate) { errmsg = vstrallocf(_("Application '%s' can't do CLIENT estimate"), est->dle->program); } else if (has_calcsize && !bsu->calcsize) { errmsg = vstrallocf(_("Application '%s' can't do CALCSIZE estimate"), est->dle->program); } else { errmsg = vstrallocf(_("Application '%s' can't do estimate"), est->dle->program); } qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf("%s %d ERROR %s\n", est->qamname, 0, qerrmsg); amfree(errmsg); amfree(qerrmsg); } } else if (estimate_method == ES_SERVER && (est->est[level].server || client_method == ES_ES)) { /* planner will consider this level, */ /* but use a server-side estimate */ g_printf("%s %d SIZE -1\n", est->qamname, level); est->est[level].needestimate = 0; } else if (client_method == ES_CLIENT) { levels[nb_level++] = level; } else if (client_method == ES_CALCSIZE) { levels[nb_level++] = level; } } } if (nb_level == 0) { amfree(bsu); return; } if (bsu->multi_estimate) { for (i=0;iqamname, est->qamdevice, levels[i]); } getsize_application_api(est, nb_level, levels, bsu); } else { for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { dbprintf( _("getting size via application API for %s %s level %d\n"), est->qamname, est->qamdevice, level); levels[0] = level; getsize_application_api(est, 1, levels, bsu); } } } amfree(bsu); } void generic_calc_estimates( disk_estimates_t * est) { int pipefd = -1, nullfd = -1; char *cmd; char *cmdline; char *command; GPtrArray *argv_ptr = g_ptr_array_new(); char number[NUM_STR_SIZE]; unsigned int i; int level; pid_t calcpid; int nb_exclude = 0; int nb_include = 0; char *file_exclude = NULL; char *file_include = NULL; times_t start_time; FILE *dumpout = NULL; char *line = NULL; char *match_expr; amwait_t wait_status; char *errmsg = NULL, *qerrmsg; char tmppath[PATH_MAX]; int len; cmd = vstralloc(amlibexecdir, "/", "calcsize", NULL); g_ptr_array_add(argv_ptr, stralloc("calcsize")); if (g_options->config) g_ptr_array_add(argv_ptr, stralloc(g_options->config)); else g_ptr_array_add(argv_ptr, stralloc("NOCONFIG")); g_ptr_array_add(argv_ptr, stralloc(est->dle->program)); canonicalize_pathname(est->dle->disk, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); canonicalize_pathname(est->dirname, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); if (est->dle->exclude_file) nb_exclude += est->dle->exclude_file->nb_element; if (est->dle->exclude_list) nb_exclude += est->dle->exclude_list->nb_element; if (est->dle->include_file) nb_include += est->dle->include_file->nb_element; if (est->dle->include_list) nb_include += est->dle->include_list->nb_element; if (nb_exclude > 0) file_exclude = build_exclude(est->dle, 0); if (nb_include > 0) file_include = build_include(est->dle, 0); if(file_exclude) { g_ptr_array_add(argv_ptr, stralloc("-X")); g_ptr_array_add(argv_ptr, stralloc(file_exclude)); } if(file_include) { g_ptr_array_add(argv_ptr, stralloc("-I")); g_ptr_array_add(argv_ptr, stralloc(file_include)); } start_time = curclock(); command = (char *)g_ptr_array_index(argv_ptr, 0); cmdline = stralloc(command); for(i = 1; i < argv_ptr->len-1; i++) { cmdline = vstrextend(&cmdline, " ", (char *)g_ptr_array_index(argv_ptr, i), NULL); } dbprintf(_("running: \"%s\"\n"), cmdline); amfree(cmdline); for(level = 0; level < DUMP_LEVELS; level++) { if(est->est[level].needestimate) { g_snprintf(number, SIZEOF(number), "%d", level); g_ptr_array_add(argv_ptr, stralloc(number)); dbprintf(" %s", number); g_snprintf(number, SIZEOF(number), "%ld", (long)est->est[level].dumpsince); g_ptr_array_add(argv_ptr, stralloc(number)); dbprintf(" %s", number); } } g_ptr_array_add(argv_ptr, NULL); dbprintf("\n"); fflush(stderr); fflush(stdout); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); dbprintf("%s\n", errmsg); goto common_exit; } calcpid = pipespawnv(cmd, STDERR_PIPE, 0, &nullfd, &nullfd, &pipefd, (char **)argv_ptr->pdata); amfree(cmd); dumpout = fdopen(pipefd,"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } match_expr = vstralloc(" %d SIZE %lld", NULL); len = strlen(est->qamname); for(; (line = agets(dumpout)) != NULL; free(line)) { long long size_ = (long long)0; if (line[0] == '\0' || (int)strlen(line) <= len) continue; /* Don't use sscanf for est->qamname because it can have a '%'. */ if (strncmp(line, est->qamname, len) == 0 && sscanf(line+len, match_expr, &level, &size_) == 2) { g_printf("%s\n", line); /* write to amandad */ dbprintf(_("estimate size for %s level %d: %lld KB\n"), est->qamname, level, size_); } } amfree(match_expr); dbprintf(_("waiting for %s %s child (pid=%d)\n"), command, est->qamdevice, (int)calcpid); waitpid(calcpid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), "calcsize", WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { errmsg = vstrallocf(_("%s exited with status %d: see %s"), "calcsize", WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { errmsg = vstrallocf(_("%s got bad exit: see %s"), "calcsize", dbfn()); } dbprintf(_("after %s %s wait: child pid=%d status=%d\n"), command, est->qamdevice, (int)calcpid, WEXITSTATUS(wait_status)); dbprintf(_(".....\n")); dbprintf(_("estimate time for %s: %s\n"), est->qamname, walltime_str(timessub(curclock(), start_time))); common_exit: if (errmsg && errmsg[0] != '\0') { if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf("%s %d ERROR %s\n", est->qamname, 0, qerrmsg); amfree(qerrmsg); } } amfree(errmsg); g_ptr_array_free_full(argv_ptr); amfree(cmd); } void dump_calc_estimates( disk_estimates_t * est) { int level; off_t size; char *errmsg=NULL, *qerrmsg; for(level = 0; level < DUMP_LEVELS; level++) { if(est->est[level].needestimate) { dbprintf(_("getting size via dump for %s level %d\n"), est->qamname, level); size = getsize_dump(est->dle, level, &errmsg); amflock(1, "size"); g_printf(_("%s %d SIZE %lld\n"), est->qamname, level, (long long)size); if (errmsg && errmsg[0] != '\0') { if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf("%s %d ERROR %s\n", est->qamname, level, qerrmsg); amfree(qerrmsg); } } amfree(errmsg); fflush(stdout); amfunlock(1, "size"); } } } #ifdef SAMBA_CLIENT void smbtar_calc_estimates( disk_estimates_t * est) { int level; off_t size; char *errmsg = NULL, *qerrmsg; for(level = 0; level < DUMP_LEVELS; level++) { if(est->est[level].needestimate) { dbprintf(_("getting size via smbclient for %s level %d\n"), est->qamname, level); size = getsize_smbtar(est->dle, level, &errmsg); amflock(1, "size"); g_printf(_("%s %d SIZE %lld\n"), est->qamname, level, (long long)size); if (errmsg && errmsg[0] != '\0') { if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf("%s %d ERROR %s\n", est->qamname, level, qerrmsg); amfree(qerrmsg); } } amfree(errmsg); fflush(stdout); amfunlock(1, "size"); } } } #endif #ifdef GNUTAR void gnutar_calc_estimates( disk_estimates_t * est) { int level; off_t size; char *errmsg = NULL, *qerrmsg; for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { dbprintf(_("getting size via gnutar for %s level %d\n"), est->qamname, level); size = getsize_gnutar(est->dle, level, est->est[level].dumpsince, &errmsg); amflock(1, "size"); g_printf(_("%s %d SIZE %lld\n"), est->qamname, level, (long long)size); if (errmsg && errmsg[0] != '\0') { if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) { qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf(_("%s %d ERROR %s\n"), est->qamname, level, qerrmsg); amfree(qerrmsg); } } amfree(errmsg); fflush(stdout); amfunlock(1, "size"); } } } #endif typedef struct regex_scale_s { char *regex; int scale; } regex_scale_t; /*@ignore@*/ regex_scale_t re_size[] = { #ifdef DUMP {" DUMP: estimated -*[0-9][0-9]* tape blocks", 1024}, {" DUMP: [Ee]stimated [0-9][0-9]* blocks", 512}, {" DUMP: [Ee]stimated [0-9][0-9]* bytes", 1}, /* Ultrix 4.4 */ {" UFSDUMP: estimated [0-9][0-9]* blocks", 512}, /* NEC EWS-UX */ {"dump: Estimate: [0-9][0-9]* tape blocks", 1024}, /* OSF/1 */ {"backup: There are an estimated [0-9][0-9]* tape blocks.",1024}, /* AIX */ {"backup: estimated [0-9][0-9]* 1k blocks", 1024}, /* AIX */ {"backup: estimated [0-9][0-9]* tape blocks", 1024}, /* AIX */ {"backup: [0-9][0-9]* tape blocks on [0-9][0-9]* tape(s)",1024}, /* AIX */ {"backup: [0-9][0-9]* 1k blocks on [0-9][0-9]* volume(s)",1024}, /* AIX */ {"dump: Estimate: [0-9][0-9]* blocks being output to pipe",1024}, /* DU 4.0 dump */ {"dump: Dumping [0-9][0-9]* bytes, ", 1}, /* DU 4.0 vdump */ {"DUMP: estimated [0-9][0-9]* KB output", 1024}, /* HPUX */ {"DUMP: estimated [0-9][0-9]* KB\\.", 1024}, /* NetApp */ {" UFSDUMP: estimated [0-9][0-9]* blocks", 512}, /* Sinix */ #ifdef HAVE_DUMP_ESTIMATE {"[0-9][0-9]* blocks, [0-9][0-9]*.[0-9][0-9]* volumes", 1024}, /* DU 3.2g dump -E */ {"^[0-9][0-9]* blocks$", 1024}, /* DU 4.0 dump -E */ {"^[0-9][0-9]*$", 1}, /* Solaris ufsdump -S */ #endif #endif #ifdef VDUMP {"vdump: Dumping [0-9][0-9]* bytes, ", 1}, /* OSF/1 vdump */ #endif #ifdef VXDUMP {"vxdump: estimated [0-9][0-9]* blocks", 512}, /* HPUX's vxdump */ {" VXDUMP: estimated [0-9][0-9]* blocks", 512}, /* Sinix */ #endif #ifdef XFSDUMP {"xfsdump: estimated dump size: [0-9][0-9]* bytes", 1}, /* Irix 6.2 xfs */ #endif #ifdef GNUTAR {"Total bytes written: [0-9][0-9]*", 1}, /* Gnutar client */ #endif #ifdef SAMBA_CLIENT #if SAMBA_VERSION >= 2 #define SAMBA_DEBUG_LEVEL "0" {"Total number of bytes: [0-9][0-9]*", 1}, /* Samba du */ #else #define SAMBA_DEBUG_LEVEL "3" {"Total bytes listed: [0-9][0-9]*", 1}, /* Samba dir */ #endif #endif { NULL, 0 } }; /*@end@*/ off_t getsize_dump( dle_t *dle, int level, char **errmsg) { int pipefd[2], nullfd, stdoutfd, killctl[2]; pid_t dumppid; off_t size; FILE *dumpout; char *dumpkeys = NULL; char *device = NULL; char *fstype = NULL; char *cmd = NULL; char *name = NULL; char *line = NULL; char *rundump_cmd = NULL; char level_str[NUM_STR_SIZE]; int s; times_t start_time; char *qdisk = quote_string(dle->disk); char *qdevice; char *config; amwait_t wait_status; #if defined(DUMP) || defined(VDUMP) || defined(VXDUMP) || defined(XFSDUMP) int is_rundump = 1; #endif if (level > 9) return -2; /* planner will not even consider this level */ g_snprintf(level_str, SIZEOF(level_str), "%d", level); device = amname_to_devname(dle->device); qdevice = quote_string(device); fstype = amname_to_fstype(dle->device); dbprintf(_("calculating for device %s with %s\n"), qdevice, fstype); cmd = vstralloc(amlibexecdir, "/rundump", NULL); rundump_cmd = stralloc(cmd); if (g_options->config) config = g_options->config; else config = "NOCONFIG"; if ((stdoutfd = nullfd = open("/dev/null", O_RDWR)) == -1) { *errmsg = vstrallocf(_("getsize_dump could not open /dev/null: %s"), strerror(errno)); dbprintf("%s\n", *errmsg); amfree(cmd); amfree(rundump_cmd); amfree(fstype); amfree(device); amfree(qdevice); amfree(qdisk); return(-1); } pipefd[0] = pipefd[1] = killctl[0] = killctl[1] = -1; if (pipe(pipefd) < 0) { *errmsg = vstrallocf(_("getsize_dump could create data pipes: %s"), strerror(errno)); dbprintf("%s\n", *errmsg); amfree(cmd); amfree(rundump_cmd); amfree(fstype); amfree(device); amfree(qdevice); amfree(qdisk); return(-1); } #ifdef XFSDUMP /* { */ #ifdef DUMP /* { */ if (strcmp(fstype, "xfs") == 0) #else /* } { */ if (1) #endif /* } */ { name = stralloc(" (xfsdump)"); dbprintf(_("running \"%s%s -F -J -l %s - %s\"\n"), cmd, name, level_str, qdevice); } else #endif /* } */ #ifdef VXDUMP /* { */ #ifdef DUMP /* { */ if (strcmp(fstype, "vxfs") == 0) #else /* } { */ if (1) #endif /* } */ { #ifdef USE_RUNDUMP name = stralloc(" (vxdump)"); #else name = stralloc(""); cmd = newstralloc(cmd, VXDUMP); config = skip_argument; is_rundump = 0; #endif dumpkeys = vstralloc(level_str, "s", "f", NULL); dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"), cmd, name, dumpkeys, qdevice); } else #endif /* } */ #ifdef VDUMP /* { */ #ifdef DUMP /* { */ if (strcmp(fstype, "advfs") == 0) #else /* } { */ if (1) #endif /* } */ { name = stralloc(" (vdump)"); dumpkeys = vstralloc(level_str, "b", "f", NULL); dbprintf(_("running \"%s%s %s 60 - %s\"\n"), cmd, name, dumpkeys, qdevice); } else #endif /* } */ #ifdef DUMP /* { */ if (1) { # ifdef USE_RUNDUMP /* { */ # ifdef AIX_BACKUP /* { */ name = stralloc(" (backup)"); # else /* } { */ name = vstralloc(" (", DUMP, ")", NULL); # endif /* } */ # else /* } { */ name = stralloc(""); cmd = newstralloc(cmd, DUMP); config = skip_argument; is_rundump = 0; # endif /* } */ # ifdef AIX_BACKUP /* { */ dumpkeys = vstralloc("-", level_str, "f", NULL); dbprintf(_("running \"%s%s %s - %s\"\n"), cmd, name, dumpkeys, qdevice); # else /* } { */ # ifdef HAVE_DUMP_ESTIMATE # define PARAM_DUMP_ESTIMATE HAVE_DUMP_ESTIMATE # else # define PARAM_DUMP_ESTIMATE "" # endif # ifdef HAVE_HONOR_NODUMP # define PARAM_HONOR_NODUMP "h" # else # define PARAM_HONOR_NODUMP "" # endif dumpkeys = vstralloc(level_str, PARAM_DUMP_ESTIMATE, PARAM_HONOR_NODUMP, "s", "f", NULL); # ifdef HAVE_DUMP_ESTIMATE stdoutfd = pipefd[1]; # endif # ifdef HAVE_HONOR_NODUMP /* { */ dbprintf(_("running \"%s%s %s 0 1048576 - %s\"\n"), cmd, name, dumpkeys, qdevice); # else /* } { */ dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"), cmd, name, dumpkeys, qdevice); # endif /* } */ # endif /* } */ } else #endif /* } */ { error(_("no dump program available")); /*NOTREACHED*/ } if (pipe(killctl) < 0) { dbprintf(_("Could not create pipe: %s\n"), strerror(errno)); /* Message will be printed later... */ killctl[0] = killctl[1] = -1; } start_time = curclock(); switch(dumppid = fork()) { case -1: *errmsg = vstrallocf(_("cannot fork for killpgrp: %s"), strerror(errno)); dbprintf("%s\n", *errmsg); amfree(dumpkeys); amfree(cmd); amfree(rundump_cmd); amfree(device); amfree(qdevice); amfree(qdisk); amfree(name); amfree(fstype); return -1; default: break; case 0: /* child process */ if(SETPGRP == -1) SETPGRP_FAILED(); else if (killctl[0] == -1 || killctl[1] == -1) dbprintf(_("Trying without killpgrp\n")); else { switch(fork()) { case -1: dbprintf(_("fork failed, trying without killpgrp\n")); break; default: { char *killpgrp_cmd = vstralloc(amlibexecdir, "/killpgrp", NULL); dbprintf(_("running %s\n"), killpgrp_cmd); dup2(killctl[0], 0); dup2(nullfd, 1); dup2(nullfd, 2); close(pipefd[0]); close(pipefd[1]); close(killctl[1]); close(nullfd); safe_fd(-1, 0); execle(killpgrp_cmd, killpgrp_cmd, config, (char *)0, safe_env()); dbprintf(_("cannot execute %s: %s\n"), killpgrp_cmd, strerror(errno)); exit(-1); } case 0: /* child process */ break; } } dup2(nullfd, 0); dup2(stdoutfd, 1); dup2(pipefd[1], 2); aclose(pipefd[0]); if (killctl[0] != -1) aclose(killctl[0]); if (killctl[1] != -1) aclose(killctl[1]); safe_fd(-1, 0); #ifdef XFSDUMP #ifdef DUMP if (strcmp(fstype, "xfs") == 0) #else if (1) #endif if (is_rundump) execle(cmd, "rundump", config, "xfsdump", "-F", "-J", "-l", level_str, "-", device, (char *)0, safe_env()); else execle(cmd, "xfsdump", "-F", "-J", "-l", level_str, "-", device, (char *)0, safe_env()); else #endif #ifdef VXDUMP #ifdef DUMP if (strcmp(fstype, "vxfs") == 0) #else if (1) #endif if (is_rundump) execle(cmd, "rundump", config, "vxdump", dumpkeys, "1048576", "-", device, (char *)0, safe_env()); else execle(cmd, "vxdump", dumpkeys, "1048576", "-", device, (char *)0, safe_env()); else #endif #ifdef VDUMP #ifdef DUMP if (strcmp(fstype, "advfs") == 0) #else if (1) #endif if (is_rundump) execle(cmd, "rundump", config, "vdump", dumpkeys, "60", "-", device, (char *)0, safe_env()); else execle(cmd, "vdump", dumpkeys, "60", "-", device, (char *)0, safe_env()); else #endif #ifdef DUMP # ifdef AIX_BACKUP if (is_rundump) execle(cmd, "rundump", config, "backup", dumpkeys, "-", device, (char *)0, safe_env()); else execle(cmd, "backup", dumpkeys, "-", device, (char *)0, safe_env()); # else if (is_rundump) { execle(cmd, "rundump", config, "dump", dumpkeys, #ifdef HAVE_HONOR_NODUMP "0", #endif "1048576", "-", device, (char *)0, safe_env()); } else { execle(cmd, "dump", dumpkeys, #ifdef HAVE_HONOR_NODUMP "0", #endif "1048576", "-", device, (char *)0, safe_env()); } # endif #endif { error(_("exec %s failed or no dump program available: %s"), cmd, strerror(errno)); /*NOTREACHED*/ } } amfree(dumpkeys); amfree(rundump_cmd); aclose(pipefd[1]); if (killctl[0] != -1) aclose(killctl[0]); dumpout = fdopen(pipefd[0],"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { if (line[0] == '\0') continue; dbprintf("%s\n", line); size = handle_dumpline(line); if(size > (off_t)-1) { amfree(line); while ((line = agets(dumpout)) != NULL) { if (line[0] != '\0') break; amfree(line); } if (line != NULL) { dbprintf("%s\n", line); } break; } } amfree(line); dbprintf(".....\n"); dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { *errmsg = vstrallocf(_("no size line match in %s%s output"), cmd, name); dbprintf(_("%s for %s\n"), *errmsg, qdisk); dbprintf(".....\n"); dbprintf(_("Run %s%s manually to check for errors\n"), cmd, name); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s%s problem -- is \"%s\" really empty?\n"), cmd, name, dle->disk); dbprintf(".....\n"); } else { dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, (long long)size); } if (killctl[1] != -1) { dbprintf(_("asking killpgrp to terminate\n")); aclose(killctl[1]); for(s = 5; s > 0; --s) { sleep(1); if (waitpid(dumppid, NULL, WNOHANG) != -1) goto terminated; } } /* * First, try to kill the dump process nicely. If it ignores us * for several seconds, hit it harder. */ dbprintf(_("sending SIGTERM to process group %ld\n"), (long)dumppid); if (kill(-dumppid, SIGTERM) == -1) { dbprintf(_("kill failed: %s\n"), strerror(errno)); } /* Now check whether it dies */ for(s = 5; s > 0; --s) { sleep(1); if (waitpid(dumppid, NULL, WNOHANG) != -1) goto terminated; } dbprintf(_("sending SIGKILL to process group %ld\n"), (long)dumppid); if (kill(-dumppid, SIGKILL) == -1) { dbprintf(_("kill failed: %s\n"), strerror(errno)); } for(s = 5; s > 0; --s) { sleep(1); if (waitpid(dumppid, NULL, WNOHANG) != -1) goto terminated; } dbprintf(_("waiting for %s%s \"%s\" child\n"), cmd, name, qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), cmd, WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { *errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd, WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { *errmsg = vstrallocf(_("%s got bad exit: see %s"), cmd, dbfn()); } dbprintf(_("after %s%s %s wait\n"), cmd, name, qdisk); terminated: aclose(nullfd); afclose(dumpout); amfree(device); amfree(qdevice); amfree(qdisk); amfree(fstype); amfree(cmd); amfree(name); return size; } #ifdef SAMBA_CLIENT off_t getsize_smbtar( dle_t *dle, int level, char **errmsg) { int pipefd = -1, nullfd = -1, passwdfd = -1; pid_t dumppid; off_t size; FILE *dumpout; char *tarkeys, *sharename, *user_and_password = NULL, *domain = NULL; char *share = NULL, *subdir = NULL; size_t lpass; char *pwtext; size_t pwtext_len; char *line; char *pw_fd_env; times_t start_time; char *error_pn = NULL; char *qdisk = quote_string(dle->disk); amwait_t wait_status; error_pn = stralloc2(get_pname(), "-smbclient"); if (level > 1) return -2; /* planner will not even consider this level */ parsesharename(dle->device, &share, &subdir); if (!share) { amfree(share); amfree(subdir); set_pname(error_pn); amfree(error_pn); error(_("cannot parse disk entry %s for share/subdir"), qdisk); /*NOTREACHED*/ } if ((subdir) && (SAMBA_VERSION < 2)) { amfree(share); amfree(subdir); set_pname(error_pn); amfree(error_pn); error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk); /*NOTREACHED*/ } if ((user_and_password = findpass(share, &domain)) == NULL) { if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("cannot find password for %s"), dle->disk); /*NOTREACHED*/ } lpass = strlen(user_and_password); if ((pwtext = strchr(user_and_password, '%')) == NULL) { memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("password field not \'user%%pass\' for %s"), dle->disk); /*NOTREACHED*/ } *pwtext++ = '\0'; pwtext_len = strlen(pwtext); if ((sharename = makesharename(share, 0)) == NULL) { memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); error(_("cannot make share name of %s"), share); /*NOTREACHED*/ } if ((nullfd = open("/dev/null", O_RDWR)) == -1) { memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } set_pname(error_pn); amfree(error_pn); amfree(sharename); error(_("could not open /dev/null: %s\n"), strerror(errno)); /*NOTREACHED*/ } #if SAMBA_VERSION >= 2 if (level == 0) tarkeys = "archive 0;recurse;du"; else tarkeys = "archive 1;recurse;du"; #else if (level == 0) tarkeys = "archive 0;recurse;dir"; else tarkeys = "archive 1;recurse;dir"; #endif start_time = curclock(); if (pwtext_len > 0) { pw_fd_env = "PASSWD_FD"; } else { pw_fd_env = "dummy_PASSWD_FD"; } dumppid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, 0, &nullfd, &nullfd, &pipefd, pw_fd_env, &passwdfd, "smbclient", sharename, "-d", SAMBA_DEBUG_LEVEL, *user_and_password ? "-U" : skip_argument, *user_and_password ? user_and_password : skip_argument, "-E", domain ? "-W" : skip_argument, domain ? domain : skip_argument, #if SAMBA_VERSION >= 2 subdir ? "-D" : skip_argument, subdir ? subdir : skip_argument, #endif "-c", tarkeys, NULL); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } aclose(nullfd); if(pwtext_len > 0 && full_write(passwdfd, pwtext, pwtext_len) < pwtext_len) { int save_errno = errno; memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); aclose(passwdfd); set_pname(error_pn); amfree(error_pn); error(_("password write failed: %s"), strerror(save_errno)); /*NOTREACHED*/ } memset(user_and_password, '\0', (size_t)lpass); amfree(user_and_password); aclose(passwdfd); amfree(sharename); amfree(share); amfree(subdir); amfree(error_pn); dumpout = fdopen(pipefd,"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { if (line[0] == '\0') continue; dbprintf("%s\n", line); size = handle_dumpline(line); if(size > -1) { amfree(line); while ((line = agets(dumpout)) != NULL) { if (line[0] != '\0') break; amfree(line); } if(line != NULL) { dbprintf("%s\n", line); } break; } } amfree(line); dbprintf(".....\n"); dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { *errmsg = vstrallocf(_("no size line match in %s output"), SAMBA_CLIENT); dbprintf(_("%s for %s\n"), *errmsg, qdisk); dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), SAMBA_CLIENT, dle->disk); dbprintf(".....\n"); } dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, (long long)size); kill(-dumppid, SIGTERM); dbprintf(_("waiting for %s \"%s\" child\n"), SAMBA_CLIENT, qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), SAMBA_CLIENT, WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { *errmsg = vstrallocf(_("%s exited with status %d: see %s"), SAMBA_CLIENT, WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { *errmsg = vstrallocf(_("%s got bad exit: see %s"), SAMBA_CLIENT, dbfn()); } dbprintf(_("after %s %s wait\n"), SAMBA_CLIENT, qdisk); afclose(dumpout); pipefd = -1; amfree(error_pn); amfree(qdisk); return size; } #endif #ifdef GNUTAR off_t getsize_gnutar( dle_t *dle, int level, time_t dumpsince, char **errmsg) { int pipefd = -1, nullfd = -1; pid_t dumppid; off_t size = (off_t)-1; FILE *dumpout = NULL; char *incrname = NULL; char *basename = NULL; char *dirname = NULL; char *inputname = NULL; FILE *in = NULL; FILE *out = NULL; char *line = NULL; char *cmd = NULL; char *command = NULL; char dumptimestr[80]; struct tm *gmtm; int nb_exclude = 0; int nb_include = 0; GPtrArray *argv_ptr = g_ptr_array_new(); char *file_exclude = NULL; char *file_include = NULL; times_t start_time; int infd, outfd; ssize_t nb; char buf[32768]; char *qdisk = quote_string(dle->disk); char *gnutar_list_dir; amwait_t wait_status; char tmppath[PATH_MAX]; if (level > 9) return -2; /* planner will not even consider this level */ if(dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; if(dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; if(dle->include_file) nb_include += dle->include_file->nb_element; if(dle->include_list) nb_include += dle->include_list->nb_element; if(nb_exclude > 0) file_exclude = build_exclude(dle, 0); if(nb_include > 0) file_include = build_include(dle, 0); gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (strlen(gnutar_list_dir) == 0) gnutar_list_dir = NULL; if (gnutar_list_dir) { char number[NUM_STR_SIZE]; int baselevel; char *sdisk = sanitise_filename(dle->disk); basename = vstralloc(gnutar_list_dir, "/", g_options->hostname, sdisk, NULL); amfree(sdisk); g_snprintf(number, SIZEOF(number), "%d", level); incrname = vstralloc(basename, "_", number, ".new", NULL); unlink(incrname); /* * Open the listed incremental file from the previous level. Search * backward until one is found. If none are found (which will also * be true for a level 0), arrange to read from /dev/null. */ baselevel = level; infd = -1; while (infd == -1) { if (--baselevel >= 0) { g_snprintf(number, SIZEOF(number), "%d", baselevel); inputname = newvstralloc(inputname, basename, "_", number, NULL); } else { inputname = newstralloc(inputname, "/dev/null"); } if ((infd = open(inputname, O_RDONLY)) == -1) { *errmsg = vstrallocf(_("gnutar: error opening %s: %s"), inputname, strerror(errno)); dbprintf("%s\n", *errmsg); if (baselevel < 0) { goto common_exit; } amfree(*errmsg); } } /* * Copy the previous listed incremental file to the new one. */ if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) { *errmsg = vstrallocf(_("opening %s: %s"), incrname, strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { if (full_write(outfd, &buf, (size_t)nb) < (size_t)nb) { *errmsg = vstrallocf(_("writing to %s: %s"), incrname, strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } } if (nb < 0) { *errmsg = vstrallocf(_("reading from %s: %s"), inputname, strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } if (close(infd) != 0) { *errmsg = vstrallocf(_("closing %s: %s"), inputname, strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } if (close(outfd) != 0) { *errmsg = vstrallocf(_("closing %s: %s"), incrname, strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } amfree(inputname); amfree(basename); } gmtm = gmtime(&dumpsince); g_snprintf(dumptimestr, SIZEOF(dumptimestr), "%04d-%02d-%02d %2d:%02d:%02d GMT", gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); dirname = amname_to_dirname(dle->device); cmd = vstralloc(amlibexecdir, "/", "runtar", NULL); g_ptr_array_add(argv_ptr, stralloc("runtar")); if (g_options->config) g_ptr_array_add(argv_ptr, stralloc(g_options->config)); else g_ptr_array_add(argv_ptr, stralloc("NOCONFIG")); #ifdef GNUTAR g_ptr_array_add(argv_ptr, stralloc(GNUTAR)); #else g_ptr_array_add(argv_ptr, stralloc("tar")); #endif g_ptr_array_add(argv_ptr, stralloc("--create")); g_ptr_array_add(argv_ptr, stralloc("--file")); g_ptr_array_add(argv_ptr, stralloc("/dev/null")); /* use --numeric-owner for estimates, to reduce the number of user/group * lookups required */ g_ptr_array_add(argv_ptr, stralloc("--numeric-owner")); g_ptr_array_add(argv_ptr, stralloc("--directory")); canonicalize_pathname(dirname, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); g_ptr_array_add(argv_ptr, stralloc("--one-file-system")); if (gnutar_list_dir) { g_ptr_array_add(argv_ptr, stralloc("--listed-incremental")); g_ptr_array_add(argv_ptr, stralloc(incrname)); } else { g_ptr_array_add(argv_ptr, stralloc("--incremental")); g_ptr_array_add(argv_ptr, stralloc("--newer")); g_ptr_array_add(argv_ptr, stralloc(dumptimestr)); } #ifdef ENABLE_GNUTAR_ATIME_PRESERVE /* --atime-preserve causes gnutar to call * utime() after reading files in order to * adjust their atime. However, utime() * updates the file's ctime, so incremental * dumps will think the file has changed. */ g_ptr_array_add(argv_ptr, stralloc("--atime-preserve")); #endif g_ptr_array_add(argv_ptr, stralloc("--sparse")); g_ptr_array_add(argv_ptr, stralloc("--ignore-failed-read")); g_ptr_array_add(argv_ptr, stralloc("--totals")); if(file_exclude) { g_ptr_array_add(argv_ptr, stralloc("--exclude-from")); g_ptr_array_add(argv_ptr, stralloc(file_exclude)); } if(file_include) { g_ptr_array_add(argv_ptr, stralloc("--files-from")); g_ptr_array_add(argv_ptr, stralloc(file_include)); } else { g_ptr_array_add(argv_ptr, stralloc(".")); } g_ptr_array_add(argv_ptr, NULL); start_time = curclock(); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { *errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); dbprintf("%s\n", *errmsg); goto common_exit; } command = (char *)g_ptr_array_index(argv_ptr, 0); dumppid = pipespawnv(cmd, STDERR_PIPE, 0, &nullfd, &nullfd, &pipefd, (char **)argv_ptr->pdata); dumpout = fdopen(pipefd,"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { if (line[0] == '\0') continue; dbprintf("%s\n", line); size = handle_dumpline(line); if(size > (off_t)-1) { amfree(line); while ((line = agets(dumpout)) != NULL) { if (line[0] != '\0') { break; } amfree(line); } if (line != NULL) { dbprintf("%s\n", line); break; } break; } } amfree(line); dbprintf(".....\n"); dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { *errmsg = vstrallocf(_("no size line match in %s output"), command); dbprintf(_("%s for %s\n"), *errmsg, qdisk); dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), command, dle->disk); dbprintf(".....\n"); } dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, (long long)size); kill(-dumppid, SIGTERM); dbprintf(_("waiting for %s \"%s\" child\n"), command, qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), cmd, WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { *errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd, WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { *errmsg = vstrallocf(_("%s got bad exit: see %s"), cmd, dbfn()); } dbprintf(_("after %s %s wait\n"), command, qdisk); common_exit: if (incrname) { unlink(incrname); } amfree(incrname); amfree(basename); amfree(dirname); amfree(inputname); g_ptr_array_free_full(argv_ptr); amfree(qdisk); amfree(cmd); amfree(file_exclude); amfree(file_include); aclose(nullfd); afclose(dumpout); afclose(in); afclose(out); return size; } #endif off_t getsize_application_api( disk_estimates_t *est, int nb_level, int *levels, backup_support_option_t *bsu) { dle_t *dle = est->dle; int pipeinfd[2], pipeoutfd[2], pipeerrfd[2]; pid_t dumppid; off_t size = (off_t)-1; FILE *dumpout; FILE *dumperr; char *line = NULL; char *cmd = NULL; char *cmdline; guint i; int j; GPtrArray *argv_ptr = g_ptr_array_new(); char *newoptstr = NULL; off_t size1, size2; times_t start_time; char *qdisk = quote_string(dle->disk); char *qamdevice = quote_string(dle->device); amwait_t wait_status; char levelstr[NUM_STR_SIZE]; GSList *scriptlist; script_t *script; char *errmsg = NULL; estimate_t estimate; estimatelist_t el; cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); g_ptr_array_add(argv_ptr, stralloc(dle->program)); g_ptr_array_add(argv_ptr, stralloc("estimate")); if (bsu->message_line == 1) { g_ptr_array_add(argv_ptr, stralloc("--message")); g_ptr_array_add(argv_ptr, stralloc("line")); } if (g_options->config && bsu->config == 1) { g_ptr_array_add(argv_ptr, stralloc("--config")); g_ptr_array_add(argv_ptr, stralloc(g_options->config)); } if (g_options->hostname && bsu->host == 1) { g_ptr_array_add(argv_ptr, stralloc("--host")); g_ptr_array_add(argv_ptr, stralloc(g_options->hostname)); } g_ptr_array_add(argv_ptr, stralloc("--device")); g_ptr_array_add(argv_ptr, stralloc(dle->device)); if (dle->disk && bsu->disk == 1) { g_ptr_array_add(argv_ptr, stralloc("--disk")); g_ptr_array_add(argv_ptr, stralloc(dle->disk)); } for (j=0; j < nb_level; j++) { g_ptr_array_add(argv_ptr, stralloc("--level")); g_snprintf(levelstr,SIZEOF(levelstr),"%d", levels[j]); g_ptr_array_add(argv_ptr, stralloc(levelstr)); } /* find the first in ES_CLIENT and ES_CALCSIZE */ estimate = ES_CLIENT; for (el = dle->estimatelist; el != NULL; el = el->next) { estimate = (estimate_t)GPOINTER_TO_INT(el->data); if ((estimate == ES_CLIENT && bsu->client_estimate) || (estimate == ES_CALCSIZE && bsu->calcsize)) break; estimate = ES_CLIENT; } if (estimate == ES_CALCSIZE && bsu->calcsize) { g_ptr_array_add(argv_ptr, stralloc("--calcsize")); } application_property_add_to_argv(argv_ptr, dle, bsu, g_options->features); for (scriptlist = dle->scriptlist; scriptlist != NULL; scriptlist = scriptlist->next) { script = (script_t *)scriptlist->data; if (script->result && script->result->proplist) { property_add_to_argv(argv_ptr, script->result->proplist); } } g_ptr_array_add(argv_ptr, NULL); cmdline = stralloc(cmd); for(i = 1; i < argv_ptr->len-1; i++) cmdline = vstrextend(&cmdline, " ", (char *)g_ptr_array_index(argv_ptr, i), NULL); dbprintf("running: \"%s\"\n", cmdline); amfree(cmdline); if (pipe(pipeerrfd) < 0) { errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), strerror(errno)); goto common_exit; } if (pipe(pipeinfd) < 0) { errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), strerror(errno)); goto common_exit; } if (pipe(pipeoutfd) < 0) { errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), strerror(errno)); goto common_exit; } start_time = curclock(); switch(dumppid = fork()) { case -1: size = (off_t)-1; goto common_exit; default: break; /* parent */ case 0: dup2(pipeinfd[0], 0); dup2(pipeoutfd[1], 1); dup2(pipeerrfd[1], 2); aclose(pipeinfd[1]); aclose(pipeoutfd[0]); aclose(pipeerrfd[0]); safe_fd(-1, 0); execve(cmd, (char **)argv_ptr->pdata, safe_env()); error(_("exec %s failed: %s"), cmd, strerror(errno)); /*NOTREACHED*/ } amfree(newoptstr); aclose(pipeinfd[0]); aclose(pipeoutfd[1]); aclose(pipeerrfd[1]); aclose(pipeinfd[1]); dumpout = fdopen(pipeoutfd[0],"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { long long size1_ = (long long)0; long long size2_ = (long long)0; int level = 0; if (line[0] == '\0') continue; dbprintf("%s\n", line); if (strncmp(line,"ERROR ", 6) == 0) { char *errmsg, *qerrmsg; errmsg = stralloc(line+6); qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[0], qerrmsg); amfree(qerrmsg); continue; } i = sscanf(line, "%d %lld %lld", &level, &size1_, &size2_); if (i != 3) { i = sscanf(line, "%lld %lld", &size1_, &size2_); level = levels[0]; if (i != 2) { char *errmsg, *qerrmsg; errmsg = vstrallocf(_("bad line %s"), line); qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[0], qerrmsg); amfree(qerrmsg); continue; } } size1 = (off_t)size1_; size2 = (off_t)size2_; if (size1 <= 0 || size2 <=0) size = -1; else if (size1 * size2 > 0) size = size1 * size2; dbprintf(_("estimate size for %s level %d: %lld KB\n"), qamdevice, level, (long long)size); g_printf("%s %d SIZE %lld\n", est->qamname, level, (long long)size); } amfree(line); dumperr = fdopen(pipeerrfd[0],"r"); if (!dumperr) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } while ((line = agets(dumperr)) != NULL) { if (strlen(line) > 0) { char *err = g_strdup_printf(_("Application '%s': %s"), dle->program, line); char *qerr = quote_string(err); for (j=0; j < nb_level; j++) { fprintf(stdout, "%s %d ERROR %s\n", est->qamname, levels[j], qerr); } dbprintf("ERROR %s", qerr); amfree(err); amfree(qerr); } amfree(line); } dbprintf(".....\n"); if (nb_level == 1) { dbprintf(_("estimate time for %s level %d: %s\n"), qamdevice, levels[0], walltime_str(timessub(curclock(), start_time))); } else { dbprintf(_("estimate time for %s all level: %s\n"), qamdevice, walltime_str(timessub(curclock(), start_time))); } kill(-dumppid, SIGTERM); dbprintf(_("waiting for %s \"%s\" child\n"), cmd, qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), cmd, WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd, WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { errmsg = vstrallocf(_("%s got bad exit: see %s"), cmd, dbfn()); } dbprintf(_("after %s %s wait\n"), cmd, qdisk); afclose(dumpout); afclose(dumperr); common_exit: amfree(cmd); g_ptr_array_free_full(argv_ptr); amfree(newoptstr); amfree(qdisk); amfree(qamdevice); if (errmsg) { char *qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); for (j=0; j < nb_level; j++) { g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[j], qerrmsg); } amfree(errmsg); amfree(qerrmsg); } return size; } /* * Returns the value of the first integer in a string. */ double first_num( char * str) { char *start; int ch; double d; ch = *str++; while(ch && !isdigit(ch)) ch = *str++; start = str-1; while(isdigit(ch) || (ch == '.')) ch = *str++; str[-1] = '\0'; d = atof(start); str[-1] = (char)ch; return d; } /* * Checks the dump output line against the error and size regex tables. */ off_t handle_dumpline( char * str) { regex_scale_t *rp; double size; /* check for size match */ /*@ignore@*/ for(rp = re_size; rp->regex != NULL; rp++) { if(match(rp->regex, str)) { size = ((first_num(str)*rp->scale+1023.0)/1024.0); if(size < 0.0) size = 1.0; /* found on NeXT -- sigh */ return (off_t)size; } } /*@end@*/ return (off_t)-1; } amanda-3.3.6/client-src/findpass.c0000664000076400007640000001073112357250002020454 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: findpass.c,v 1.13 2006/05/25 01:47:11 johnfranks Exp $ * * Support routines for Amanda SAMBA support */ #include "amanda.h" #include "findpass.h" #include "util.h" /* * Find the Samba password and optional domain for a given disk. * Returns pointers into an alloc-ed area. The caller should clear them * as soon as reasonable. */ char * findpass( char * disk, char ** domain) { FILE *fp; static char *buffer = NULL; char *s, *d, *pw = NULL; int ch; char *qname; *domain = NULL; /* just to be sure */ if ( (fp = fopen("/etc/amandapass", "r")) ) { amfree(buffer); for (; (buffer = agets(fp)) != NULL; free(buffer)) { if (buffer[0] == '\0') continue; s = buffer; ch = *s++; skip_whitespace(s, ch); /* find start of disk name */ if (!ch || ch == '#') { continue; } qname = s-1; /* start of disk name */ skip_quoted_string(s, ch); if (ch && ch != '#') { s[-1] = '\0'; /* terminate disk name */ d = unquote_string(qname); if ((strcmp(d,"*") == 0) || (strcmp(disk, d) == 0)) { skip_whitespace(s, ch); /* find start of password */ if (ch && ch != '#') { pw = s - 1; /* start of password */ skip_non_whitespace_cs(s, ch); s[-1] = '\0'; /* terminate password */ pw = stralloc(pw); skip_whitespace(s, ch); /* find start of domain */ if (ch && ch != '#') { *domain = s - 1; /* start of domain */ skip_non_whitespace_cs(s, ch); s[-1] = '\0'; /* terminate domain */ *domain = stralloc(*domain); } } amfree(d); break; } amfree(d); } } afclose(fp); } return pw; } /* * Convert an amanda disk-name into a Samba sharename, * optionally for a shell execution (\'s are escaped). * Returns a new name alloc-d that the caller is responsible * for free-ing. */ char * makesharename( char * disk, int shell) { char *buffer; size_t buffer_size; char *s; int ch; buffer_size = 2 * strlen(disk) + 1; /* worst case */ buffer = alloc(buffer_size); s = buffer; while ((ch = *disk++) != '\0') { if (s >= buffer+buffer_size-2) { /* room for escape */ amfree(buffer); /* should never happen */ return NULL; /* buffer not big enough */ } if (ch == '/') { ch = '\\'; /* convert '/' to '\\' */ } if (ch == '\\' && shell) { *s++ = '\\'; /* add escape for shell */ } *s++ = ch; } *s = '\0'; /* terminate the share name */ return buffer; } /* * find out if the samba sharename specifies both a share * and a target subdirectory or just a share * * the caller is expected to release share & subdir */ void parsesharename( char * disk, char ** share, char ** subdir) { char *ch=NULL; int slashcnt=0; *share = NULL; *subdir = NULL; if (!disk) { return; } *share = stralloc(disk); ch = *share; *subdir = NULL; while (*ch != '\0') { if (*ch == '/') {slashcnt++;} if (slashcnt == 4) { *ch = '\0'; *subdir = stralloc(++ch); return; } ch++; } } amanda-3.3.6/client-src/noop.c0000664000076400007640000000641612357250002017625 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1999 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: noop.c,v 1.5 2006/06/01 14:54:39 martinea Exp $ * * send back features. This was pulled out to it's own program for * consistancy and because it's a hell of a lot easier to code in * a fork()-less environment. */ #include "amanda.h" #include "amfeatures.h" #include "util.h" int main(int argc, char **argv); int main( int argc, char ** argv) { char ch; am_feature_t *our_features = NULL; char *our_feature_string = NULL; char *options; ssize_t n; (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("noop-%s\n", VERSION); return (0); } /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); safe_fd(-1, 0); openbsd_fd_inform(); check_running_as(RUNNING_AS_CLIENT_LOGIN); do { /* soak up any stdin */ n = read(0, &ch, 1); } while ((n > 0) || ((n < 0) && ((errno == EINTR) || (errno == EAGAIN)))); our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); options = vstralloc("OPTIONS features=", our_feature_string, ";\n", NULL); amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; if (full_write(1, options, strlen(options)) < strlen(options)) { error(_("error sending noop response: %s"), strerror(errno)); /*NOTREACHED*/ } amfree(options); close(0); close(1); close(2); return (0); /* exit */ } amanda-3.3.6/client-src/client_util.c0000664000076400007640000014624512357250002021172 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: client_util.c,v 1.34 2006/05/25 01:47:11 johnfranks Exp $ * */ #include "amanda.h" #include "conffile.h" #include "client_util.h" #include "getfsent.h" #include "util.h" #include "glib-util.h" #include "timestamp.h" #include "pipespawn.h" #include "amxml.h" #include "glob.h" #include "clock.h" #include "amandates.h" #define MAXMAXDUMPS 16 static int add_exclude(FILE *file_exclude, char *aexc, int verbose); static int add_include(char *disk, char *device, FILE *file_include, char *ainc, int verbose); static char *build_name(char *disk, char *exin, int verbose); static char *get_name(char *diskname, char *exin, time_t t, int n); char * fixup_relative( char * name, char * device) { char *newname; if(*name != '/') { char *dirname = amname_to_dirname(device); newname = vstralloc(dirname, "/", name , NULL); amfree(dirname); } else { newname = stralloc(name); } return newname; } /* GDestroyFunc for a hash table whose values are GSLists contianing malloc'd * strings */ static void destroy_slist_free_full(gpointer list) { slist_free_full((GSList *)list, g_free); } static char * get_name( char * diskname, char * exin, time_t t, int n) { char number[NUM_STR_SIZE]; char *filename; char *ts; ts = get_timestamp_from_time(t); if(n == 0) number[0] = '\0'; else g_snprintf(number, SIZEOF(number), "%03d", n - 1); filename = vstralloc(get_pname(), ".", diskname, ".", ts, number, ".", exin, NULL); amfree(ts); return filename; } static char * build_name( char * disk, char * exin, int verbose) { int n; int fd; char *filename = NULL; char *afilename = NULL; char *diskname; time_t curtime; char *dbgdir; char *e = NULL; DIR *d; struct dirent *entry; char *test_name; size_t match_len, d_name_len; char *quoted; time(&curtime); diskname = sanitise_filename(disk); dbgdir = stralloc2(AMANDA_TMPDIR, "/"); if((d = opendir(AMANDA_TMPDIR)) == NULL) { error(_("open debug directory \"%s\": %s"), AMANDA_TMPDIR, strerror(errno)); /*NOTREACHED*/ } test_name = get_name(diskname, exin, curtime - (getconf_int(CNF_DEBUG_DAYS) * 24 * 60 * 60), 0); match_len = strlen(get_pname()) + strlen(diskname) + 2; while((entry = readdir(d)) != NULL) { if(is_dot_or_dotdot(entry->d_name)) { continue; } d_name_len = strlen(entry->d_name); if(strncmp(test_name, entry->d_name, match_len) != 0 || d_name_len < match_len + 14 + 8 || strcmp(entry->d_name+ d_name_len - 7, exin) != 0) { continue; /* not one of our files */ } if(strcmp(entry->d_name, test_name) < 0) { e = newvstralloc(e, dbgdir, entry->d_name, NULL); (void) unlink(e); /* get rid of old file */ } } amfree(test_name); amfree(e); closedir(d); n=0; do { filename = get_name(diskname, exin, curtime, n); afilename = newvstralloc(afilename, dbgdir, filename, NULL); if((fd=open(afilename, O_WRONLY|O_CREAT|O_APPEND, 0600)) < 0){ amfree(afilename); n++; } else { close(fd); } amfree(filename); } while(!afilename && n < 1000); if(afilename == NULL) { filename = get_name(diskname, exin, curtime, 0); afilename = newvstralloc(afilename, dbgdir, filename, NULL); quoted = quote_string(afilename); dbprintf(_("Cannot create %s (%s)\n"), quoted, strerror(errno)); if(verbose) { g_printf(_("ERROR [cannot create %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); amfree(afilename); amfree(filename); } amfree(dbgdir); amfree(diskname); return afilename; } static int add_exclude( FILE * file_exclude, char * aexc, int verbose) { size_t l; char *quoted, *file; (void)verbose; /* Quiet unused parameter warning */ l = strlen(aexc); if(aexc[l-1] == '\n') { aexc[l-1] = '\0'; l--; } file = quoted = quote_string(aexc); if (*file == '"') { file[strlen(file) - 1] = '\0'; file++; } g_fprintf(file_exclude, "%s\n", file); amfree(quoted); return 1; } static int add_include( char * disk, char * device, FILE * file_include, char * ainc, int verbose) { size_t l; int nb_exp=0; char *quoted, *file; (void)disk; /* Quiet unused parameter warning */ (void)device; /* Quiet unused parameter warning */ l = strlen(ainc); if(ainc[l-1] == '\n') { ainc[l-1] = '\0'; l--; } if (strncmp(ainc, "./", 2) != 0) { quoted = quote_string(ainc); dbprintf(_("include must start with './' (%s)\n"), quoted); if(verbose) { g_printf(_("ERROR [include must start with './' (%s)]\n"), quoted); } amfree(quoted); } else { char *incname = ainc+2; int set_root; set_root = set_root_privs(1); /* Take as is if not root && many '/' */ if(!set_root && strchr(incname, '/')) { file = quoted = quote_string(ainc); if (*file == '"') { file[strlen(file) - 1] = '\0'; file++; } g_fprintf(file_include, "%s\n", file); amfree(quoted); nb_exp++; } else { int nb; glob_t globbuf; char *cwd; globbuf.gl_offs = 0; cwd = g_get_current_dir(); if (chdir(device) != 0) { error(_("Failed to chdir(%s): %s\n"), device, strerror(errno)); } glob(incname, 0, NULL, &globbuf); if (chdir(cwd) != 0) { error(_("Failed to chdir(%s): %s\n"), cwd, strerror(errno)); } if (set_root) set_root_privs(0); nb_exp = globbuf.gl_pathc; for (nb=0; nb < nb_exp; nb++) { file = stralloc2("./", globbuf.gl_pathv[nb]); quoted = quote_string(file); if (*file == '"') { file[strlen(file) - 1] = '\0'; file++; } g_fprintf(file_include, "%s\n", file); amfree(quoted); amfree(file); } } } return nb_exp; } char * build_exclude( dle_t *dle, int verbose) { char *filename; FILE *file_exclude; FILE *exclude; char *aexc; sle_t *excl; int nb_exclude = 0; char *quoted; if (dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; if (dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; if (nb_exclude == 0) return NULL; if ((filename = build_name(dle->disk, "exclude", verbose)) != NULL) { if ((file_exclude = fopen(filename,"w")) != NULL) { if (dle->exclude_file) { for(excl = dle->exclude_file->first; excl != NULL; excl = excl->next) { add_exclude(file_exclude, excl->name, verbose && dle->exclude_optional == 0); } } if (dle->exclude_list) { for(excl = dle->exclude_list->first; excl != NULL; excl = excl->next) { char *exclname = fixup_relative(excl->name, dle->device); if((exclude = fopen(exclname, "r")) != NULL) { while ((aexc = agets(exclude)) != NULL) { if (aexc[0] == '\0') { amfree(aexc); continue; } add_exclude(file_exclude, aexc, verbose && dle->exclude_optional == 0); amfree(aexc); } fclose(exclude); } else { quoted = quote_string(exclname); dbprintf(_("Can't open exclude file %s (%s)\n"), quoted, strerror(errno)); if(verbose && (dle->exclude_optional == 0 || errno != ENOENT)) { g_printf(_("ERROR [Can't open exclude file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); } amfree(exclname); } } fclose(file_exclude); } else { quoted = quote_string(filename); dbprintf(_("Can't create exclude file %s (%s)\n"), quoted, strerror(errno)); if (verbose) { g_printf(_("ERROR [Can't create exclude file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); } } return filename; } char * build_include( dle_t *dle, int verbose) { char *filename; FILE *file_include; FILE *include; char *ainc = NULL; sle_t *incl; int nb_include = 0; int nb_exp = 0; char *quoted; if (dle->include_file) nb_include += dle->include_file->nb_element; if (dle->include_list) nb_include += dle->include_list->nb_element; if (nb_include == 0) return NULL; if ((filename = build_name(dle->disk, "include", verbose)) != NULL) { if ((file_include = fopen(filename,"w")) != NULL) { if (dle->include_file) { for (incl = dle->include_file->first; incl != NULL; incl = incl->next) { nb_exp += add_include(dle->disk, dle->device, file_include, incl->name, verbose && dle->include_optional == 0); } } if (dle->include_list) { for (incl = dle->include_list->first; incl != NULL; incl = incl->next) { char *inclname = fixup_relative(incl->name, dle->device); if ((include = fopen(inclname, "r")) != NULL) { while ((ainc = agets(include)) != NULL) { if (ainc[0] == '\0') { amfree(ainc); continue; } nb_exp += add_include(dle->disk, dle->device, file_include, ainc, verbose && dle->include_optional == 0); amfree(ainc); } fclose(include); } else { quoted = quote_string(inclname); dbprintf(_("Can't open include file %s (%s)\n"), quoted, strerror(errno)); if (verbose && (dle->include_optional == 0 || errno != ENOENT)) { g_printf(_("ERROR [Can't open include file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); } amfree(inclname); } } fclose(file_include); } else { quoted = quote_string(filename); dbprintf(_("Can't create include file %s (%s)\n"), quoted, strerror(errno)); if (verbose) { g_printf(_("ERROR [Can't create include file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); } } if (nb_exp == 0) { quoted = quote_string(dle->disk); dbprintf(_("Nothing found to include for disk %s\n"), quoted); if (verbose && dle->include_optional == 0) { g_printf(_("ERROR [Nothing found to include for disk %s]\n"), quoted); } amfree(quoted); } return filename; } void parse_options( char *str, dle_t *dle, am_feature_t *fs, int verbose) { char *exc; char *inc; char *p, *tok; char *quoted; p = stralloc(str); tok = strtok(p,";"); while (tok != NULL) { if(am_has_feature(fs, fe_options_auth) && BSTRNCMP(tok,"auth=") == 0) { if (dle->auth != NULL) { quoted = quote_string(tok + 5); dbprintf(_("multiple auth option %s\n"), quoted); if(verbose) { g_printf(_("ERROR [multiple auth option %s]\n"), quoted); } amfree(quoted); } dle->auth = stralloc(&tok[5]); } else if(am_has_feature(fs, fe_options_bsd_auth) && BSTRNCMP(tok, "bsd-auth") == 0) { if (dle->auth != NULL) { dbprintf(_("multiple auth option\n")); if (verbose) { g_printf(_("ERROR [multiple auth option]\n")); } } dle->auth = stralloc("bsd"); } else if (BSTRNCMP(tok, "compress-fast") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compress = COMP_FAST; } else if (BSTRNCMP(tok, "compress-best") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compress = COMP_BEST; } else if (BSTRNCMP(tok, "srvcomp-fast") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compress = COMP_SERVER_FAST; } else if (BSTRNCMP(tok, "srvcomp-best") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compress = COMP_SERVER_BEST; } else if (BSTRNCMP(tok, "srvcomp-cust=") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1); dle->compress = COMP_SERVER_CUST; } else if (BSTRNCMP(tok, "comp-cust=") == 0) { if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } dle->compprog = stralloc(tok + SIZEOF("comp-cust=") -1); dle->compress = COMP_CUST; /* parse encryption options */ } else if (BSTRNCMP(tok, "encrypt-serv-cust=") == 0) { if (dle->encrypt != ENCRYPT_NONE) { dbprintf(_("multiple encrypt option\n")); if (verbose) { g_printf(_("ERROR [multiple encrypt option]\n")); } } dle->srv_encrypt = stralloc(tok + SIZEOF("encrypt-serv-cust=") -1); dle->encrypt = ENCRYPT_SERV_CUST; } else if (BSTRNCMP(tok, "encrypt-cust=") == 0) { if (dle->encrypt != ENCRYPT_NONE) { dbprintf(_("multiple encrypt option\n")); if (verbose) { g_printf(_("ERROR [multiple encrypt option]\n")); } } dle->clnt_encrypt= stralloc(tok + SIZEOF("encrypt-cust=") -1); dle->encrypt = ENCRYPT_CUST; } else if (BSTRNCMP(tok, "server-decrypt-option=") == 0) { dle->srv_decrypt_opt = stralloc(tok + SIZEOF("server-decrypt-option=") -1); } else if (BSTRNCMP(tok, "client-decrypt-option=") == 0) { dle->clnt_decrypt_opt = stralloc(tok + SIZEOF("client-decrypt-option=") -1); } else if (BSTRNCMP(tok, "no-record") == 0) { if (dle->record != 1) { dbprintf(_("multiple no-record option\n")); if (verbose) { g_printf(_("ERROR [multiple no-record option]\n")); } } dle->record = 0; } else if (BSTRNCMP(tok, "index") == 0) { if (dle->create_index != 0) { dbprintf(_("multiple index option\n")); if (verbose) { g_printf(_("ERROR [multiple index option]\n")); } } dle->create_index = 1; } else if (BSTRNCMP(tok, "exclude-optional") == 0) { if (dle->exclude_optional != 0) { dbprintf(_("multiple exclude-optional option\n")); if (verbose) { g_printf(_("ERROR [multiple exclude-optional option]\n")); } } dle->exclude_optional = 1; } else if (strcmp(tok, "include-optional") == 0) { if (dle->include_optional != 0) { dbprintf(_("multiple include-optional option\n")); if (verbose) { g_printf(_("ERROR [multiple include-optional option]\n")); } } dle->include_optional = 1; } else if (BSTRNCMP(tok,"exclude-file=") == 0) { exc = unquote_string(&tok[13]); dle->exclude_file = append_sl(dle->exclude_file, exc); amfree(exc); } else if (BSTRNCMP(tok,"exclude-list=") == 0) { exc = unquote_string(&tok[13]); dle->exclude_list = append_sl(dle->exclude_list, exc); amfree(exc); } else if (BSTRNCMP(tok,"include-file=") == 0) { inc = unquote_string(&tok[13]); dle->include_file = append_sl(dle->include_file, inc); amfree(inc); } else if (BSTRNCMP(tok,"include-list=") == 0) { inc = unquote_string(&tok[13]); dle->include_list = append_sl(dle->include_list, inc); amfree(inc); } else if (BSTRNCMP(tok,"kencrypt") == 0) { dle->kencrypt = 1; } else if (strcmp(tok,"|") != 0) { quoted = quote_string(tok); dbprintf(_("unknown option %s\n"), quoted); if (verbose) { g_printf(_("ERROR [unknown option: %s]\n"), quoted); } amfree(quoted); } tok = strtok(NULL, ";"); } amfree(p); } void application_property_add_to_argv( GPtrArray *argv_ptr, dle_t *dle, backup_support_option_t *bsu, am_feature_t *amfeatures) { sle_t *incl, *excl; if (bsu) { if (bsu->include_file && dle->include_file) { for (incl = dle->include_file->first; incl != NULL; incl = incl->next) { g_ptr_array_add(argv_ptr, stralloc("--include-file")); g_ptr_array_add(argv_ptr, stralloc(incl->name)); } } if (bsu->include_list && dle->include_list) { for (incl = dle->include_list->first; incl != NULL; incl = incl->next) { g_ptr_array_add(argv_ptr, stralloc("--include-list")); g_ptr_array_add(argv_ptr, stralloc(incl->name)); } } if (bsu->include_optional && dle->include_optional) { g_ptr_array_add(argv_ptr, stralloc("--include-optional")); g_ptr_array_add(argv_ptr, stralloc("yes")); } if (bsu->exclude_file && dle->exclude_file) { for (excl = dle->exclude_file->first; excl != NULL; excl = excl->next) { g_ptr_array_add(argv_ptr, stralloc("--exclude-file")); g_ptr_array_add(argv_ptr, stralloc(excl->name)); } } if (bsu->exclude_list && dle->exclude_list) { for (excl = dle->exclude_list->first; excl != NULL; excl = excl->next) { g_ptr_array_add(argv_ptr, stralloc("--exclude-list")); g_ptr_array_add(argv_ptr, stralloc(excl->name)); } } if (bsu->exclude_optional && dle->exclude_optional) { g_ptr_array_add(argv_ptr, stralloc("--exclude-optional")); g_ptr_array_add(argv_ptr, stralloc("yes")); } if (bsu->features && amfeatures) { char *feature_string = am_feature_to_string(amfeatures); g_ptr_array_add(argv_ptr, stralloc("--amfeatures")); g_ptr_array_add(argv_ptr, feature_string); } if (dle->data_path == DATA_PATH_DIRECTTCP && bsu->data_path_set & DATA_PATH_DIRECTTCP) { GSList *directtcp; g_ptr_array_add(argv_ptr, stralloc("--data-path")); g_ptr_array_add(argv_ptr, stralloc("directtcp")); for (directtcp = dle->directtcp_list; directtcp != NULL; directtcp = directtcp->next) { g_ptr_array_add(argv_ptr, stralloc("--direct-tcp")); g_ptr_array_add(argv_ptr, stralloc(directtcp->data)); break; /* XXX temporary; apps only support one ip:port pair */ } } } property_add_to_argv(argv_ptr, dle->application_property); return; } typedef struct { dle_t *dle; char *name; proplist_t dle_proplist; int verbose; int good; } merge_property_t; static void merge_property( gpointer key_p, gpointer value_p, gpointer user_data_p) { char *property_s = key_p; property_t *conf_property = value_p; merge_property_t *merge_p = user_data_p; property_t *dle_property = g_hash_table_lookup(merge_p->dle_proplist, property_s); GSList *value; char *qdisk = quote_string(merge_p->dle->disk); if (dle_property) { if (dle_property->priority && conf_property->priority) { if (merge_p->verbose) { g_fprintf(stdout, _("ERROR %s (%s) Both server client have priority for property '%s'.\n"), qdisk, merge_p->name, property_s); } g_debug("ERROR %s (%s) Both server client have priority for property '%s'.", qdisk, merge_p->name, property_s); merge_p->good = 0; /* Use client property */ g_hash_table_remove(merge_p->dle_proplist, key_p); g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property); } else if (dle_property->priority) { if (merge_p->verbose) { g_fprintf(stdout, _("ERROR %s (%s) Server set priority for property '%s' but client set the property.\n"), qdisk, merge_p->name, property_s); } g_debug("%s (%s) Server set priority for property '%s' but client set the property.", qdisk, merge_p->name, property_s); /* use server property */ } else if (conf_property->priority) { if (merge_p->verbose) { g_fprintf(stdout, _("ERROR %s (%s) Client set priority for property '%s' but server set the property.\n"), qdisk, merge_p->name, property_s); } g_debug("%s (%s) Client set priority for property '%s' but server set the property.", qdisk, merge_p->name, property_s); /* Use client property */ g_hash_table_remove(merge_p->dle_proplist, key_p); g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property); } else if (!conf_property->append) { if (merge_p->verbose) { g_fprintf(stdout, _("ERROR %s (%s) Both server and client set property '%s', using client value.\n"), qdisk, merge_p->name, property_s); } g_debug("%s (%s) Both server and client set property '%s', using client value.", qdisk, merge_p->name, property_s); /* Use client property */ g_hash_table_remove(merge_p->dle_proplist, key_p); g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property); } else { /* merge */ for (value = conf_property->values; value != NULL; value = value->next) { dle_property->values = g_slist_append(dle_property->values, value->data); } } } else { /* take value from conf */ g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property); } } int merge_properties( dle_t *dle, char *name, proplist_t dle_proplist, proplist_t conf_proplist, int verbose) { merge_property_t merge_p = {dle, name, dle_proplist, verbose, 1}; if (conf_proplist != NULL) { g_hash_table_foreach(conf_proplist, &merge_property, &merge_p); } return merge_p.good; } int merge_dles_properties( dle_t *dles, int verbose) { dle_t *dle; application_t *app; GSList *scriptlist; pp_script_t *pp_script; int good = 1; for (dle=dles; dle != NULL; dle=dle->next) { if (dle->program_is_application_api) { app = NULL; if (dle->application_client_name && strlen(dle->application_client_name) > 0) { app = lookup_application(dle->application_client_name); if (!app) { char *qamname = quote_string(dle->disk); char *errmsg = vstrallocf("Application '%s' not found on client", dle->application_client_name); char *qerrmsg = quote_string(errmsg); good = 0; if (verbose) { g_fprintf(stdout, _("ERROR %s %s\n"), qamname, qerrmsg); } g_debug("%s: %s", qamname, qerrmsg); amfree(qamname); amfree(errmsg); amfree(qerrmsg); } } else { app = lookup_application(dle->program); } if (app) { merge_properties(dle, dle->program, dle->application_property, application_get_property(app), verbose); } } for (scriptlist = dle->scriptlist; scriptlist != NULL; scriptlist = scriptlist->next) { script_t *script = scriptlist->data; pp_script = NULL; if (script->client_name && strlen(script->client_name) > 0) { pp_script = lookup_pp_script(script->client_name); if (!pp_script) { char *qamname = quote_string(dle->disk); char *errmsg = vstrallocf("Script '%s' not found on client", script->client_name); char *qerrmsg = quote_string(errmsg); good = 0; if (verbose) { g_fprintf(stderr, _("ERROR %s %s\n"), qamname, qerrmsg); } g_debug("%s: %s", qamname, qerrmsg); amfree(qamname); amfree(errmsg); amfree(qerrmsg); } } else { pp_script = lookup_pp_script(script->plugin); } if (pp_script) { merge_properties(dle, script->plugin, script->property, pp_script_get_property(pp_script), verbose); } } } return good; } backup_support_option_t * backup_support_option( char *program, g_option_t *g_options, char *disk, char *amdevice, GPtrArray **errarray) { pid_t supportpid; int supportin, supportout, supporterr; char *cmd; GPtrArray *argv_ptr = g_ptr_array_new(); FILE *streamout; FILE *streamerr; char *line; int status; char *err = NULL; backup_support_option_t *bsu; *errarray = g_ptr_array_new(); cmd = vstralloc(APPLICATION_DIR, "/", program, NULL); g_ptr_array_add(argv_ptr, stralloc(program)); g_ptr_array_add(argv_ptr, stralloc("support")); if (g_options->config) { g_ptr_array_add(argv_ptr, stralloc("--config")); g_ptr_array_add(argv_ptr, stralloc(g_options->config)); } if (g_options->hostname) { g_ptr_array_add(argv_ptr, stralloc("--host")); g_ptr_array_add(argv_ptr, stralloc(g_options->hostname)); } if (disk) { g_ptr_array_add(argv_ptr, stralloc("--disk")); g_ptr_array_add(argv_ptr, stralloc(disk)); } if (amdevice) { g_ptr_array_add(argv_ptr, stralloc("--device")); g_ptr_array_add(argv_ptr, stralloc(amdevice)); } g_ptr_array_add(argv_ptr, NULL); supporterr = fileno(stderr); supportpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE|STDERR_PIPE, 0, &supportin, &supportout, &supporterr, (char **)argv_ptr->pdata); aclose(supportin); bsu = g_new0(backup_support_option_t, 1); bsu->config = 1; bsu->host = 1; bsu->disk = 1; streamout = fdopen(supportout, "r"); if (!streamout) { error(_("Error opening pipe to child: %s"), strerror(errno)); /* NOTREACHED */ } while((line = agets(streamout)) != NULL) { dbprintf(_("support line: %s\n"), line); if (strncmp(line,"CONFIG ", 7) == 0) { if (strcmp(line+7, "YES") == 0) bsu->config = 1; } else if (strncmp(line,"HOST ", 5) == 0) { if (strcmp(line+5, "YES") == 0) bsu->host = 1; } else if (strncmp(line,"DISK ", 5) == 0) { if (strcmp(line+5, "YES") == 0) bsu->disk = 1; } else if (strncmp(line,"INDEX-LINE ", 11) == 0) { if (strcmp(line+11, "YES") == 0) bsu->index_line = 1; } else if (strncmp(line,"INDEX-XML ", 10) == 0) { if (strcmp(line+10, "YES") == 0) bsu->index_xml = 1; } else if (strncmp(line,"MESSAGE-LINE ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->message_line = 1; } else if (strncmp(line,"MESSAGE-XML ", 12) == 0) { if (strcmp(line+12, "YES") == 0) bsu->message_xml = 1; } else if (strncmp(line,"RECORD ", 7) == 0) { if (strcmp(line+7, "YES") == 0) bsu->record = 1; } else if (strncmp(line,"INCLUDE-FILE ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->include_file = 1; } else if (strncmp(line,"INCLUDE-LIST ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->include_list = 1; } else if (strncmp(line,"INCLUDE-LIST-GLOB ", 17) == 0) { if (strcmp(line+17, "YES") == 0) bsu->include_list_glob = 1; } else if (strncmp(line,"INCLUDE-OPTIONAL ", 17) == 0) { if (strcmp(line+17, "YES") == 0) bsu->include_optional = 1; } else if (strncmp(line,"EXCLUDE-FILE ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->exclude_file = 1; } else if (strncmp(line,"EXCLUDE-LIST ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->exclude_list = 1; } else if (strncmp(line,"EXCLUDE-LIST-GLOB ", 17) == 0) { if (strcmp(line+17, "YES") == 0) bsu->exclude_list_glob = 1; } else if (strncmp(line,"EXCLUDE-OPTIONAL ", 17) == 0) { if (strcmp(line+17, "YES") == 0) bsu->exclude_optional = 1; } else if (strncmp(line,"COLLECTION ", 11) == 0) { if (strcmp(line+11, "YES") == 0) bsu->collection = 1; } else if (strncmp(line,"CALCSIZE ", 9) == 0) { if (strcmp(line+9, "YES") == 0) bsu->calcsize = 1; } else if (strncmp(line,"CLIENT-ESTIMATE ", 16) == 0) { if (strcmp(line+16, "YES") == 0) bsu->client_estimate = 1; } else if (strncmp(line,"MULTI-ESTIMATE ", 15) == 0) { if (strcmp(line+15, "YES") == 0) bsu->multi_estimate = 1; } else if (strncmp(line,"MAX-LEVEL ", 10) == 0) { bsu->max_level = atoi(line+10); } else if (strncmp(line,"RECOVER-MODE ", 13) == 0) { if (strcasecmp(line+13, "SMB") == 0) bsu->smb_recover_mode = 1; } else if (strncmp(line,"DATA-PATH ", 10) == 0) { if (strcasecmp(line+10, "AMANDA") == 0) bsu->data_path_set |= DATA_PATH_AMANDA; else if (strcasecmp(line+10, "DIRECTTCP") == 0) bsu->data_path_set |= DATA_PATH_DIRECTTCP; } else if (strncmp(line,"RECOVER-PATH ", 13) == 0) { if (strcasecmp(line+13, "CWD") == 0) bsu->recover_path = RECOVER_PATH_CWD; else if (strcasecmp(line+13, "REMOTE") == 0) bsu->recover_path = RECOVER_PATH_REMOTE; } else if (strncmp(line,"AMFEATURES ", 11) == 0) { if (strcmp(line+11, "YES") == 0) bsu->features = 1; } else if (g_str_has_prefix(line, "RECOVER-DUMP-STATE-FILE ")) { if (g_str_equal(line + 19, "YES")) bsu->features = 1; } else { dbprintf(_("Invalid support line: %s\n"), line); } amfree(line); } fclose(streamout); if (bsu->data_path_set == 0) bsu->data_path_set = DATA_PATH_AMANDA; streamerr = fdopen(supporterr, "r"); if (!streamerr) { error(_("Error opening pipe to child: %s"), strerror(errno)); /* NOTREACHED */ } while((line = agets(streamerr)) != NULL) { if (strlen(line) > 0) { g_ptr_array_add(*errarray, line); dbprintf("Application '%s': %s\n", program, line); } amfree(bsu); } fclose(streamerr); if (waitpid(supportpid, &status, 0) < 0) { err = vstrallocf(_("waitpid failed: %s"), strerror(errno)); } else if (!WIFEXITED(status)) { err = vstrallocf(_("exited with signal %d"), WTERMSIG(status)); } else if (WEXITSTATUS(status) != 0) { err = vstrallocf(_("exited with status %d"), WEXITSTATUS(status)); } if (err) { g_ptr_array_add(*errarray, err); dbprintf("Application '%s': %s\n", program, err); amfree(bsu); } g_ptr_array_free_full(argv_ptr); amfree(cmd); return bsu; } void run_client_script( script_t *script, execute_on_t execute_on, g_option_t *g_options, dle_t *dle) { pid_t scriptpid; int scriptin, scriptout, scripterr; char *cmd; GPtrArray *argv_ptr = g_ptr_array_new(); FILE *streamout; FILE *streamerr; char *line; amwait_t wait_status; char *command = NULL; if ((script->execute_on & execute_on) == 0) return; if (script->execute_where != ES_CLIENT) return; cmd = vstralloc(APPLICATION_DIR, "/", script->plugin, NULL); g_ptr_array_add(argv_ptr, stralloc(script->plugin)); switch (execute_on) { case EXECUTE_ON_PRE_DLE_AMCHECK: command = "PRE-DLE-AMCHECK"; break; case EXECUTE_ON_PRE_HOST_AMCHECK: command = "PRE-HOST-AMCHECK"; break; case EXECUTE_ON_POST_DLE_AMCHECK: command = "POST-DLE-AMCHECK"; break; case EXECUTE_ON_POST_HOST_AMCHECK: command = "POST-HOST-AMCHECK"; break; case EXECUTE_ON_PRE_DLE_ESTIMATE: command = "PRE-DLE-ESTIMATE"; break; case EXECUTE_ON_PRE_HOST_ESTIMATE: command = "PRE-HOST-ESTIMATE"; break; case EXECUTE_ON_POST_DLE_ESTIMATE: command = "POST-DLE-ESTIMATE"; break; case EXECUTE_ON_POST_HOST_ESTIMATE: command = "POST-HOST-ESTIMATE"; break; case EXECUTE_ON_PRE_DLE_BACKUP: command = "PRE-DLE-BACKUP"; break; case EXECUTE_ON_PRE_HOST_BACKUP: command = "PRE-HOST-BACKUP"; break; case EXECUTE_ON_POST_DLE_BACKUP: command = "POST-DLE-BACKUP"; break; case EXECUTE_ON_POST_HOST_BACKUP: command = "POST-HOST-BACKUP"; break; case EXECUTE_ON_PRE_RECOVER: command = "PRE-RECOVER"; break; case EXECUTE_ON_POST_RECOVER: command = "POST-RECOVER"; break; case EXECUTE_ON_PRE_LEVEL_RECOVER: command = "PRE-LEVEL-RECOVER"; break; case EXECUTE_ON_POST_LEVEL_RECOVER: command = "POST-LEVEL-RECOVER"; break; case EXECUTE_ON_INTER_LEVEL_RECOVER: command = "INTER-LEVEL-RECOVER"; break; } g_ptr_array_add(argv_ptr, stralloc(command)); g_ptr_array_add(argv_ptr, stralloc("--execute-where")); g_ptr_array_add(argv_ptr, stralloc("client")); if (g_options->config) { g_ptr_array_add(argv_ptr, stralloc("--config")); g_ptr_array_add(argv_ptr, stralloc(g_options->config)); } if (g_options->hostname) { g_ptr_array_add(argv_ptr, stralloc("--host")); g_ptr_array_add(argv_ptr, stralloc(g_options->hostname)); } if (dle->disk) { g_ptr_array_add(argv_ptr, stralloc("--disk")); g_ptr_array_add(argv_ptr, stralloc(dle->disk)); } if (dle->device) { g_ptr_array_add(argv_ptr, stralloc("--device")); g_ptr_array_add(argv_ptr, stralloc(dle->device)); } if (dle->levellist) { levellist_t levellist; char number[NUM_STR_SIZE]; for (levellist=dle->levellist; levellist; levellist=levellist->next) { am_level_t *alevel = (am_level_t *)levellist->data; g_ptr_array_add(argv_ptr, stralloc("--level")); g_snprintf(number, SIZEOF(number), "%d", alevel->level); g_ptr_array_add(argv_ptr, stralloc(number)); } } property_add_to_argv(argv_ptr, script->property); g_ptr_array_add(argv_ptr, NULL); scriptpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE|STDERR_PIPE, 0, &scriptin, &scriptout, &scripterr, (char **)argv_ptr->pdata); close(scriptin); script->result = g_new0(client_script_result_t, 1); script->result->proplist = g_hash_table_new_full(g_str_hash, g_str_equal, &g_free, &destroy_slist_free_full); script->result->output = g_ptr_array_new(); script->result->err = g_ptr_array_new(); streamout = fdopen(scriptout, "r"); if (streamout) { while((line = agets(streamout)) != NULL) { dbprintf("script: %s\n", line); if (BSTRNCMP(line, "PROPERTY ") == 0) { char *property_name, *property_value; property_name = line + 9; property_value = strchr(property_name,' '); if (property_value == NULL) { char *msg = g_strdup_printf( "ERROR %s: Bad output property: %s", script->plugin, line); g_ptr_array_add(script->result->output, msg); } else { property_t *property; *property_value++ = '\0'; property_name = stralloc(property_name); property_value = stralloc(property_value); property = g_hash_table_lookup(script->result->proplist, property_name); if (!property) { property = g_new0(property_t, 1); g_hash_table_insert(script->result->proplist, property_name, property); } property->values = g_slist_append(property->values, property_value); } amfree(line); } else { g_ptr_array_add(script->result->output, line); } } } fclose(streamout); streamerr = fdopen(scripterr, "r"); if (streamerr) { while((line = agets(streamerr)) != NULL) { g_ptr_array_add(script->result->err, g_strdup_printf(_("Script '%s' command '%s': %s"), script->plugin, command, line)); amfree(line); } } waitpid(scriptpid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { g_ptr_array_add(script->result->err, g_strdup_printf(_("Script '%s' command '%s' terminated with signal %d: see %s"), script->plugin, command, WTERMSIG(wait_status), dbfn())); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { g_ptr_array_add(script->result->err, g_strdup_printf(_("Script '%s' command '%s' exited with status %d: see %s"), script->plugin, command, WEXITSTATUS(wait_status), dbfn())); } else { /* Normal exit */ } } amfree(cmd); g_ptr_array_free_full(argv_ptr); } void run_client_script_output(gpointer data, gpointer user_data); void run_client_script_output_backup(gpointer data, gpointer user_data); void run_client_script_err_amcheck(gpointer data, gpointer user_data); void run_client_script_err_estimate(gpointer data, gpointer user_data); void run_client_script_err_backup(gpointer data, gpointer user_data); void run_client_script_err_recover(gpointer data, gpointer user_data); typedef struct script_output_s { FILE *stream; dle_t *dle; } script_output_t; void run_client_script_output( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { g_fprintf(so->stream, "%s\n", line); } } void run_client_script_output_backup( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { g_fprintf(so->stream, "| %s\n", line); } } void run_client_script_err_amcheck( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { g_fprintf(so->stream, "ERROR %s\n", line); } } void run_client_script_err_estimate( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { char *qdisk = quote_string(so->dle->disk); g_fprintf(so->stream, "%s 0 WARNING \"%s\"\n", qdisk, line); amfree(qdisk); } } void run_client_script_err_backup( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { g_fprintf(so->stream, "? %s\n", line); } } void run_client_script_err_recover( gpointer data, gpointer user_data) { char *line = data; script_output_t *so = user_data; if (line && so->stream) { g_fprintf(so->stream, "%s\n", line); } } void run_client_scripts( execute_on_t execute_on, g_option_t *g_options, dle_t *dle, FILE *streamout) { GSList *scriptlist; script_t *script; GFunc client_script_err = NULL; GFunc client_script_out = NULL; script_output_t so = { streamout, dle }; for (scriptlist = dle->scriptlist; scriptlist != NULL; scriptlist = scriptlist->next) { script = (script_t *)scriptlist->data; run_client_script(script, execute_on, g_options, dle); if (script->result) { switch (execute_on) { case EXECUTE_ON_PRE_DLE_AMCHECK: case EXECUTE_ON_PRE_HOST_AMCHECK: case EXECUTE_ON_POST_DLE_AMCHECK: case EXECUTE_ON_POST_HOST_AMCHECK: client_script_out = run_client_script_output; client_script_err = run_client_script_err_amcheck; break; case EXECUTE_ON_PRE_DLE_ESTIMATE: case EXECUTE_ON_PRE_HOST_ESTIMATE: case EXECUTE_ON_POST_DLE_ESTIMATE: case EXECUTE_ON_POST_HOST_ESTIMATE: client_script_out = run_client_script_output; if (am_has_feature(g_options->features, fe_sendsize_rep_warning)) { client_script_err = run_client_script_err_estimate; } break; case EXECUTE_ON_PRE_DLE_BACKUP: case EXECUTE_ON_PRE_HOST_BACKUP: case EXECUTE_ON_POST_DLE_BACKUP: case EXECUTE_ON_POST_HOST_BACKUP: client_script_out = run_client_script_output_backup; client_script_err = run_client_script_err_backup; break; case EXECUTE_ON_PRE_RECOVER: case EXECUTE_ON_POST_RECOVER: case EXECUTE_ON_PRE_LEVEL_RECOVER: case EXECUTE_ON_POST_LEVEL_RECOVER: case EXECUTE_ON_INTER_LEVEL_RECOVER: client_script_out = run_client_script_output; client_script_err = run_client_script_err_recover; } if (script->result->output) { if (client_script_out) { g_ptr_array_foreach(script->result->output, client_script_out, &so); } g_ptr_array_free(script->result->output, TRUE); script->result->output = NULL; } if (script->result->err) { if (client_script_err != NULL) { g_ptr_array_foreach(script->result->err, client_script_err, &so); } g_ptr_array_free(script->result->err, TRUE); script->result->err = NULL; } } } } void run_calcsize( char *config, char *program, char *disk, char *dirname, GSList *levels, char *file_exclude, char *file_include) { char *cmd, *cmdline; char *command; GPtrArray *argv_ptr = g_ptr_array_new(); char tmppath[PATH_MAX]; char number[NUM_STR_SIZE]; GSList *alevel; guint level; guint i; char *match_expr; int pipefd = -1, nullfd = -1; pid_t calcpid; times_t start_time; FILE *dumpout = NULL; int dumpsince; char *errmsg = NULL; char *line = NULL; amwait_t wait_status; int len; char *qdisk; amandates_t *amdp; char *amandates_file; qdisk = quote_string(disk); amandates_file = getconf_str(CNF_AMANDATES); if(!start_amandates(amandates_file, 0)) { char *errstr = strerror(errno); char *errmsg = vstrallocf(_("could not open %s: %s"), amandates_file, errstr); char *qerrmsg = quote_string(errmsg); g_printf(_("ERROR %s\n"), qerrmsg); amfree(qdisk); amfree(errmsg); amfree(qerrmsg); return; } startclock(); cmd = vstralloc(amlibexecdir, "/", "calcsize", NULL); g_ptr_array_add(argv_ptr, stralloc("calcsize")); if (config) g_ptr_array_add(argv_ptr, stralloc(config)); else g_ptr_array_add(argv_ptr, stralloc("NOCONFIG")); g_ptr_array_add(argv_ptr, stralloc(program)); canonicalize_pathname(disk, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); canonicalize_pathname(dirname, tmppath); g_ptr_array_add(argv_ptr, stralloc(tmppath)); if (file_exclude) { g_ptr_array_add(argv_ptr, stralloc("-X")); g_ptr_array_add(argv_ptr, stralloc(file_exclude)); } if (file_include) { g_ptr_array_add(argv_ptr, stralloc("-I")); g_ptr_array_add(argv_ptr, stralloc(file_include)); } for (alevel = levels; alevel != NULL; alevel = alevel->next) { amdp = amandates_lookup(disk); level = GPOINTER_TO_INT(alevel->data); dbprintf("level: %d\n", level); dumpsince = 0; for (i=0; i < level; i++) { if (dumpsince < amdp->dates[i]) dumpsince = amdp->dates[i]; } g_snprintf(number, SIZEOF(number), "%d", level); g_ptr_array_add(argv_ptr, stralloc(number)); g_snprintf(number, SIZEOF(number), "%d", dumpsince); g_ptr_array_add(argv_ptr, stralloc(number)); } g_ptr_array_add(argv_ptr, NULL); command = (char *)g_ptr_array_index(argv_ptr, 0); cmdline = stralloc(command); for(i = 1; i < argv_ptr->len - 1; i++) cmdline = vstrextend(&cmdline, " ", (char *)g_ptr_array_index(argv_ptr,i), NULL); dbprintf(_("running: \"%s\"\n"), cmdline); amfree(cmdline); start_time = curclock(); fflush(stderr); fflush(stdout); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); dbprintf("%s\n", errmsg); goto common_exit; } calcpid = pipespawnv(cmd, STDERR_PIPE, 0, &nullfd, &nullfd, &pipefd, (char **)argv_ptr->pdata); amfree(cmd); dumpout = fdopen(pipefd,"r"); if (!dumpout) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } match_expr = vstralloc(" %d SIZE %lld", NULL); len = strlen(qdisk); for(; (line = agets(dumpout)) != NULL; free(line)) { long long size_ = (long long)0; if (line[0] == '\0' || (int)strlen(line) <= len) continue; /* Don't use sscanf for qdisk because it can have a '%'. */ if (strncmp(line, qdisk, len) == 0 && sscanf(line+len, match_expr, &level, &size_) == 2) { g_printf("%d %lld %d\n", level, size_, 1); /* write to sendsize */ dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, size_); } } amfree(match_expr); dbprintf(_("waiting for %s %s child (pid=%d)\n"), command, qdisk, (int)calcpid); waitpid(calcpid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), "calcsize", WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { errmsg = vstrallocf(_("%s exited with status %d: see %s"), "calcsize", WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { errmsg = vstrallocf(_("%s got bad exit: see %s"), "calcsize", dbfn()); } dbprintf(_("after %s %s wait: child pid=%d status=%d\n"), command, qdisk, (int)calcpid, WEXITSTATUS(wait_status)); dbprintf(_(".....\n")); dbprintf(_("estimate time for %s: %s\n"), qdisk, walltime_str(timessub(curclock(), start_time))); common_exit: if (errmsg && errmsg[0] != '\0') { char *qerrmsg = quote_string(errmsg); dbprintf(_("errmsg is %s\n"), errmsg); g_printf("ERROR %s\n", qerrmsg); amfree(qerrmsg); } amfree(qdisk); amfree(errmsg); g_ptr_array_free_full(argv_ptr); amfree(cmd); } gboolean check_access( char * filename, int mode) { char *noun, *adjective; char *quoted = quote_string(filename); gboolean result; if(mode == F_OK) noun = "find", adjective = "exists"; else if((mode & X_OK) == X_OK) noun = "execute", adjective = "executable"; else if((mode & (W_OK|R_OK)) == (W_OK|R_OK)) noun = "read/write", adjective = "read/writable"; else noun = "access", adjective = "accessible"; if(EUIDACCESS(filename, mode) == -1) { g_printf(_("ERROR [can not %s %s: %s (ruid:%d euid:%d)\n"), noun, quoted, strerror(errno), getuid(), geteuid()); result = FALSE; } else { g_printf(_("OK %s %s (ruid:%d euid:%d)\n"), quoted, adjective, getuid(), geteuid()); result = TRUE; } amfree(quoted); return result; } gboolean check_file( char * filename, int mode) { struct stat stat_buf; char *quoted; if(!stat(filename, &stat_buf)) { if(!S_ISREG(stat_buf.st_mode)) { quoted = quote_string(filename); g_printf(_("ERROR [%s is not a file]\n"), quoted); amfree(quoted); return FALSE; } } else { int save_errno = errno; quoted = quote_string(filename); g_printf(_("ERROR [can not stat %s: %s]\n"), quoted, strerror(save_errno)); amfree(quoted); return FALSE; } return check_access(filename, mode); } gboolean check_dir( char * dirname, int mode) { struct stat stat_buf; char *quoted; char *dir; gboolean result; if(!stat(dirname, &stat_buf)) { if(!S_ISDIR(stat_buf.st_mode)) { quoted = quote_string(dirname); g_printf(_("ERROR [%s is not a directory]\n"), quoted); amfree(quoted); return FALSE; } } else { int save_errno = errno; quoted = quote_string(dirname); g_printf(_("ERROR [can not stat %s: %s]\n"), quoted, strerror(save_errno)); amfree(quoted); return FALSE; } dir = g_strconcat(dirname, "/.", NULL); result = check_access(dir, mode); amfree(dir); return result; } gboolean check_suid( char * filename) { #ifndef SINGLE_USERID struct stat stat_buf; char *quoted = quote_string(filename); if(!stat(filename, &stat_buf)) { if(stat_buf.st_uid != 0 ) { g_printf(_("ERROR [%s is not owned by root]\n"), quoted); amfree(quoted); return FALSE; } if((stat_buf.st_mode & S_ISUID) != S_ISUID) { g_printf(_("ERROR [%s is not SUID root]\n"), quoted); amfree(quoted); return FALSE; } } else { g_printf(_("ERROR [can not stat %s: %s]\n"), quoted, strerror(errno)); amfree(quoted); return FALSE; } amfree(quoted); #else (void)filename; /* Quiet unused parameter warning */ #endif return TRUE; } /* * Returns the value of the first integer in a string. */ double the_num( char * str, int pos) { char *num; int ch; double d; do { ch = *str++; while(ch && !isdigit(ch)) ch = *str++; if (pos == 1) break; pos--; while(ch && (isdigit(ch) || ch == '.')) ch = *str++; } while (ch); num = str - 1; while(isdigit(ch) || ch == '.') ch = *str++; str[-1] = '\0'; d = atof(num); str[-1] = (char)ch; return d; } char * config_errors_to_error_string( GSList *errlist) { char *errmsg; gboolean multiple_errors = FALSE; if (errlist) { errmsg = (char *)errlist->data; if (errlist->next) multiple_errors = TRUE; } else { errmsg = _("(no error message)"); } return vstrallocf("ERROR %s%s", errmsg, multiple_errors? _(" (additional errors not displayed)"):""); } void add_type_table( dmpline_t typ, amregex_t **re_table, amregex_t *orig_re_table, GSList *normal_message, GSList *ignore_message, GSList *strange_message) { amregex_t *rp; for(rp = orig_re_table; rp->regex != NULL; rp++) { if (rp->typ == typ) { int found = 0; GSList *mes; for (mes = normal_message; mes != NULL; mes = mes->next) { if (strcmp(rp->regex, (char *)mes->data) == 0) found = 1; } for (mes = ignore_message; mes != NULL; mes = mes->next) { if (strcmp(rp->regex, (char *)mes->data) == 0) found = 1; } for (mes = strange_message; mes != NULL; mes = mes->next) { if (strcmp(rp->regex, (char *)mes->data) == 0) found = 1; } if (found == 0) { (*re_table)->regex = rp->regex; (*re_table)->srcline = rp->srcline; (*re_table)->scale = rp->scale; (*re_table)->field = rp->field; (*re_table)->typ = rp->typ; (*re_table)++; } } } } void add_list_table( dmpline_t typ, amregex_t **re_table, GSList *message) { GSList *mes; for (mes = message; mes != NULL; mes = mes->next) { (*re_table)->regex = (char *)mes->data; (*re_table)->srcline = 0; (*re_table)->scale = 0; (*re_table)->field = 0; (*re_table)->typ = typ; (*re_table)++; } } amregex_t * build_re_table( amregex_t *orig_re_table, GSList *normal_message, GSList *ignore_message, GSList *strange_message) { int nb = 0; amregex_t *rp; amregex_t *re_table, *new_re_table; for(rp = orig_re_table; rp->regex != NULL; rp++) { nb++; } nb += g_slist_length(normal_message); nb += g_slist_length(ignore_message); nb += g_slist_length(strange_message); nb ++; re_table = new_re_table = malloc(nb * sizeof(amregex_t)); /* add SIZE from orig_re_table */ add_type_table(DMP_SIZE, &re_table, orig_re_table, normal_message, ignore_message, strange_message); /* add ignore_message */ add_list_table(DMP_IGNORE, &re_table, ignore_message); /* add IGNORE from orig_re_table */ add_type_table(DMP_IGNORE, &re_table, orig_re_table, normal_message, ignore_message, strange_message); /* add normal_message */ add_list_table(DMP_NORMAL, &re_table, normal_message); /* add NORMAL from orig_re_table */ add_type_table(DMP_NORMAL, &re_table, orig_re_table, normal_message, ignore_message, strange_message); /* add strange_message */ add_list_table(DMP_STRANGE, &re_table, strange_message); /* add STRANGE from orig_re_table */ add_type_table(DMP_STRANGE, &re_table, orig_re_table, normal_message, ignore_message, strange_message); /* Add DMP_STRANGE with NULL regex, */ /* it is not copied by previous statement */ re_table->regex = NULL; re_table->srcline = 0; re_table->scale = 0; re_table->field = 0; re_table->typ = DMP_STRANGE; return new_re_table; } amanda-3.3.6/client-src/runtar.c0000664000076400007640000001116512357250002020162 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: runtar.c,v 1.24 2006/08/25 11:41:31 martinea Exp $ * * runs GNUTAR program as root * * argv[0] is the runtar program name * argv[1] is the config name or NOCONFIG * argv[2] will be argv[0] of the gtar program * ... */ #include "amanda.h" #include "util.h" #include "conffile.h" int main(int argc, char **argv); int main( int argc, char ** argv) { #ifdef GNUTAR int i; char *e; char *dbf; char *cmdline; #endif if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("runtar-%s\n", VERSION); return (0); } /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); safe_cd(); set_pname("runtar"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); dbopen(DBG_SUBDIR_CLIENT); config_init(CONFIG_INIT_CLIENT, NULL); if (argc < 3) { error(_("Need at least 3 arguments\n")); /*NOTREACHED*/ } dbprintf(_("version %s\n"), VERSION); if (strcmp(argv[3], "--create") != 0) { error(_("Can only be used to create tar archives\n")); /*NOTREACHED*/ } #ifndef GNUTAR g_fprintf(stderr,_("gnutar not available on this system.\n")); dbprintf(_("%s: gnutar not available on this system.\n"), argv[0]); dbclose(); return 1; #else /* * Print out version information for tar. */ do { FILE * version_file; char version_buf[80]; if ((version_file = popen(GNUTAR " --version 2>&1", "r")) != NULL) { if (fgets(version_buf, (int)sizeof(version_buf), version_file) != NULL) { dbprintf(_(GNUTAR " version: %s\n"), version_buf); } else { if (ferror(version_file)) { dbprintf(_(GNUTAR " version: Read failure: %s\n"), strerror(errno)); } else { dbprintf(_(GNUTAR " version: Read failure; EOF\n")); } } } else { dbprintf(_(GNUTAR " version: unavailable: %s\n"), strerror(errno)); } } while(0); #ifdef WANT_SETUID_CLIENT check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY); if (!become_root()) { error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname()); /*NOTREACHED*/ } #else check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif /* skip argv[0] */ argc--; argv++; dbprintf(_("config: %s\n"), argv[0]); if (strcmp(argv[0], "NOCONFIG") != 0) dbrename(argv[0], DBG_SUBDIR_CLIENT); argc--; argv++; cmdline = stralloc(GNUTAR); for (i = 1; argv[i]; i++) { char *quoted; quoted = quote_string(argv[i]); cmdline = vstrextend(&cmdline, " ", quoted, NULL); amfree(quoted); } dbprintf(_("running: %s\n"), cmdline); amfree(cmdline); dbf = dbfn(); if (dbf) { dbf = stralloc(dbf); } dbclose(); execve(GNUTAR, argv, safe_env()); e = strerror(errno); dbreopen(dbf, "more"); amfree(dbf); dbprintf(_("execve of %s failed (%s)\n"), GNUTAR, e); dbclose(); g_fprintf(stderr, _("runtar: could not exec %s: %s\n"), GNUTAR, e); return 1; #endif } amanda-3.3.6/client-src/sendbackup.c0000664000076400007640000010522712357250002020771 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1999 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: sendbackup.c,v 1.88 2006/07/25 18:27:56 martinea Exp $ * * common code for the sendbackup-* programs. */ #include "amanda.h" #include "match.h" #include "sendbackup.h" #include "clock.h" #include "pipespawn.h" #include "amfeatures.h" #include "arglist.h" #include "getfsent.h" #include "conffile.h" #include "amandates.h" #include "stream.h" #define sendbackup_debug(i, ...) do { \ if ((i) <= debug_sendbackup) { \ dbprintf(__VA_LIST__); \ } \ } while (0) #define TIMEOUT 30 pid_t comppid = (pid_t)-1; pid_t dumppid = (pid_t)-1; pid_t tarpid = (pid_t)-1; pid_t encpid = (pid_t)-1; pid_t indexpid = (pid_t)-1; pid_t application_api_pid = (pid_t)-1; char *errorstr = NULL; int datafd; int mesgfd; int indexfd; g_option_t *g_options = NULL; long dump_size = -1; backup_program_t *program = NULL; dle_t *gdle = NULL; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; static char *amandad_auth = NULL; /* local functions */ int main(int argc, char **argv); char *childstr(pid_t pid); int check_status(pid_t pid, amwait_t w, int mesgfd); pid_t pipefork(void (*func)(void), char *fname, int *stdinfd, int stdoutfd, int stderrfd); int check_result(int mesgfd); void parse_backup_messages(dle_t *dle, int mesgin); static void process_dumpline(char *str); static void save_fd(int *, int); void application_api_info_tapeheader(int mesgfd, char *prog, dle_t *dle); int fdprintf(int fd, char *format, ...) G_GNUC_PRINTF(2, 3); int fdprintf( int fd, char *format, ...) { va_list argp; char *s; int r; arglist_start(argp, format); s = g_strdup_vprintf(format, argp); arglist_end(argp); r = full_write(fd, s, strlen(s)); amfree(s); return r; } int main( int argc, char ** argv) { int interactive = 0; int level = 0; int mesgpipe[2]; dle_t *dle = NULL; char *dumpdate, *stroptions; char *qdisk = NULL; char *qamdevice = NULL; char *line = NULL; char *err_extra = NULL; char *s; int i; int ch; GSList *errlist; FILE *mesgstream; am_level_t *alevel; if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("sendbackup-%s\n", VERSION); return (0); } /* initialize */ /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2); openbsd_fd_inform(); safe_cd(); set_pname("sendbackup"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); /* Don't die when interrupt received */ signal(SIGINT, SIG_IGN); if(argc > 1 && strcmp(argv[1],"-t") == 0) { interactive = 1; argc--; argv++; } else { interactive = 0; } add_amanda_log_handler(amanda_log_stderr); add_amanda_log_handler(amanda_log_syslog); dbopen(DBG_SUBDIR_CLIENT); startclock(); dbprintf(_("Version %s\n"), VERSION); if(argc > 2 && strcmp(argv[1], "amandad") == 0) { amandad_auth = stralloc(argv[2]); } our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); config_init(CONFIG_INIT_CLIENT, NULL); /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); if(interactive) { /* * In interactive (debug) mode, the backup data is sent to * /dev/null and none of the network connections back to driver * programs on the tape host are set up. The index service is * run and goes to stdout. */ g_fprintf(stderr, _("%s: running in interactive test mode\n"), get_pname()); fflush(stderr); } qdisk = NULL; dumpdate = NULL; stroptions = NULL; for(; (line = agets(stdin)) != NULL; free(line)) { if (line[0] == '\0') continue; if(interactive) { g_fprintf(stderr, "%s> ", get_pname()); fflush(stderr); } if(strncmp_const(line, "OPTIONS ") == 0) { g_options = parse_g_options(line+8, 1); if(!g_options->hostname) { g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1); gethostname(g_options->hostname, MAX_HOSTNAME_LENGTH); g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0'; } if (g_options->config) { /* overlay this configuration on the existing (nameless) configuration */ config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); dbrename(get_config_name(), DBG_SUBDIR_CLIENT); } /* check for any config errors now */ if (config_errors(&errlist) >= CFGERR_ERRORS) { char *errstr = config_errors_to_error_string(errlist); g_printf("%s\n", errstr); dbclose(); return 1; } if (am_has_feature(g_options->features, fe_req_xml)) { break; } continue; } if (dle && dle->program != NULL) { err_extra = _("multiple requests"); goto err; } dbprintf(_(" sendbackup req: <%s>\n"), line); dle = alloc_dle(); s = line; ch = *s++; skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { err_extra = _("no program name"); goto err; /* no program name */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; if (strcmp(dle->program, "APPLICATION")==0) { dle->program_is_application_api=1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; } dle->program = stralloc(dle->program); skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { err_extra = _("no disk name"); goto err; /* no disk name */ } amfree(qdisk); qdisk = s - 1; ch = *qdisk; skip_quoted_string(s, ch); s[-1] = '\0'; qdisk = stralloc(qdisk); dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { err_extra = _("bad level"); goto err; } if(!isdigit((int)s[-1])) { amfree(qamdevice); qamdevice = s - 1; ch = *qamdevice; skip_quoted_string(s, ch); s[-1] = '\0'; qamdevice = stralloc(qamdevice); dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { dle->device = stralloc(dle->disk); qamdevice = stralloc(qdisk); } /* find the level number */ if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { err_extra = _("bad level"); goto err; /* bad level */ } skip_integer(s, ch); alevel = g_new0(am_level_t, 1); alevel->level = level; dle->levellist = g_slist_append(dle->levellist, alevel); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { err_extra = _("no dumpdate"); goto err; /* no dumpdate */ } amfree(dumpdate); dumpdate = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; dumpdate = stralloc(dumpdate); skip_whitespace(s, ch); /* find the options keyword */ if(ch == '\0') { err_extra = _("no options"); goto err; /* no options */ } if(strncmp_const_skip(s - 1, "OPTIONS ", s, ch) != 0) { err_extra = _("no OPTIONS keyword"); goto err; /* no options */ } skip_whitespace(s, ch); /* find the options string */ if(ch == '\0') { err_extra = _("bad options string"); goto err; /* no options */ } amfree(stroptions); stroptions = stralloc(s - 1); } amfree(line); if (g_options == NULL) { g_printf(_("ERROR [Missing OPTIONS line in sendbackup input]\n")); error(_("Missing OPTIONS line in sendbackup input\n")); /*NOTREACHED*/ } if (am_has_feature(g_options->features, fe_req_xml)) { char *errmsg = NULL; dle = amxml_parse_node_FILE(stdin, &errmsg); if (errmsg) { err_extra = errmsg; goto err; } if (!dle) { err_extra = _("One DLE required"); goto err; } else if (dle->next) { err_extra = _("Only one DLE allowed"); goto err; } qdisk = quote_string(dle->disk); if (dle->device == NULL) dle->device = stralloc(dle->disk); qamdevice = quote_string(dle->device); dumpdate = stralloc("NODATE"); stroptions = stralloc(""); } else { parse_options(stroptions, dle, g_options->features, 0); } gdle = dle; if (dle->program == NULL || dle->disk == NULL || dle->device == NULL || dle->levellist == NULL || dumpdate == NULL) { err_extra = _("no valid sendbackup request"); goto err; } if (g_slist_length(dle->levellist) != 1) { err_extra = _("Too many level"); goto err; } alevel = (am_level_t *)dle->levellist->data; level = alevel->level; dbprintf(_(" Parsed request as: program `%s'\n"), dle->program); dbprintf(_(" disk `%s'\n"), qdisk); dbprintf(_(" device `%s'\n"), qamdevice); dbprintf(_(" level %d\n"), level); dbprintf(_(" since %s\n"), dumpdate); dbprintf(_(" options `%s'\n"), stroptions); dbprintf(_(" datapath `%s'\n"), data_path_to_string(dle->data_path)); if (dle->program_is_application_api==1) { /* check that the application_api exist */ } else { for(i = 0; programs[i]; i++) { if (strcmp(programs[i]->name, dle->program) == 0) { break; } } if (programs[i] == NULL) { dbprintf(_("ERROR [%s: unknown program %s]\n"), get_pname(), dle->program); error(_("ERROR [%s: unknown program %s]"), get_pname(), dle->program); /*NOTREACHED*/ } program = programs[i]; } if(!interactive) { datafd = DATA_FD_OFFSET + 0; mesgfd = DATA_FD_OFFSET + 2; indexfd = DATA_FD_OFFSET + 4; } if (!dle->create_index) indexfd = -1; if (dle->auth && amandad_auth) { if(strcasecmp(dle->auth, amandad_auth) != 0) { g_printf(_("ERROR [client configured for auth=%s while server requested '%s']\n"), amandad_auth, dle->auth); exit(-1); } } if (dle->kencrypt) { g_printf("KENCRYPT\n"); } g_printf(_("CONNECT DATA %d MESG %d INDEX %d\n"), DATA_FD_OFFSET, DATA_FD_OFFSET+1, indexfd == -1 ? -1 : DATA_FD_OFFSET+2); g_printf(_("OPTIONS ")); if(am_has_feature(g_options->features, fe_rep_options_features)) { g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { g_printf("hostname=%s;", g_options->hostname); } if (!am_has_feature(g_options->features, fe_rep_options_features) && !am_has_feature(g_options->features, fe_rep_options_hostname)) { g_printf(";"); } g_printf("\n"); fflush(stdout); if (freopen("/dev/null", "w", stdout) == NULL) { dbprintf(_("Error redirecting stdout to /dev/null: %s\n"), strerror(errno)); exit(1); } if(interactive) { if((datafd = open("/dev/null", O_RDWR)) < 0) { error(_("ERROR [open of /dev/null for debug data stream: %s]\n"), strerror(errno)); /*NOTREACHED*/ } mesgfd = 2; indexfd = 1; } if(!interactive) { if(datafd == -1 || mesgfd == -1 || (dle->create_index && indexfd == -1)) { dbclose(); exit(1); } } if (merge_dles_properties(dle, 1) == 0) { g_debug("merge_dles_properties failed"); exit(1); } mesgstream = fdopen(mesgfd,"w"); run_client_scripts(EXECUTE_ON_PRE_DLE_BACKUP, g_options, dle, mesgstream); fflush(mesgstream); if (dle->program_is_application_api==1) { guint j; char *cmd=NULL; GPtrArray *argv_ptr; char levelstr[20]; backup_support_option_t *bsu; char *compopt = NULL; char *encryptopt = skip_argument; int compout, dumpout; GSList *scriptlist; script_t *script; time_t cur_dumptime; int result; GPtrArray *errarray; int errfd[2]; FILE *dumperr; /* apply client-side encryption here */ if ( dle->encrypt == ENCRYPT_CUST ) { encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, &compout, &datafd, &mesgfd, dle->clnt_encrypt, encryptopt, NULL); dbprintf(_("encrypt: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); } else { compout = datafd; encpid = -1; } /* now do the client-side compression */ if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { compopt = skip_argument; #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) if(dle->compress == COMP_BEST) { compopt = COMPRESS_BEST_OPT; } else { compopt = COMPRESS_FAST_OPT; } #endif comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, &dumpout, &compout, &mesgfd, COMPRESS_PATH, compopt, NULL); if(compopt != skip_argument) { dbprintf(_("compress pid %ld: %s %s\n"), (long)comppid, COMPRESS_PATH, compopt); } else { dbprintf(_("compress pid %ld: %s\n"), (long)comppid, COMPRESS_PATH); } } else if (dle->compress == COMP_CUST) { compopt = skip_argument; comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, &dumpout, &compout, &mesgfd, dle->compprog, compopt, NULL); if(compopt != skip_argument) { dbprintf(_("pid %ld: %s %s\n"), (long)comppid, dle->compprog, compopt); } else { dbprintf(_("pid %ld: %s\n"), (long)comppid, dle->compprog); } } else { dumpout = compout; comppid = -1; } cur_dumptime = time(0); bsu = backup_support_option(dle->program, g_options, dle->disk, dle->device, &errarray); if (!bsu) { char *errmsg; char *qerrmsg; guint i; for (i=0; i < errarray->len; i++) { errmsg = g_ptr_array_index(errarray, i); qerrmsg = quote_string(errmsg); fdprintf(mesgfd, _("sendbackup: error [Application '%s': %s]\n"), dle->program, errmsg); dbprintf("aa: %s\n",qerrmsg); amfree(qerrmsg); } if (i == 0) { /* no errarray */ errmsg = vstrallocf(_("Can't execute application '%s'"), dle->program); qerrmsg = quote_string(errmsg); fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg); dbprintf(_("ERROR %s\n"), qerrmsg); amfree(qerrmsg); amfree(errmsg); } return 0; } if (pipe(errfd) < 0) { char *errmsg; char *qerrmsg; errmsg = vstrallocf(_("Application '%s': can't create pipe"), dle->program); qerrmsg = quote_string(errmsg); fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg); dbprintf(_("ERROR %s\n"), qerrmsg); amfree(qerrmsg); amfree(errmsg); return 0; } switch(application_api_pid=fork()) { case 0: application_api_info_tapeheader(mesgfd, dle->program, dle); /* find directt-tcp address from indirect direct-tcp */ if (dle->data_path == DATA_PATH_DIRECTTCP && bsu->data_path_set & DATA_PATH_DIRECTTCP && strncmp(dle->directtcp_list->data, "255.255.255.255:", 16) == 0) { char *indirect_tcp; char *str_port; in_port_t port; int fd; char buffer[32770]; int size; char *s, *s1; indirect_tcp = g_strdup(dle->directtcp_list->data); g_debug("indirecttcp: %s", indirect_tcp); g_slist_free(dle->directtcp_list); dle->directtcp_list = NULL; str_port = strchr(indirect_tcp, ':'); str_port++; port = atoi(str_port); fd = stream_client("localhost", port, 32768, 32768, NULL, 0); if (fd <= 0) { g_debug("Failed to connect to indirect-direct-tcp port: %s", strerror(errno)); exit(1); } size = full_read(fd, buffer, 32768); if (size <= 0) { g_debug("Failed to read from indirect-direct-tcp port: %s", strerror(errno)); close(fd); exit(1); } close(fd); buffer[size++] = ' '; buffer[size] = '\0'; s1 = buffer; while ((s = strchr(s1, ' ')) != NULL) { *s++ = '\0'; g_debug("directtcp: %s", s1); dle->directtcp_list = g_slist_append(dle->directtcp_list, g_strdup(s1)); s1 = s; } amfree(indirect_tcp); } argv_ptr = g_ptr_array_new(); cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); g_ptr_array_add(argv_ptr, stralloc(dle->program)); g_ptr_array_add(argv_ptr, stralloc("backup")); if (bsu->message_line == 1) { g_ptr_array_add(argv_ptr, stralloc("--message")); g_ptr_array_add(argv_ptr, stralloc("line")); } if (g_options->config && bsu->config == 1) { g_ptr_array_add(argv_ptr, stralloc("--config")); g_ptr_array_add(argv_ptr, stralloc(g_options->config)); } if (g_options->hostname && bsu->host == 1) { g_ptr_array_add(argv_ptr, stralloc("--host")); g_ptr_array_add(argv_ptr, stralloc(g_options->hostname)); } if (dle->disk && bsu->disk == 1) { g_ptr_array_add(argv_ptr, stralloc("--disk")); g_ptr_array_add(argv_ptr, stralloc(dle->disk)); } g_ptr_array_add(argv_ptr, stralloc("--device")); g_ptr_array_add(argv_ptr, stralloc(dle->device)); if (level <= bsu->max_level) { g_ptr_array_add(argv_ptr, stralloc("--level")); g_snprintf(levelstr,19,"%d",level); g_ptr_array_add(argv_ptr, stralloc(levelstr)); } if (indexfd != -1 && bsu->index_line == 1) { g_ptr_array_add(argv_ptr, stralloc("--index")); g_ptr_array_add(argv_ptr, stralloc("line")); } if (dle->record && bsu->record == 1) { g_ptr_array_add(argv_ptr, stralloc("--record")); } application_property_add_to_argv(argv_ptr, dle, bsu, g_options->features); for (scriptlist = dle->scriptlist; scriptlist != NULL; scriptlist = scriptlist->next) { script = (script_t *)scriptlist->data; if (script->result && script->result->proplist) { property_add_to_argv(argv_ptr, script->result->proplist); } } g_ptr_array_add(argv_ptr, NULL); dbprintf(_("%s: running \"%s\n"), get_pname(), cmd); for (j = 1; j < argv_ptr->len - 1; j++) dbprintf(" %s\n", (char *)g_ptr_array_index(argv_ptr,j)); dbprintf(_("\"\n")); if(dup2(dumpout, 1) == -1) { error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if (dup2(errfd[1], 2) == -1) { error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if(dup2(mesgfd, 3) == -1) { error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if(indexfd > 0) { if(dup2(indexfd, 4) == -1) { error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } fcntl(indexfd, F_SETFD, 0); } if (indexfd != 0) { safe_fd(3, 2); } else { safe_fd(3, 1); } execve(cmd, (char **)argv_ptr->pdata, safe_env()); exit(1); break; default: break; case -1: error(_("%s: fork returned: %s"), get_pname(), strerror(errno)); } close(errfd[1]); dumperr = fdopen(errfd[0],"r"); if (!dumperr) { error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } result = 0; while ((line = agets(dumperr)) != NULL) { if (strlen(line) > 0) { fdprintf(mesgfd, "sendbackup: error [%s]\n", line); dbprintf("error: %s\n", line); result = 1; } amfree(line); } result |= check_result(mesgfd); if (result == 0) { char *amandates_file; amandates_file = getconf_str(CNF_AMANDATES); if(start_amandates(amandates_file, 1)) { amandates_updateone(dle->disk, level, cur_dumptime); finish_amandates(); free_amandates(); } else { if (GPOINTER_TO_INT(dle->estimatelist->data) == ES_CALCSIZE && bsu->calcsize) { error(_("error [opening %s for writing: %s]"), amandates_file, strerror(errno)); } else { g_debug(_("non-fatal error opening '%s' for writing: %s]"), amandates_file, strerror(errno)); } } } amfree(bsu); } else { if(!interactive) { /* redirect stderr */ if(dup2(mesgfd, 2) == -1) { dbprintf(_("Error redirecting stderr to fd %d: %s\n"), mesgfd, strerror(errno)); dbclose(); exit(1); } } if(pipe(mesgpipe) == -1) { s = strerror(errno); dbprintf(_("error [opening mesg pipe: %s]\n"), s); error(_("error [opening mesg pipe: %s]"), s); } program->start_backup(dle, g_options->hostname, datafd, mesgpipe[1], indexfd); dbprintf(_("Started backup\n")); parse_backup_messages(dle, mesgpipe[0]); dbprintf(_("Parsed backup messages\n")); } run_client_scripts(EXECUTE_ON_POST_DLE_BACKUP, g_options, dle, mesgstream); fflush(mesgstream); amfree(qdisk); amfree(qamdevice); amfree(dumpdate); amfree(stroptions); amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; free_g_options(g_options); dbclose(); return 0; err: if (err_extra) { g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET '%s'\n"), err_extra); dbprintf(_("REQ packet is bogus: %s\n"), err_extra); } else { g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET\n")); dbprintf(_("REQ packet is bogus\n")); } amfree(qdisk); amfree(qamdevice); amfree(dumpdate); amfree(stroptions); amfree(our_feature_string); dbclose(); return 1; } /* * Returns a string for a child process. Checks the saved dump and * compress pids to see which it is. */ char * childstr( pid_t pid) { if(pid == dumppid) return program->backup_name; if(pid == comppid) return "compress"; if(pid == encpid) return "encrypt"; if(pid == indexpid) return "index"; if(pid == application_api_pid) { if (!gdle) { dbprintf("gdle == NULL\n"); return "gdle == NULL"; } return gdle->program; } return "unknown"; } /* * Determine if the child return status really indicates an error. * If so, add the error message to the error string; more than one * child can have an error. */ int check_status( pid_t pid, amwait_t w, int mesgfd) { char *thiserr = NULL; char *str, *strX; int ret, sig, rc; str = childstr(pid); if(WIFSIGNALED(w)) { ret = 0; rc = sig = WTERMSIG(w); } else { sig = 0; rc = ret = WEXITSTATUS(w); } if(pid == indexpid) { /* * Treat an index failure (other than signal) as a "STRANGE" * rather than an error so the dump goes ahead and gets processed * but the failure is noted. */ if(ret != 0) { fdprintf(mesgfd, _("? index %s returned %d\n"), str, ret); rc = 0; } indexpid = -1; strX = "index"; } else if(pid == comppid) { /* * compress returns 2 sometimes, but it is ok. */ #ifndef HAVE_GZIP if(ret == 2) { rc = 0; } #endif comppid = -1; strX = "compress"; } else if(pid == dumppid && tarpid == -1) { /* * Ultrix dump returns 1 sometimes, but it is ok. */ #ifdef DUMP_RETURNS_1 if(ret == 1) { rc = 0; } #endif dumppid = -1; strX = "dump"; } else if(pid == tarpid) { if (ret == 1) { rc = 0; } /* * tar bitches about active filesystems, but we do not care. */ #ifdef IGNORE_TAR_ERRORS if(ret == 2) { rc = 0; } #endif dumppid = tarpid = -1; strX = "dump"; } else if(pid == application_api_pid) { strX = "Application"; } else { strX = "unknown"; } if(rc == 0) { return 0; /* normal exit */ } if(ret == 0) { thiserr = vstrallocf(_("%s (%d) %s got signal %d"), strX, (int)pid, str, sig); } else { thiserr = vstrallocf(_("%s (%d) %s returned %d"), strX, (int)pid, str, ret); } fdprintf(mesgfd, "? %s\n", thiserr); if(errorstr) { errorstr = newvstrallocf(errorstr, "%s, %s", errorstr, thiserr); amfree(thiserr); } else { errorstr = thiserr; thiserr = NULL; } return 1; } /* *Send header info to the message file. */ void info_tapeheader( dle_t *dle) { g_fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name); g_fprintf(stderr, "%s: info RECOVER_CMD=", get_pname()); if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) g_fprintf(stderr, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT #else "" #endif ); g_fprintf(stderr, "%s -xpGf - ...\n", program->restore_name); if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) g_fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); g_fprintf(stderr, "%s: info end\n", get_pname()); } void application_api_info_tapeheader( int mesgfd, char *prog, dle_t *dle) { char line[1024]; g_snprintf(line, 1024, "%s: info BACKUP=APPLICATION\n", get_pname()); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } g_snprintf(line, 1024, "%s: info APPLICATION=%s\n", get_pname(), prog); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } g_snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname()); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) { g_snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT #else "" #endif ); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } g_snprintf(line, 1024, "%s/%s restore [./file-to-restore]+\n", APPLICATION_DIR, prog); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } if (dle->compress) { g_snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } g_snprintf(line, 1024, "%s: info end\n", get_pname()); if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } pid_t pipefork( void (*func)(void), char * fname, int * stdinfd, int stdoutfd, int stderrfd) { int inpipe[2]; pid_t pid; dbprintf(_("Forking function %s in pipeline\n"), fname); if(pipe(inpipe) == -1) { error(_("error [open pipe to %s: %s]"), fname, strerror(errno)); /*NOTREACHED*/ } switch(pid = fork()) { case -1: error(_("error [fork %s: %s]"), fname, strerror(errno)); /*NOTREACHED*/ default: /* parent process */ aclose(inpipe[0]); /* close input side of pipe */ *stdinfd = inpipe[1]; break; case 0: /* child process */ aclose(inpipe[1]); /* close output side of pipe */ if(dup2(inpipe[0], 0) == -1) { error(_("error [fork %s: dup2(%d, in): %s]"), fname, inpipe[0], strerror(errno)); /*NOTRACHED*/ } if(dup2(stdoutfd, 1) == -1) { error(_("error [fork %s: dup2(%d, out): %s]"), fname, stdoutfd, strerror(errno)); /*NOTRACHED*/ } if(dup2(stderrfd, 2) == -1) { error(_("error [fork %s: dup2(%d, err): %s]"), fname, stderrfd, strerror(errno)); /*NOTRACHED*/ } func(); exit(0); /*NOTREACHED*/ } return pid; } int check_result( int mesgfd) { int goterror; pid_t wpid; amwait_t retstat; goterror = 0; while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { if(check_status(wpid, retstat, mesgfd)) goterror = 1; } if (dumppid != -1) { sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } if (dumppid != -1) { dbprintf(_("Sending SIGHUP to dump process %d\n"), (int)dumppid); if(dumppid != -1) { if(kill(dumppid, SIGHUP) == -1) { dbprintf(_("Can't send SIGHUP to %d: %s\n"), (int)dumppid, strerror(errno)); } } sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } if (dumppid != -1) { dbprintf(_("Sending SIGKILL to dump process %d\n"), (int)dumppid); if(dumppid != -1) { if(kill(dumppid, SIGKILL) == -1) { dbprintf(_("Can't send SIGKILL to %d: %s\n"), (int)dumppid, strerror(errno)); } } sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } return goterror; } void parse_backup_messages( dle_t *dle, int mesgin) { int goterror; char *line; amfree(errorstr); for(; (line = areads(mesgin)) != NULL; free(line)) { process_dumpline(line); } if(errno) { error(_("error [read mesg pipe: %s]"), strerror(errno)); /*NOTREACHED*/ } goterror = check_result(mesgfd); if(errorstr) { error(_("error [%s]"), errorstr); /*NOTREACHED*/ } else if(dump_size == -1) { error(_("error [no backup size line]")); /*NOTREACHED*/ } program->end_backup(dle, goterror); fdprintf(mesgfd, _("%s: size %ld\n"), get_pname(), dump_size); fdprintf(mesgfd, _("%s: end\n"), get_pname()); } static void process_dumpline( char * str) { amregex_t *rp; char *type; char startchr; for(rp = program->re_table; rp->regex != NULL; rp++) { if(match(rp->regex, str)) { break; } } if(rp->typ == DMP_SIZE) { dump_size = (long)((the_num(str, rp->field)* rp->scale+1023.0)/1024.0); } switch(rp->typ) { case DMP_NORMAL: type = "normal"; startchr = '|'; break; case DMP_STRANGE: type = "strange"; startchr = '?'; break; case DMP_SIZE: type = "size"; startchr = '|'; break; case DMP_ERROR: type = "error"; startchr = '?'; break; default: /* * Should never get here. */ type = "unknown"; startchr = '!'; break; } dbprintf("%3d: %7s(%c): %s\n", rp->srcline, type, startchr, str); fdprintf(mesgfd, "%c %s\n", startchr, str); } /* * start_index. Creates an index file from the output of dump/tar. * It arranges that input is the fd to be written by the dump process. * If createindex is not enabled, it does nothing. If it is not, a * new process will be created that tees input both to a pipe whose * read fd is dup2'ed input and to a program that outputs an index * file to `index'. * * make sure that the chat from restore doesn't go to stderr cause * this goes back to amanda which doesn't expect to see it * (2>/dev/null should do it) * * Originally by Alan M. McIvor, 13 April 1996 * * Adapted by Alexandre Oliva, 1 May 1997 * * This program owes a lot to tee.c from GNU sh-utils and dumptee.c * from the DeeJay backup package. */ static void save_fd( int * fd, int min) { int origfd = *fd; while (*fd >= 0 && *fd < min) { int newfd = dup(*fd); if (newfd == -1) dbprintf(_("Unable to save file descriptor [%s]\n"), strerror(errno)); *fd = newfd; } if (origfd != *fd) dbprintf(_("Dupped file descriptor %i to %i\n"), origfd, *fd); } void start_index( int createindex, int input, int mesg, int index, char * cmd) { int pipefd[2]; FILE *pipe_fp; int exitcode; if (!createindex) return; if (pipe(pipefd) != 0) { error(_("creating index pipe: %s"), strerror(errno)); /*NOTREACHED*/ } switch(indexpid = fork()) { case -1: error(_("forking index tee process: %s"), strerror(errno)); /*NOTREACHED*/ default: aclose(pipefd[0]); if (dup2(pipefd[1], input) == -1) { error(_("dup'ping index tee output: %s"), strerror(errno)); /*NOTREACHED*/ } aclose(pipefd[1]); return; case 0: break; } /* now in a child process */ save_fd(&pipefd[0], 4); save_fd(&index, 4); save_fd(&mesg, 4); save_fd(&input, 4); dup2(pipefd[0], 0); dup2(index, 1); dup2(mesg, 2); dup2(input, 3); for(index = 4; index < (int)FD_SETSIZE; index++) { if (index != dbfd()) { close(index); } } if ((pipe_fp = popen(cmd, "w")) == NULL) { error(_("couldn't start index creator [%s]"), strerror(errno)); /*NOTREACHED*/ } dbprintf(_("Started index creator: \"%s\"\n"), cmd); while(1) { char buffer[BUFSIZ], *ptr; ssize_t bytes_read; size_t bytes_written; size_t just_written; do { bytes_read = read(0, buffer, SIZEOF(buffer)); } while ((bytes_read < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (bytes_read < 0) { error(_("index tee cannot read [%s]"), strerror(errno)); /*NOTREACHED*/ } if (bytes_read == 0) break; /* finished */ /* write the stuff to the subprocess */ ptr = buffer; bytes_written = 0; just_written = full_write(fileno(pipe_fp), ptr, (size_t)bytes_read); if (just_written < (size_t)bytes_read) { /* * just as we waited for write() to complete. */ if (errno != EPIPE) { dbprintf(_("Index tee cannot write to index creator [%s]\n"), strerror(errno)); } } else { bytes_written += just_written; ptr += just_written; } /* write the stuff to stdout, ensuring none lost when interrupt occurs */ ptr = buffer; bytes_written = 0; just_written = full_write(3, ptr, bytes_read); if (just_written < (size_t)bytes_read) { error(_("index tee cannot write [%s]"), strerror(errno)); /*NOTREACHED*/ } else { bytes_written += just_written; ptr += just_written; } } aclose(pipefd[1]); /* finished */ /* check the exit code of the pipe and moan if not 0 */ if ((exitcode = pclose(pipe_fp)) != 0) { char *exitstr = str_exit_status("Index pipe", exitcode); dbprintf("%s\n", exitstr); amfree(exitstr); } else { dbprintf(_("Index created successfully\n")); } pipe_fp = NULL; exit(exitcode); } extern backup_program_t dump_program, gnutar_program; backup_program_t *programs[] = { &dump_program, &gnutar_program, NULL }; amanda-3.3.6/client-src/unctime.c0000664000076400007640000000570212357250002020313 0ustar00martineamartinea00000000000000/*- * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: unctime.c,v 1.3 2006/05/25 01:47:11 johnfranks Exp $ */ #include "amanda.h" /* * Convert a ctime(3) format string into a system format date. * Return the date thus calculated. * * Return -1 if the string is not in ctime format. */ /* * Offsets into the ctime string to various parts. */ #define E_MONTH 4 #define E_DAY 8 #define E_HOUR 11 #define E_MINUTE 14 #define E_SECOND 17 #define E_YEAR 20 static int lookup(char *); time_t unctime( char *str) { struct tm then; char dbuf[26]; (void) strncpy(dbuf, str, SIZEOF(dbuf) - 1); dbuf[SIZEOF(dbuf) - 1] = '\0'; dbuf[E_MONTH+3] = '\0'; if ((then.tm_mon = lookup(&dbuf[E_MONTH])) < 0) return -1; then.tm_mday = atoi(&dbuf[E_DAY]); then.tm_hour = atoi(&dbuf[E_HOUR]); then.tm_min = atoi(&dbuf[E_MINUTE]); then.tm_sec = atoi(&dbuf[E_SECOND]); then.tm_year = atoi(&dbuf[E_YEAR]) - 1900; then.tm_isdst = -1; return mktime(&then); } static int lookup( char * str) { register char *cp, *cp2; char *months = _("JanFebMarAprMayJunJulAugSepOctNovDec"); for (cp = months, cp2 = str; *cp != '\0'; cp += 3) if (strncmp(cp, cp2, 3) == 0) return ((int)(cp-months) / 3); return -1; } amanda-3.3.6/client-src/getfsent.h0000664000076400007640000000453112357250002020472 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: getfsent.h,v 1.8 2006/05/25 01:47:11 johnfranks Exp $ * * interfaces for obtaining filesystem information */ #ifndef GETFSENT_H #define GETFSENT_H #ifndef STANDALONE_TEST #include "amanda.h" #endif #define FSTAB_RW "rw" /* writable filesystem */ #define FSTAB_RQ "rq" /* writable, with quotas */ #define FSTAB_RO "ro" /* read-only filesystem */ #define FSTAB_SW "sw" /* swap device */ #define FSTAB_XX "xx" /* ignore this entry */ typedef struct generic_fsent_s { char *fsname; char *fstype; char *mntdir; char *mntopts; int freq; int passno; } generic_fsent_t; int open_fstab(void); void close_fstab(void); int get_fstab_nextentry(generic_fsent_t *fsent); int search_fstab(char *name, generic_fsent_t *fsent, int check_dev); int is_local_fstype(generic_fsent_t *fsent); char *amname_to_devname(char *str); char *amname_to_dirname(char *str); char *amname_to_fstype(char *str); #endif /* ! GETFSENT_H */ amanda-3.3.6/configure.in0000664000076400007640000002311412357250010016745 0ustar00martineamartinea00000000000000AMANDA_INIT_VERSION AC_INIT([amanda], [AMANDA_F_VERSION]) AC_CONFIG_SRCDIR([common-src/amanda.h]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) AC_CANONICAL_HOST PACKAGE=amanda AC_SUBST(PACKAGE) AMANDA_VERSION AM_INIT_AUTOMAKE(tar-ustar 1.10) AC_CONFIG_HEADERS([config/config.h]) dnl Minimum Autoconf version required. AC_PREREQ(2.64) # # Take care of some early Amanda-specific setup # AMANDA_CONFIGURE_ARGS AMANDA_INIT_SUMMARY AMANDA_SNAPSHOT_STAMP AMANDA_SPLIT_VERSION AMANDA_CONFIG_LOCAL # # Set up compiler location, basic flags, and include locations # and library locations before we start checking the system # configuration in more detail... # AC_PROG_CC gl_EARLY gl_INIT AC_OBJEXT AC_EXEEXT AMANDA_INIT_FLAGS AMANDA_ADD_CPPFLAGS([-D_GNU_SOURCE]) AMANDA_AS_NEEDED dnl ------------------------------------------------------------------------- # # Configuration flags (--with-xxx and --enable-xxx) # AMANDA_WITH_USER AMANDA_WITH_GROUP AMANDA_WITH_APPLICATIONDIR AMANDA_WITH_CONFIGDIR AMANDA_WITH_INDEXDIR AMANDA_WITH_DBDIR AMANDA_WITH_LOGDIR AMANDA_WITH_SUFFIXES AMANDA_WITH_GNUTAR_LISTDIR AMANDA_WITH_TMPDIR AMANDA_WITH_FORCE_UID AMANDA_WITH_OWNER AMANDA_WITH_FQDN AMANDA_WITH_REUSEPORTS AMANDA_WITH_PORTRANGES AMANDA_WITH_BUFFERED_DUMP AMANDA_WITH_MAXTAPEBLOCKSIZE AMANDA_WITH_ASSERTIONS AMANDA_WITH_DEBUGGING AMANDA_WITH_DEBUG_DAYS AMANDA_WITH_TESTING AMANDA_WITH_SINGLE_USERID AMANDA_DISABLE_INSTALLPERMS AMANDA_DISABLE_SYNTAX_CHECKS dnl ------------------------------------------------------------------------- # # Set up for Amanda components and modules # AMANDA_CHECK_COMPONENTS AMANDA_SETUP_AMPLOT AMANDA_SETUP_DOCUMENTATION AMANDA_SETUP_DEFAULTS AMANDA_SETUP_LFS AMANDA_SETUP_GETFSENT AMANDA_SETUP_FILE_LOCKING AMANDA_SETUP_SWIG AMANDA_CHECK_COMPRESSION AMANDA_CHECK_IPV6 AMANDA_CHECK_READDIR AMANDA_CHECK_DEVICE_PREFIXES AMANDA_SYSHACKS AMANDA_EXPAND_DIRS # # Internationalization # AMANDA_SETUP_I18N dnl These lines *must* be in configure.in, and not indented AM_GNU_GETTEXT_VERSION([0.15]) AM_GNU_GETTEXT([external]) # # Security (authentication) mechansims # AMANDA_BSD_SECURITY AMANDA_BSDTCP_SECURITY AMANDA_BSDUDP_SECURITY AMANDA_RSH_SECURITY AMANDA_SSH_SECURITY AMANDA_KRB5_SECURITY # # Dumpers # AMANDA_PROG_XFSDUMP_XFSRESTORE AMANDA_PROG_VXDUMP_VXRESTORE AMANDA_PROG_VDUMP_VRESTORE AMANDA_PROG_DUMP_RESTORE AMANDA_PROG_GNUTAR AMANDA_PROG_STAR AMANDA_PROG_BSDTAR AMANDA_PROG_SUNTAR AMANDA_PROG_SAMBA_CLIENT AMANDA_CHECK_USE_RUNDUMP # # Look for other programs Amanda will use # AMANDA_PROG_GREP AC_PROG_EGREP AMANDA_PROG_LINT AMANDA_PROG_LEX AMANDA_PROG_AR AMANDA_PROG_GETTEXT AC_PROG_AWK AC_PROG_YACC AC_PROG_MKDIR_P AMANDA_PROG_DD AMANDA_PROG_BASH AMANDA_PROG_SORT AMANDA_PROG_MAILER AMANDA_PROG_MT AMANDA_PROG_MTX AMANDA_PROG_MOUNT AMANDA_PROG_UMOUNT AMANDA_PROG_UNAME AMANDA_PROG_LPR AMANDA_PROG_PCAT AMANDA_PROG_PERL AMANDA_PROG_SWIG AMANDA_PS_ARGUMENT AMANDA_PROG_RPCGEN AMANDA_PROG_NC dnl ------------------------------------------------------------------------- # # Compiler / system characteristics # # # compiler # AC_PROG_GCC_TRADITIONAL AC_C_CONST AC_C_BIGENDIAN # GCC_COMPILER is needed in the gnulib Makefile to silence errors AM_CONDITIONAL([GCC_COMPILER], [test "x$GCC" = "xyes"]) # # Warnings # AMANDA_ENABLE_GCC_WARNING([parentheses]) AMANDA_ENABLE_GCC_WARNING([declaration-after-statement]) AMANDA_ENABLE_GCC_WARNING([missing-prototypes]) AMANDA_ENABLE_GCC_WARNING([strict-prototypes]) AMANDA_ENABLE_GCC_WARNING([missing-declarations]) AMANDA_ENABLE_GCC_WARNING([format]) AMANDA_ENABLE_GCC_WARNING([format-security]) AMANDA_ENABLE_GCC_WARNING([sign-compare]) AMANDA_ENABLE_GCC_WARNING([float-equal]) AMANDA_ENABLE_GCC_WARNING([old-style-definition]) AMANDA_DISABLE_GCC_WARNING([strict-aliasing]) AMANDA_DISABLE_GCC_WARNING([unknown-pragmas]) AMANDA_WERROR_FLAGS AMANDA_SWIG_ERROR # # Libtool # AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) AMANDA_STATIC_FLAGS # # headers # AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS( grp.h \ libc.h \ libgen.h \ limits.h \ math.h \ netinet/in.h \ regex.h \ stdarg.h \ stdlib.h \ strings.h \ rpc/rpc.h \ sys/file.h \ sys/ioctl.h \ sys/ipc.h \ sys/mntent.h \ sys/param.h \ sys/select.h \ sys/stat.h \ sys/shm.h \ sys/time.h \ sys/types.h \ sys/uio.h \ syslog.h \ time.h \ unistd.h \ ) AC_DEFINE([HAVE_AMANDA_H], 1, [Define to 1 if you have the "amanda.h" header file.]) AC_DEFINE([HAVE_UTIL_H], 1, [Define to 1 if you have the "util.h" header file.]) AC_DEFINE([USE_GETTEXT], 1, [Define to 1 if files will be processed with gettextize]) # # Types # AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(intmax_t) AC_CHECK_SIZEOF(off_t) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(ssize_t) AC_CHECK_SIZEOF(time_t) AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_TYPE_SIGNAL AC_STRUCT_TM AMANDA_SOCKLEN_T_EQUIV AMANDA_CHECK_TYPE(sa_family_t, unsigned short, sys/socket.h) AMANDA_CHECK_TYPE(in_port_t, unsigned short, netinet/in.h) CF_WAIT CF_WAIT_INT # # Libraries # # cur_colr is on some HP's AC_CHECK_LIB(cur_colr,main) AC_CHECK_LIB(intl,main) AMANDA_CHECK_NET_LIBS AMANDA_CHECK_GLIB AMANDA_CHECK_READLINE AC_CHECK_LIB(m,modf) AMANDA_GLIBC_BACKTRACE # # Declarations # # Checks for library functions and if the function is declared in # an appropriate header file. Functions which exist, but for which # no declaration is available, are declared in common-src/amanda.h. # It's not clear that any existing system implements but does not # declare common functions such as these. # ICE_CHECK_DECL(accept,sys/types.h sys/socket.h) AC_FUNC_ALLOCA AC_CHECK_FUNCS(atexit) ICE_CHECK_DECL(atof,stdlib.h) ICE_CHECK_DECL(atol,stdlib.h) ICE_CHECK_DECL(atoll,stdlib.h) ICE_CHECK_DECL(strtol,stdlib.h) ICE_CHECK_DECL(strtoll,stdlib.h) AC_CHECK_FUNCS(basename) ICE_CHECK_DECL(bind,sys/types.h sys/socket.h) ICE_CHECK_DECL(bcopy,string.h strings.h stdlib.h) ICE_CHECK_DECL(bzero,string.h strings.h stdlib.h) AC_FUNC_CLOSEDIR_VOID ICE_CHECK_DECL(closelog,syslog.h) ICE_CHECK_DECL(connect,sys/types.h sys/socket.h) ICE_CHECK_DECL(fclose,stdio.h) ICE_CHECK_DECL(fflush,stdio.h) ICE_CHECK_DECL(fprintf,stdio.h) ICE_CHECK_DECL(fputc,stdio.h) ICE_CHECK_DECL(fputs,stdio.h) ICE_CHECK_DECL(fread,stdio.h stdlib.h) ICE_CHECK_DECL(fseek,stdio.h) ICE_CHECK_DECL(fwrite,stdio.h stdlib.h) AC_CHECK_FUNCS(getgrgid_r) AC_CHECK_FUNCS(getpwuid_r) ICE_CHECK_DECL(gethostname,unistd.h) ICE_CHECK_DECL(getopt,stdlib.h unistd.h libc.h) ICE_CHECK_DECL(getpeername,sys/types.h sys/socket.h) AC_CHECK_FUNC(getpgrp) AC_FUNC_GETPGRP ICE_CHECK_DECL(getsockname,sys/types.h sys/socket.h) ICE_CHECK_DECL(getsockopt,sys/types.h sys/socket.h) ICE_CHECK_DECL(initgroups,grp.h sys/types.h unistd.h libc.h) ICE_CHECK_DECL(ioctl,sys/ioctl.h unistd.h libc.h) ICE_CHECK_DECL(isnormal,math.h) ICE_CHECK_DECL(listen,sys/types.h sys/socket.h) ICE_CHECK_DECL(lstat,sys/types.h sys/stat.h) ICE_CHECK_DECL(malloc,stdlib.h) ICE_CHECK_DECL(memmove,string.h strings.h) ICE_CHECK_DECL(memset,string.h strings.h) ICE_CHECK_DECL(mkstemp,stdlib.h) ICE_CHECK_DECL(mktemp,stdlib.h) ICE_CHECK_DECL(mktime,time.h sys/time.h) AC_CHECK_FUNCS(on_exit) ICE_CHECK_DECL(openlog,syslog.h) ICE_CHECK_DECL(pclose,stdio.h) ICE_CHECK_DECL(perror,stdio.h) ICE_CHECK_DECL(printf,stdio.h) AC_CHECK_FUNCS(putenv) ICE_CHECK_DECL(puts,stdio.h) ICE_CHECK_DECL(realloc,stdlib.h) ICE_CHECK_DECL(recvfrom,sys/types.h sys/socket.h) ICE_CHECK_DECL(remove,stdio.h) ICE_CHECK_DECL(rename,stdio.h) ICE_CHECK_DECL(rewind,stdio.h) ICE_CHECK_DECL(ruserok,netdb.h sys/socket.h libc.h unistd.h) ICE_CHECK_DECL(select,sys/types.h sys/socket.h sys/select.h time.h sys/time.h) AMANDA_FUNC_SELECT_ARG_TYPE ICE_CHECK_DECL(sendto,sys/types.h sys/socket.h) ICE_CHECK_DECL(setegid,unistd.h) ICE_CHECK_DECL(seteuid,unistd.h) ICE_CHECK_DECL(setresgid,unistd.h) ICE_CHECK_DECL(setresuid,unistd.h) ICE_CHECK_DECL(snprintf,stdio.h) ICE_CHECK_DECL(vsnprintf,stdio.h) AMANDA_FUNC_SETPGID AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP]) ICE_CHECK_DECL(setpgrp,sys/types.h unistd.h libc.h) ICE_CHECK_DECL(setsockopt,sys/types.h sys/socket.h) AC_CHECK_FUNCS(sigaction sigemptyset sigvec) ICE_CHECK_DECL(socket,sys/types.h sys/socket.h) ICE_CHECK_DECL(socketpair,sys/types.h sys/socket.h) ICE_CHECK_DECL(sscanf,stdio.h) ICE_CHECK_DECL(strerror,string.h strings.h) AC_FUNC_STRFTIME ICE_CHECK_DECL(strftime,time.h sys/time.h) ICE_CHECK_DECL(strncasecmp,string.h strings.h) ICE_CHECK_DECL(syslog,syslog.h) ICE_CHECK_DECL(system,stdlib.h) ICE_CHECK_DECL(time,time.h sys/time.h) ICE_CHECK_DECL(tolower,ctype.h) ICE_CHECK_DECL(toupper,ctype.h) ICE_CHECK_DECL(ungetc,stdio.h) AC_CHECK_FUNCS(unsetenv) ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h) ICE_CHECK_DECL(vprintf,stdio.h stdlib.h) AC_CHECK_FUNC(wait4) ICE_CHECK_DECL(writev, unistd.h sys/uio.h) ICE_CHECK_DECL(strcasecmp,string.h strings.h) ICE_CHECK_DECL(euidaccess,unistd.h) ICE_CHECK_DECL(eaccess,unistd.h) # # Devices # AMANDA_S3_DEVICE AMANDA_TAPE_DEVICE AMANDA_DVDRW_DEVICE AMANDA_NDMP_DEVICE dnl ------------------------------------------------------------------------- dnl dnl Set up files for autoconf substitution. All files are listed here, in dnl order by subdirectory, as a central location for this list. dnl AC_CONFIG_FILES([ Makefile amandad-src/Makefile amar-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile config/Makefile device-src/Makefile application-src/Makefile example/Makefile gnulib/Makefile installcheck/Makefile man/Makefile ndmp-src/Makefile oldrecover-src/Makefile packaging/Makefile perl/amglue/Makefile perl/Makefile po/Makefile recover-src/Makefile server-src/Makefile xfer-src/Makefile ]) AC_OUTPUT AMANDA_SHOW_SUMMARY amanda-3.3.6/AUTHORS0000664000076400007640000000701512357250010015506 0ustar00martineamartinea00000000000000This file lists all known contributors of significant changes to Amanda. Many of the contributors listed here are no longer active. Please do not contact anyone on this list directly with questions about Amanda; instead, post to the Amanda Users mailing list: amanda-users@amanda.org James da Silva Hacker Emeritus Contributions made under the UMD license Mike Grupenhoff Ex-UMIACS hacker Contributions made under the UMD license Todd Kover Mailing eist maintainer Ex-UMIACS hacker, developer and supporter Contributions made under the UMD license James Mathiesen Numerous bug fixes Contributions made under the UMD license Alan McIvor Developer of amindex and various bug fixes Contributions made under the UMD license George Scott Developer during 2.4.0 release cycle Contributions made under the UMD license Alexandre Oliva Long-time developer Contributions made under the UMD license Blair Zajac De-facto maintainer between release 2.3.0 and the creation of the Amanda Development Team, at some point after release 2.3.0.4. Contributions made under the UMD license Curtis Varner Feature development and bug fixes Contributions made under the UMD license John R. Jackson Security fixes, feature development Contributions made under the UMD license Jean-Louis Martineau New features, bug fixes, and current maintainer Application API Contributions made under GPLv2 Thomas Hepper : Original Changer API Contributions made under the UMD license Jon LaBadie Active supporter Contributions made under the UMD license Stefan G. Weichinger Documentation author and compiler Contributions made under the UMD license John Franks Contributions made under GPLv2 Paddy Sreenivasan Contributions made under GPLv2 Kevin Till Contributions made under GPLv2 Ian Turner Device API Contributions made under GPLv2 Dustin J. Mitchell Device API, Changer API, Xfer Architecture, and Perl rewrite Contributions before Oct 18, 2010 made under GPLv2 Contributions after Oct 18, 2010 made under the UMD license Nikolas Coukouma S3 Device Contributions made under GPLv2 John Hein Contributions made under the UMD license Nick Smith Patches to ZFS applications and scripts Contributions made under the UMD license Satya Ganga Contributions made under GPLv2 Alan Hodgson Contributions made under the UMD license Ben Slusky amcrypt-ossl.sh and amcrypt-ossl-asym.sh Contributions made under the UMD license Sam Couter DVD-RW device Contributions made under the UMD license Orion Poplawski amoverview, perl report fixes Contributions made under GPLv2 Stephen Gelman Nexenta support and patches Contributions made under GPLv2 Nikhil Bhupale Contributions made under GPLv2 Francis Galiegue Contributions made under GPLv2 amanda-3.3.6/VERSION0000664000076400007640000000000612357250010015477 0ustar00martineamartinea000000000000003.3.6 amanda-3.3.6/config/0000775000076400007640000000000012357750426015720 5ustar00martineamartinea00000000000000amanda-3.3.6/config/Makefile.in0000664000076400007640000015273312357750242017774 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/amanda/file-list $(srcdir)/automake/file-list \ $(srcdir)/config.h.in $(srcdir)/gettext-macros/file-list \ $(srcdir)/gnulib/file-list $(srcdir)/macro-archive/file-list \ compile config.guess config.rpath config.sub depcomp \ install-sh ltmain.sh missing mkinstalldirs ylwrap subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ missing mkinstalldirs set_full_version amanda/amplot.m4 \ amanda/as_needed.m4 amanda/bsd-security.m4 \ amanda/bsdtcp-security.m4 amanda/bsdudp-security.m4 \ amanda/components.m4 amanda/compress.m4 amanda/config.m4 \ amanda/debugging.m4 amanda/defaults.m4 amanda/devprefix.m4 \ amanda/dirs.m4 amanda/documentation.m4 amanda/dumpers.m4 \ amanda/dvdrw-device.m4 amanda/flags.m4 amanda/flock.m4 \ amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \ amanda/ipv6.m4 amanda/krb5-security.m4 amanda/lfs.m4 \ amanda/libs.m4 amanda/ndmp-device.m4 amanda/net.m4 \ amanda/progs.m4 amanda/ps.m4 amanda/readdir.m4 \ amanda/readline.m4 amanda/rsh-security.m4 amanda/s3-device.m4 \ amanda/socklen_t_equiv.m4 amanda/ssh-security.m4 \ amanda/summary.m4 amanda/swig.m4 amanda/syshacks.m4 \ amanda/tape.m4 amanda/types.m4 amanda/userid.m4 \ amanda/version.m4 gettext-macros/codeset.m4 \ gettext-macros/gettext.m4 gettext-macros/glibc21.m4 \ gettext-macros/glibc2.m4 gettext-macros/iconv.m4 \ gettext-macros/intdiv0.m4 gettext-macros/intmax.m4 \ gettext-macros/inttypes_h.m4 gettext-macros/inttypes.m4 \ gettext-macros/inttypes-pri.m4 gettext-macros/isc-posix.m4 \ gettext-macros/lcmessage.m4 gettext-macros/lib-ld.m4 \ gettext-macros/lib-link.m4 gettext-macros/lib-prefix.m4 \ gettext-macros/longdouble.m4 gettext-macros/longlong.m4 \ gettext-macros/nls.m4 gettext-macros/po.m4 \ gettext-macros/printf-posix.m4 gettext-macros/progtest.m4 \ gettext-macros/signed.m4 gettext-macros/size_max.m4 \ gettext-macros/stdint_h.m4 gettext-macros/uintmax_t.m4 \ gettext-macros/ulonglong.m4 gettext-macros/wchar_t.m4 \ gettext-macros/wint_t.m4 gettext-macros/xsize.m4 \ gnulib/00gnulib.m4 gnulib/alloca.m4 gnulib/arpa_inet_h.m4 \ gnulib/base64.m4 gnulib/btowc.m4 gnulib/codeset.m4 \ gnulib/configmake.m4 gnulib/eealloc.m4 gnulib/environ.m4 \ gnulib/errno_h.m4 gnulib/euidaccess.m4 gnulib/exponentd.m4 \ gnulib/extensions.m4 gnulib/extern-inline.m4 gnulib/fcntl_h.m4 \ gnulib/fcntl-o.m4 gnulib/float_h.m4 gnulib/fseek.m4 \ gnulib/fseeko.m4 gnulib/fstat.m4 gnulib/fsusage.m4 \ gnulib/ftell.m4 gnulib/ftello.m4 gnulib/ftruncate.m4 \ gnulib/getaddrinfo.m4 gnulib/getgroups.m4 gnulib/getopt.m4 \ gnulib/gettimeofday.m4 gnulib/glibc21.m4 \ gnulib/gnulib-cache.m4 gnulib/gnulib-common.m4 \ gnulib/gnulib-comp.m4 gnulib/gnulib-tool.m4 \ gnulib/group-member.m4 gnulib/hostent.m4 \ gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/inet_pton.m4 \ gnulib/intmax_t.m4 gnulib/inttypes_h.m4 gnulib/langinfo_h.m4 \ gnulib/largefile.m4 gnulib/lib-ld.m4 gnulib/lib-link.m4 \ gnulib/lib-prefix.m4 gnulib/localcharset.m4 \ gnulib/localeconv.m4 gnulib/locale-fr.m4 gnulib/locale_h.m4 \ gnulib/locale-ja.m4 gnulib/locale-zh.m4 gnulib/lock.m4 \ gnulib/longlong.m4 gnulib/lseek.m4 gnulib/lstat.m4 \ gnulib/malloc.m4 gnulib/math_h.m4 gnulib/mbrtowc.m4 \ gnulib/mbsinit.m4 gnulib/mbstate_t.m4 gnulib/mbtowc.m4 \ gnulib/memchr.m4 gnulib/mkdtemp.m4 gnulib/mmap-anon.m4 \ gnulib/msvc-inval.m4 gnulib/msvc-nothrow.m4 \ gnulib/multiarch.m4 gnulib/netdb_h.m4 gnulib/netinet_in_h.m4 \ gnulib/nl_langinfo.m4 gnulib/nocrash.m4 gnulib/off_t.m4 \ gnulib/pathmax.m4 gnulib/physmem.m4 gnulib/printf.m4 \ gnulib/raise.m4 gnulib/read.m4 gnulib/regex.m4 \ gnulib/safe-read.m4 gnulib/safe-write.m4 \ gnulib/secure_getenv.m4 gnulib/servent.m4 gnulib/signal_h.m4 \ gnulib/size_max.m4 gnulib/snprintf.m4 gnulib/socketlib.m4 \ gnulib/sockets.m4 gnulib/socklen.m4 gnulib/sockpfaf.m4 \ gnulib/ssize_t.m4 gnulib/stat.m4 gnulib/stdalign.m4 \ gnulib/stdbool.m4 gnulib/stddef_h.m4 gnulib/stdint_h.m4 \ gnulib/stdint.m4 gnulib/stdio_h.m4 gnulib/stdlib_h.m4 \ gnulib/string_h.m4 gnulib/sys_socket_h.m4 gnulib/sys_stat_h.m4 \ gnulib/sys_time_h.m4 gnulib/sys_types_h.m4 gnulib/sys_uio_h.m4 \ gnulib/tempname.m4 gnulib/threadlib.m4 gnulib/time_h.m4 \ gnulib/unistd_h.m4 gnulib/vasnprintf.m4 gnulib/warn-on-use.m4 \ gnulib/wchar_h.m4 gnulib/wchar_t.m4 gnulib/wcrtomb.m4 \ gnulib/wctype_h.m4 gnulib/wint_t.m4 gnulib/write.m4 \ gnulib/xsize.m4 macro-archive/ac_define_dir.m4 \ macro-archive/ac_perl_module_version.m4 \ macro-archive/ac_prog_perl_version.m4 \ macro-archive/ac_prog_swig.m4 \ macro-archive/ax_compare_version.m4 \ macro-archive/docbook-dtd.m4 macro-archive/docbook-xslt.m4 \ macro-archive/docbook-xslt-min.m4 macro-archive/xsltproc.m4 \ automake/installperms.am automake/precompile.am \ automake/scripts.am automake/vars.am all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/amanda/file-list $(srcdir)/gettext-macros/file-list $(srcdir)/gnulib/file-list $(srcdir)/macro-archive/file-list $(srcdir)/automake/file-list $(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) --gnu config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/amanda/file-list $(srcdir)/gettext-macros/file-list $(srcdir)/gnulib/file-list $(srcdir)/macro-archive/file-list $(srcdir)/automake/file-list: $(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): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile config.h 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: 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-hdr 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: all install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-hdr 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 \ uninstall uninstall-am # add files from subdirectories, using file lists generated by autogen # 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: amanda-3.3.6/config/mkinstalldirs0000775000076400007640000000664712357250007020531 0ustar00martineamartinea00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/compile0000664000076400007640000000706212357250007017266 0ustar00martineamartinea00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2004-09-10.20 # Copyright (C) 1999, 2000, 2003, 2004 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . 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 0 ;; -v | --v*) echo "compile $scriptversion" exit 0 ;; esac ofile= cfile= eat= 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 -e 's|^.*/||' -e '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 mv "$cofile" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/depcomp0000775000076400007640000004271312357250007017272 0ustar00martineamartinea00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # 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 outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac 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" # 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 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## 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). ## - 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. tr ' ' ' ' < "$tmpdepfile" | ## 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. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then : else 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 ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # 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.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #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 $1 != '--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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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 $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac 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. -*|$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" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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 $1 != '--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, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/snippet/0000775000076400007640000000000012357750426017402 5ustar00martineamartinea00000000000000amanda-3.3.6/config/snippet/c++defs.h0000664000076400007640000002675312357250007020770 0ustar00martineamartinea00000000000000/* C++ compatible function declaration macros. Copyright (C) 2010-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _GL_CXXDEFS_H #define _GL_CXXDEFS_H /* The three most frequent use cases of these macros are: * For providing a substitute for a function that is missing on some platforms, but is declared and works fine on the platforms on which it exists: #if @GNULIB_FOO@ # if !@HAVE_FOO@ _GL_FUNCDECL_SYS (foo, ...); # endif _GL_CXXALIAS_SYS (foo, ...); _GL_CXXALIASWARN (foo); #elif defined GNULIB_POSIXCHECK ... #endif * For providing a replacement for a function that exists on all platforms, but is broken/insufficient and needs to be replaced on some platforms: #if @GNULIB_FOO@ # if @REPLACE_FOO@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef foo # define foo rpl_foo # endif _GL_FUNCDECL_RPL (foo, ...); _GL_CXXALIAS_RPL (foo, ...); # else _GL_CXXALIAS_SYS (foo, ...); # endif _GL_CXXALIASWARN (foo); #elif defined GNULIB_POSIXCHECK ... #endif * For providing a replacement for a function that exists on some platforms but is broken/insufficient and needs to be replaced on some of them and is additionally either missing or undeclared on some other platforms: #if @GNULIB_FOO@ # if @REPLACE_FOO@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef foo # define foo rpl_foo # endif _GL_FUNCDECL_RPL (foo, ...); _GL_CXXALIAS_RPL (foo, ...); # else # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ _GL_FUNCDECL_SYS (foo, ...); # endif _GL_CXXALIAS_SYS (foo, ...); # endif _GL_CXXALIASWARN (foo); #elif defined GNULIB_POSIXCHECK ... #endif */ /* _GL_EXTERN_C declaration; performs the declaration with C linkage. */ #if defined __cplusplus # define _GL_EXTERN_C extern "C" #else # define _GL_EXTERN_C extern #endif /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); declares a replacement function, named rpl_func, with the given prototype, consisting of return type, parameters, and attributes. Example: _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1))); */ #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ _GL_EXTERN_C rettype rpl_func parameters_and_attributes /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); declares the system function, named func, with the given prototype, consisting of return type, parameters, and attributes. Example: _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1))); */ #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ _GL_EXTERN_C rettype func parameters_and_attributes /* _GL_CXXALIAS_RPL (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that redirects to rpl_func, if GNULIB_NAMESPACE is defined. Example: _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); */ #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ rettype (*const func) parameters = ::rpl_func; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); except that the C function rpl_func may have a slightly different declaration. A cast is used to silence the "invalid conversion" error that would otherwise occur. */ #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ rettype (*const func) parameters = \ reinterpret_cast(::rpl_func); \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIAS_SYS (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that redirects to the system provided function func, if GNULIB_NAMESPACE is defined. Example: _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); */ #if defined __cplusplus && defined GNULIB_NAMESPACE /* If we were to write rettype (*const func) parameters = ::func; like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls better (remove an indirection through a 'static' pointer variable), but then the _GL_CXXALIASWARN macro below would cause a warning not only for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ static rettype (*func) parameters = ::func; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); is like _GL_CXXALIAS_SYS (func, rettype, parameters); except that the C function func may have a slightly different declaration. A cast is used to silence the "invalid conversion" error that would otherwise occur. */ #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ static rettype (*func) parameters = \ reinterpret_cast(::func); \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); is like _GL_CXXALIAS_SYS (func, rettype, parameters); except that the C function is picked among a set of overloaded functions, namely the one with rettype2 and parameters2. Two consecutive casts are used to silence the "cannot find a match" and "invalid conversion" errors that would otherwise occur. */ #if defined __cplusplus && defined GNULIB_NAMESPACE /* The outer cast must be a reinterpret_cast. The inner cast: When the function is defined as a set of overloaded functions, it works as a static_cast<>, choosing the designated variant. When the function is defined as a single variant, it works as a reinterpret_cast<>. The parenthesized cast syntax works both ways. */ # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ namespace GNULIB_NAMESPACE \ { \ static rettype (*func) parameters = \ reinterpret_cast( \ (rettype2(*)parameters2)(::func)); \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIASWARN (func); causes a warning to be emitted when ::func is used but not when GNULIB_NAMESPACE::func is used. func must be defined without overloaded variants. */ #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIASWARN(func) \ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) # define _GL_CXXALIASWARN_1(func,namespace) \ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ # if !__OPTIMIZE__ # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ "Use " #namespace "::" #func " instead.") # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING # define _GL_CXXALIASWARN_2(func,namespace) \ extern __typeof__ (func) func # else # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_EXTERN_C int _gl_cxxalias_dummy # endif #else # define _GL_CXXALIASWARN(func) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); causes a warning to be emitted when the given overloaded variant of ::func is used but not when GNULIB_NAMESPACE::func is used. */ #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ GNULIB_NAMESPACE) # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ # if !__OPTIMIZE__ # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ "Use " #namespace "::" #func " instead.") # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ extern __typeof__ (func) func # else # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ _GL_EXTERN_C int _gl_cxxalias_dummy # endif #else # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ _GL_EXTERN_C int _gl_cxxalias_dummy #endif #endif /* _GL_CXXDEFS_H */ amanda-3.3.6/config/snippet/_Noreturn.h0000664000076400007640000000046212357250007021516 0ustar00martineamartinea00000000000000#if !defined _Noreturn && __STDC_VERSION__ < 201112 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif amanda-3.3.6/config/snippet/arg-nonnull.h0000664000076400007640000000230012357250007021770 0ustar00martineamartinea00000000000000/* A C macro for declaring that specific arguments must not be NULL. Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools that the values passed as arguments n, ..., m must be non-NULL pointers. n = 1 stands for the first argument, n = 2 for the second argument etc. */ #ifndef _GL_ARG_NONNULL # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) # else # define _GL_ARG_NONNULL(params) # endif #endif amanda-3.3.6/config/snippet/warn-on-use.h0000664000076400007640000001200712357250007021714 0ustar00martineamartinea00000000000000/* A C macro for emitting warnings if a function is used. Copyright (C) 2010-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* _GL_WARN_ON_USE (function, "literal string") issues a declaration for FUNCTION which will then trigger a compiler warning containing the text of "literal string" anywhere that function is called, if supported by the compiler. If the compiler does not support this feature, the macro expands to an unused extern declaration. This macro is useful for marking a function as a potential portability trap, with the intent that "literal string" include instructions on the replacement function that should be used instead. However, one of the reasons that a function is a portability trap is if it has the wrong signature. Declaring FUNCTION with a different signature in C is a compilation error, so this macro must use the same type as any existing declaration so that programs that avoid the problematic FUNCTION do not fail to compile merely because they included a header that poisoned the function. But this implies that _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already have a declaration. Use of this macro implies that there must not be any other macro hiding the declaration of FUNCTION; but undefining FUNCTION first is part of the poisoning process anyway (although for symbols that are provided only via a macro, the result is a compilation error rather than a warning containing "literal string"). Also note that in C++, it is only safe to use if FUNCTION has no overloads. For an example, it is possible to poison 'getline' by: - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], [getline]) in configure.ac, which potentially defines HAVE_RAW_DECL_GETLINE - adding this code to a header that wraps the system : #undef getline #if HAVE_RAW_DECL_GETLINE _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" "not universally present; use the gnulib module getline"); #endif It is not possible to directly poison global variables. But it is possible to write a wrapper accessor function, and poison that (less common usage, like &environ, will cause a compilation error rather than issue the nice warning, but the end result of informing the developer about their portability problem is still achieved): #if HAVE_RAW_DECL_ENVIRON static char ***rpl_environ (void) { return &environ; } _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); # undef environ # define environ (*rpl_environ ()) #endif */ #ifndef _GL_WARN_ON_USE # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) /* A compiler attribute is available in gcc versions 4.3.0 and later. */ # define _GL_WARN_ON_USE(function, message) \ extern __typeof__ (function) function __attribute__ ((__warning__ (message))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE(function, message) \ extern __typeof__ (function) function # else /* Unsupported. */ # define _GL_WARN_ON_USE(function, message) \ _GL_WARN_EXTERN_C int _gl_warn_on_use # endif #endif /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") is like _GL_WARN_ON_USE (function, "string"), except that the function is declared with the given prototype, consisting of return type, parameters, and attributes. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does not work in this case. */ #ifndef _GL_WARN_ON_USE_CXX # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ extern rettype function parameters_and_attributes \ __attribute__ ((__warning__ (msg))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ extern rettype function parameters_and_attributes # else /* Unsupported. */ # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ _GL_WARN_EXTERN_C int _gl_warn_on_use # endif #endif /* _GL_WARN_EXTERN_C declaration; performs the declaration with C linkage. */ #ifndef _GL_WARN_EXTERN_C # if defined __cplusplus # define _GL_WARN_EXTERN_C extern "C" # else # define _GL_WARN_EXTERN_C extern # endif #endif amanda-3.3.6/config/gettext-macros/0000775000076400007640000000000012357750426020666 5ustar00martineamartinea00000000000000amanda-3.3.6/config/gettext-macros/lib-prefix.m40000664000076400007640000001503612357250007023164 0ustar00martineamartinea00000000000000# lib-prefix.m4 serial 5 (gettext-0.15) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) amanda-3.3.6/config/gettext-macros/po.m40000664000076400007640000004336712357250007021551 0ustar00martineamartinea00000000000000# po.m4 serial 13 (gettext-0.15) dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) amanda-3.3.6/config/gettext-macros/intmax.m40000664000076400007640000000174612357250007022426 0ustar00martineamartinea00000000000000# intmax.m4 serial 2 (gettext-0.14.2) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) amanda-3.3.6/config/gettext-macros/iconv.m40000664000076400007640000000642612357250007022244 0ustar00martineamartinea00000000000000# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) amanda-3.3.6/config/gettext-macros/lib-link.m40000664000076400007640000006304612357250007022630 0ustar00martineamartinea00000000000000# lib-link.m4 serial 8 (gettext-0.15) dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.50) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) amanda-3.3.6/config/gettext-macros/progtest.m40000664000076400007640000000555012357250007022772 0ustar00martineamartinea00000000000000# progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) amanda-3.3.6/config/gettext-macros/inttypes.m40000664000076400007640000000147212357250007023001 0ustar00martineamartinea00000000000000# inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) amanda-3.3.6/config/gettext-macros/uintmax_t.m40000664000076400007640000000207612357250007023133 0ustar00martineamartinea00000000000000# uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) amanda-3.3.6/config/gettext-macros/glibc2.m40000664000076400007640000000135412357250007022263 0ustar00martineamartinea00000000000000# glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) amanda-3.3.6/config/gettext-macros/gettext.m40000664000076400007640000006070312357250007022610 0ustar00martineamartinea00000000000000# gettext.m4 serial 53 (gettext-0.15) dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2005. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ]], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ]], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ]], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([gl_VISIBILITY])dnl AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_LANGINFO_CODESET gt_LC_MESSAGES dnl Compilation on mingw and Cygwin needs special Makefile rules, because dnl 1. when we install a shared library, we must arrange to export dnl auxiliary pointer variables for every exported variable, dnl 2. when we install a shared library and a static library simultaneously, dnl the include file specifies __declspec(dllimport) and therefore we dnl must arrange to define the auxiliary pointer variables for the dnl exported variables _also_ in the static library. if test "$enable_shared" = yes; then case "$host_os" in cygwin*) is_woe32dll=yes ;; *) is_woe32dll=no ;; esac else is_woe32dll=no fi WOE32DLL=$is_woe32dll AC_SUBST([WOE32DLL]) dnl Rename some macros and functions used for locking. AH_BOTTOM([ #define __libc_lock_t gl_lock_t #define __libc_lock_define gl_lock_define #define __libc_lock_define_initialized gl_lock_define_initialized #define __libc_lock_init gl_lock_init #define __libc_lock_lock gl_lock_lock #define __libc_lock_unlock gl_lock_unlock #define __libc_lock_recursive_t gl_recursive_lock_t #define __libc_lock_define_recursive gl_recursive_lock_define #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized #define __libc_lock_init_recursive gl_recursive_lock_init #define __libc_lock_lock_recursive gl_recursive_lock_lock #define __libc_lock_unlock_recursive gl_recursive_lock_unlock #define glthread_in_use libintl_thread_in_use #define glthread_lock_init libintl_lock_init #define glthread_lock_lock libintl_lock_lock #define glthread_lock_unlock libintl_lock_unlock #define glthread_lock_destroy libintl_lock_destroy #define glthread_rwlock_init libintl_rwlock_init #define glthread_rwlock_rdlock libintl_rwlock_rdlock #define glthread_rwlock_wrlock libintl_rwlock_wrlock #define glthread_rwlock_unlock libintl_rwlock_unlock #define glthread_rwlock_destroy libintl_rwlock_destroy #define glthread_recursive_lock_init libintl_recursive_lock_init #define glthread_recursive_lock_lock libintl_recursive_lock_lock #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy #define glthread_once libintl_once #define glthread_once_call libintl_once_call #define glthread_once_singlethreaded libintl_once_singlethreaded ]) ]) dnl Checks for the core files of the intl subdirectory: dnl dcigettext.c dnl eval-plural.h dnl explodename.c dnl finddomain.c dnl gettextP.h dnl gmo.h dnl hash-string.h hash-string.c dnl l10nflist.c dnl libgnuintl.h.in (except the *printf stuff) dnl loadinfo.h dnl loadmsgcat.c dnl localealias.c dnl log.c dnl plural-exp.h plural-exp.c dnl plural.y dnl Used by libglocale. AC_DEFUN([gt_INTL_SUBDIR_CORE], [ AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_LOCK])dnl AC_TRY_LINK( [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], [], [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1, [Define to 1 if the compiler understands __builtin_expect.])]) AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h]) AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ argz_next __fsetlocking]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) AM_ICONV dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined, dnl and a _NL_LOCALE_NAME macro always. AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name, [AC_TRY_LINK([#include #include ], [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));], gt_cv_nl_locale_name=yes, gt_cv_nl_locale_name=no) ]) if test $gt_cv_nl_locale_name = yes; then AC_DEFINE(HAVE_NL_LOCALE_NAME, 1, [Define if you have and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.]) fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) amanda-3.3.6/config/gettext-macros/wint_t.m40000664000076400007640000000130412357250007022420 0ustar00martineamartinea00000000000000# wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) amanda-3.3.6/config/gettext-macros/ulonglong.m40000664000076400007640000000161512357250007023125 0ustar00martineamartinea00000000000000# ulonglong.m4 serial 4 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) amanda-3.3.6/config/gettext-macros/stdint_h.m40000664000076400007640000000157312357250007022740 0ustar00martineamartinea00000000000000# stdint_h.m4 serial 5 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) amanda-3.3.6/config/gettext-macros/nls.m40000664000076400007640000000226612357250007021720 0ustar00martineamartinea00000000000000# nls.m4 serial 3 (gettext-0.15) dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) amanda-3.3.6/config/gettext-macros/longdouble.m40000664000076400007640000000227712357250007023260 0ustar00martineamartinea00000000000000# longdouble.m4 serial 2 (gettext-0.15) dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) amanda-3.3.6/config/gettext-macros/signed.m40000664000076400007640000000115412357250007022370 0ustar00martineamartinea00000000000000# signed.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) fi ]) amanda-3.3.6/config/gettext-macros/wchar_t.m40000664000076400007640000000132612357250007022547 0ustar00martineamartinea00000000000000# wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) amanda-3.3.6/config/gettext-macros/size_max.m40000664000076400007640000000433012357250007022735 0ustar00martineamartinea00000000000000# size_max.m4 serial 4 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) result= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], result=yes) if test -z "$result"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1, [#include #include ], size_t_bits_minus_1=) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... result='((size_t)~(size_t)0)' fi fi AC_MSG_RESULT([$result]) if test "$result" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) amanda-3.3.6/config/gettext-macros/file-list0000664000076400007640000000231212357750226022475 0ustar00martineamartinea00000000000000## this file is automatically generated by autogen EXTRA_DIST += gettext-macros/codeset.m4 EXTRA_DIST += gettext-macros/gettext.m4 EXTRA_DIST += gettext-macros/glibc21.m4 EXTRA_DIST += gettext-macros/glibc2.m4 EXTRA_DIST += gettext-macros/iconv.m4 EXTRA_DIST += gettext-macros/intdiv0.m4 EXTRA_DIST += gettext-macros/intmax.m4 EXTRA_DIST += gettext-macros/inttypes_h.m4 EXTRA_DIST += gettext-macros/inttypes.m4 EXTRA_DIST += gettext-macros/inttypes-pri.m4 EXTRA_DIST += gettext-macros/isc-posix.m4 EXTRA_DIST += gettext-macros/lcmessage.m4 EXTRA_DIST += gettext-macros/lib-ld.m4 EXTRA_DIST += gettext-macros/lib-link.m4 EXTRA_DIST += gettext-macros/lib-prefix.m4 EXTRA_DIST += gettext-macros/longdouble.m4 EXTRA_DIST += gettext-macros/longlong.m4 EXTRA_DIST += gettext-macros/nls.m4 EXTRA_DIST += gettext-macros/po.m4 EXTRA_DIST += gettext-macros/printf-posix.m4 EXTRA_DIST += gettext-macros/progtest.m4 EXTRA_DIST += gettext-macros/signed.m4 EXTRA_DIST += gettext-macros/size_max.m4 EXTRA_DIST += gettext-macros/stdint_h.m4 EXTRA_DIST += gettext-macros/uintmax_t.m4 EXTRA_DIST += gettext-macros/ulonglong.m4 EXTRA_DIST += gettext-macros/wchar_t.m4 EXTRA_DIST += gettext-macros/wint_t.m4 EXTRA_DIST += gettext-macros/xsize.m4 amanda-3.3.6/config/gettext-macros/lcmessage.m40000664000076400007640000000240412357250007023061 0ustar00martineamartinea00000000000000# lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) amanda-3.3.6/config/gettext-macros/lib-ld.m40000664000076400007640000000653112357250007022266 0ustar00martineamartinea00000000000000# lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) 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. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) amanda-3.3.6/config/gettext-macros/xsize.m40000664000076400007640000000064512357250007022265 0ustar00martineamartinea00000000000000# xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) amanda-3.3.6/config/gettext-macros/inttypes_h.m40000664000076400007640000000162312357250007023306 0ustar00martineamartinea00000000000000# inttypes_h.m4 serial 6 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) amanda-3.3.6/config/gettext-macros/inttypes-pri.m40000664000076400007640000000201112357250007023557 0ustar00martineamartinea00000000000000# inttypes-pri.m4 serial 2 (gettext-0.15) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) if test $gl_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) amanda-3.3.6/config/gettext-macros/isc-posix.m40000664000076400007640000000170612357250007023040 0ustar00martineamartinea00000000000000# isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) amanda-3.3.6/config/gettext-macros/glibc21.m40000664000076400007640000000144512357250007022345 0ustar00martineamartinea00000000000000# glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) amanda-3.3.6/config/gettext-macros/longlong.m40000664000076400007640000000141612357250007022737 0ustar00martineamartinea00000000000000# longlong.m4 serial 5 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG if 'long long' works. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, [AC_TRY_LINK([long long ll = 1LL; int i = 63;], [long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll;], ac_cv_type_long_long=yes, ac_cv_type_long_long=no)]) if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) amanda-3.3.6/config/gettext-macros/intdiv0.m40000664000076400007640000000334012357250007022473 0ustar00martineamartinea00000000000000# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) amanda-3.3.6/config/gettext-macros/printf-posix.m40000664000076400007640000000266112357250007023565 0ustar00martineamartinea00000000000000# printf-posix.m4 serial 2 (gettext-0.13.1) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the printf() function supports POSIX/XSI format strings with dnl positions. AC_DEFUN([gt_PRINTF_POSIX], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], gt_cv_func_printf_posix, [ AC_TRY_RUN([ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) amanda-3.3.6/config/Makefile.am0000664000076400007640000000071412357250007017744 0ustar00martineamartinea00000000000000## Process this file with automake to produce Makefile.in EXTRA_DIST = config.guess \ config.sub \ install-sh \ libtool.m4 \ ltmain.sh \ missing \ mkinstalldirs \ set_full_version # add files from subdirectories, using file lists generated by autogen include $(srcdir)/amanda/file-list include $(srcdir)/gettext-macros/file-list include $(srcdir)/gnulib/file-list include $(srcdir)/macro-archive/file-list include $(srcdir)/automake/file-list amanda-3.3.6/config/config.rpath0000775000076400007640000004443512357250007020230 0ustar00martineamartinea00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2013 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # 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. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : 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 ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) 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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) 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 ;; hpux10*) if test "$with_gnu_ld" = no; then 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 fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # 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*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: amanda-3.3.6/config/config.h.in0000664000076400007640000024372412357750236017756 0ustar00martineamartinea00000000000000/* config/config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Is DUMP the AIX program 'backup'? */ #undef AIX_BACKUP /* Location of Amanda directories and files. */ #undef AMANDA_DBGDIR /* Number of days to keep debugging files. */ #undef AMANDA_DEBUG_DAYS /* The name for the Amanda service. */ #undef AMANDA_SERVICE_NAME /* The directory in which Amanda should create temporary files. */ #undef AMANDA_TMPDIR /* Directory in which dumper interfaces should be installed and searched. */ #undef APPLICATION_DIR /* Define if you want assertion checking. */ #undef ASSERTIONS /* Define as the user who owns installed binaries. */ #undef BINARY_OWNER /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T /* Define to the number of bits in type 'sig_atomic_t'. */ #undef BITSIZEOF_SIG_ATOMIC_T /* Define to the number of bits in type 'size_t'. */ #undef BITSIZEOF_SIZE_T /* Define to the number of bits in type 'wchar_t'. */ #undef BITSIZEOF_WCHAR_T /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T /* Location of the 'bsdtar' binary */ #undef BSDTAR /* Define if BSDTCP transport should be enabled. */ #undef BSDTCP_SECURITY /* Define if BSDUDP transport should be enabled. */ #undef BSDUDP_SECURITY /* Define to use BSD .rhosts/.amandahosts security. */ #undef BSD_SECURITY /* Define to force to another user on client machines. */ #undef CHECK_USERID /* Define as a the user to force to on client machines. */ #undef CLIENT_LOGIN /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* Define as the command line option for best compression. */ #undef COMPRESS_BEST_OPT /* Define as the command line option for fast compression. */ #undef COMPRESS_FAST_OPT /* Define to the exact path to the gzip or the compress program. */ #undef COMPRESS_PATH /* Define to the suffix for the COMPRESS_PATH compression program. */ #undef COMPRESS_SUFFIX /* Define as the configure command line option. */ #undef CONFIGURE_ARGS /* The directory in which configuration directories should be created. */ #undef CONFIG_DIR /* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* Define as the bit index in the word where to find bit 0 of the exponent of 'double'. */ #undef DBL_EXPBIT0_BIT /* Define as the word index where to find the exponent of 'double'. */ #undef DBL_EXPBIT0_WORD /* Default location for 'amandates' */ #undef DEFAULT_AMANDATES_FILE /* This is the default Amanda configuration. */ #undef DEFAULT_CONFIG /* Define if a FSF is needed on filemark. */ #undef DEFAULT_FSF_AFTER_FILEMARK /* A program that understands -s "subject" user < message_file */ #undef DEFAULT_MAILER /* This is the default Amanda index server. */ #undef DEFAULT_SERVER /* This is the default no-rewinding tape device. */ #undef DEFAULT_TAPE_DEVICE /* Define if open of tape device require O_NONBLOCK */ #undef DEFAULT_TAPE_NON_BLOCKING_OPEN /* This is the default restoring Amanda tape server. */ #undef DEFAULT_TAPE_SERVER /* Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ */ #undef DEV_PREFIX /* Define the location of the ufsdump, backup, or dump program. */ #undef DUMP /* Define if dumper should buffer the sockets for faster throughput. */ #undef DUMPER_SOCKET_BUFFERING /* Define this if this system's dump exits with 1 as a success code. */ #undef DUMP_RETURNS_1 /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if the system's ftello function has the Solaris bug. */ #undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */ #undef FUNC_NL_LANGINFO_YESEXPR_WORKS /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T /* Define this to 1 if getgroups(0,NULL) does not return the number of groups. */ #undef GETGROUPS_ZERO_BUG /* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID /* Define if gettimeofday clobbers the localtime buffer. */ #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME /* Define this to 'void' or 'struct timezone' to match the system's declaration of the second argument to gettimeofday. */ #undef GETTIMEOFDAY_TIMEZONE /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module malloc-gnu shall be considered present. */ #undef GNULIB_MALLOC_GNU /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module scanf shall be considered present. */ #undef GNULIB_SCANF /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module snprintf shall be considered present. */ #undef GNULIB_SNPRINTF /* Define to 1 when the gnulib module btowc should be tested. */ #undef GNULIB_TEST_BTOWC /* Define to 1 when the gnulib module environ should be tested. */ #undef GNULIB_TEST_ENVIRON /* Define to 1 when the gnulib module euidaccess should be tested. */ #undef GNULIB_TEST_EUIDACCESS /* Define to 1 when the gnulib module fseek should be tested. */ #undef GNULIB_TEST_FSEEK /* Define to 1 when the gnulib module fseeko should be tested. */ #undef GNULIB_TEST_FSEEKO /* Define to 1 when the gnulib module fstat should be tested. */ #undef GNULIB_TEST_FSTAT /* Define to 1 when the gnulib module ftell should be tested. */ #undef GNULIB_TEST_FTELL /* Define to 1 when the gnulib module ftello should be tested. */ #undef GNULIB_TEST_FTELLO /* Define to 1 when the gnulib module ftruncate should be tested. */ #undef GNULIB_TEST_FTRUNCATE /* Define to 1 when the gnulib module getaddrinfo should be tested. */ #undef GNULIB_TEST_GETADDRINFO /* Define to 1 when the gnulib module getgroups should be tested. */ #undef GNULIB_TEST_GETGROUPS /* Define to 1 when the gnulib module getopt-gnu should be tested. */ #undef GNULIB_TEST_GETOPT_GNU /* Define to 1 when the gnulib module gettimeofday should be tested. */ #undef GNULIB_TEST_GETTIMEOFDAY /* Define to 1 when the gnulib module group-member should be tested. */ #undef GNULIB_TEST_GROUP_MEMBER /* Define to 1 when the gnulib module localeconv should be tested. */ #undef GNULIB_TEST_LOCALECONV /* Define to 1 when the gnulib module lseek should be tested. */ #undef GNULIB_TEST_LSEEK /* Define to 1 when the gnulib module lstat should be tested. */ #undef GNULIB_TEST_LSTAT /* Define to 1 when the gnulib module malloc-posix should be tested. */ #undef GNULIB_TEST_MALLOC_POSIX /* Define to 1 when the gnulib module mbrtowc should be tested. */ #undef GNULIB_TEST_MBRTOWC /* Define to 1 when the gnulib module mbsinit should be tested. */ #undef GNULIB_TEST_MBSINIT /* Define to 1 when the gnulib module mbtowc should be tested. */ #undef GNULIB_TEST_MBTOWC /* Define to 1 when the gnulib module memchr should be tested. */ #undef GNULIB_TEST_MEMCHR /* Define to 1 when the gnulib module mkdtemp should be tested. */ #undef GNULIB_TEST_MKDTEMP /* Define to 1 when the gnulib module nl_langinfo should be tested. */ #undef GNULIB_TEST_NL_LANGINFO /* Define to 1 when the gnulib module raise should be tested. */ #undef GNULIB_TEST_RAISE /* Define to 1 when the gnulib module read should be tested. */ #undef GNULIB_TEST_READ /* Define to 1 when the gnulib module secure_getenv should be tested. */ #undef GNULIB_TEST_SECURE_GETENV /* Define to 1 when the gnulib module snprintf should be tested. */ #undef GNULIB_TEST_SNPRINTF /* Define to 1 when the gnulib module stat should be tested. */ #undef GNULIB_TEST_STAT /* Define to 1 when the gnulib module wcrtomb should be tested. */ #undef GNULIB_TEST_WCRTOMB /* Define to 1 when the gnulib module write should be tested. */ #undef GNULIB_TEST_WRITE /* Location of the GNU 'tar' binary */ #undef GNUTAR /* The directory in which GNU tar should store directory lists for incrementals. */ #undef GNUTAR_LISTED_INCREMENTAL_DIR /* Define the location of the grep program. */ #undef GREP /* Define to 1 if you have the `accept' function. */ #undef HAVE_ACCEPT /* Define if accept is declared. */ #undef HAVE_ACCEPT_DECL /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the "amanda.h" header file. */ #undef HAVE_AMANDA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the `atof' function. */ #undef HAVE_ATOF /* Define if atof is declared. */ #undef HAVE_ATOF_DECL /* Define to 1 if you have the `atol' function. */ #undef HAVE_ATOL /* Define to 1 if you have the `atoll' function. */ #undef HAVE_ATOLL /* Define if atoll is declared. */ #undef HAVE_ATOLL_DECL /* Define if atol is declared. */ #undef HAVE_ATOL_DECL /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define if bcopy is declared. */ #undef HAVE_BCOPY_DECL /* Define to 1 if you have the `bind' function. */ #undef HAVE_BIND /* Define if bind is declared. */ #undef HAVE_BIND_DECL /* Define to 1 if you have the header file. */ #undef HAVE_BP_SYM_H /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define if bzero is declared. */ #undef HAVE_BZERO_DECL /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the `chsize' function. */ #undef HAVE_CHSIZE /* Define to 1 if you have the `closelog' function. */ #undef HAVE_CLOSELOG /* Define if closelog is declared. */ #undef HAVE_CLOSELOG_DECL /* Define to 1 if you have the `connect' function. */ #undef HAVE_CONNECT /* Define if connect is declared. */ #undef HAVE_CONNECT_DECL /* Define to 1 if you have the header file. */ #undef HAVE_CRYPTO_HMAC_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. */ #undef HAVE_DECL_ALARM /* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you don't. */ #undef HAVE_DECL_FREEADDRINFO /* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't. */ #undef HAVE_DECL_FSEEKO /* Define to 1 if you have the declaration of `ftello', and to 0 if you don't. */ #undef HAVE_DECL_FTELLO /* Define to 1 if you have the declaration of `gai_strerror', and to 0 if you don't. */ #undef HAVE_DECL_GAI_STRERROR /* Define to 1 if you have the declaration of `gai_strerrorA', and to 0 if you don't. */ #undef HAVE_DECL_GAI_STRERRORA /* Define to 1 if you have the declaration of `getaddrinfo', and to 0 if you don't. */ #undef HAVE_DECL_GETADDRINFO /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETC_UNLOCKED /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if you have the declaration of `getnameinfo', and to 0 if you don't. */ #undef HAVE_DECL_GETNAMEINFO /* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you don't. */ #undef HAVE_DECL_INET_NTOP /* Define to 1 if you have the declaration of `inet_pton', and to 0 if you don't. */ #undef HAVE_DECL_INET_PTON /* Define to 1 if you have the declaration of `isblank', and to 0 if you don't. */ #undef HAVE_DECL_ISBLANK /* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you don't. */ #undef HAVE_DECL_MBRTOWC /* Define to 1 if you have the declaration of `mbsinit', and to 0 if you don't. */ #undef HAVE_DECL_MBSINIT /* Define to 1 if you have the declaration of `readdir', and to 0 if you don't. */ #undef HAVE_DECL_READDIR /* Define to 1 if you have the declaration of `readdir64', and to 0 if you don't. */ #undef HAVE_DECL_READDIR64 /* Define to 1 if you have the declaration of `readdir64_r', and to 0 if you don't. */ #undef HAVE_DECL_READDIR64_R /* Define to 1 if you have the declaration of `readdir_r', and to 0 if you don't. */ #undef HAVE_DECL_READDIR_R /* Define to 1 if you have the declaration of `snprintf', and to 0 if you don't. */ #undef HAVE_DECL_SNPRINTF /* Define to 1 if you have the declaration of `towlower', and to 0 if you don't. */ #undef HAVE_DECL_TOWLOWER /* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you don't. */ #undef HAVE_DECL_WCRTOMB /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to the string that enables dump estimates. */ #undef HAVE_DUMP_ESTIMATE /* Define to 1 if you have the header file. */ #undef HAVE_DUSTAT_H /* Define to 1 if you have the `eaccess' function. */ #undef HAVE_EACCESS /* Define if eaccess is declared. */ #undef HAVE_EACCESS_DECL /* Define to 1 if you have the `endmntent' function. */ #undef HAVE_ENDMNTENT /* Define if you have the declaration of environ. */ #undef HAVE_ENVIRON_DECL /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS /* Define if euidaccess is declared. */ #undef HAVE_EUIDACCESS_DECL /* Define to 1 if you have the `faccessat' function. */ #undef HAVE_FACCESSAT /* Define to 1 if you have the `fclose' function. */ #undef HAVE_FCLOSE /* Define if fclose is declared. */ #undef HAVE_FCLOSE_DECL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `fflush' function. */ #undef HAVE_FFLUSH /* Define if fflush is declared. */ #undef HAVE_FFLUSH_DECL /* Define to 1 if you have the `fprintf' function. */ #undef HAVE_FPRINTF /* Define if fprintf is declared. */ #undef HAVE_FPRINTF_DECL /* Define to 1 if you have the `fputc' function. */ #undef HAVE_FPUTC /* Define if fputc is declared. */ #undef HAVE_FPUTC_DECL /* Define to 1 if you have the `fputs' function. */ #undef HAVE_FPUTS /* Define if fputs is declared. */ #undef HAVE_FPUTS_DECL /* Define to 1 if you have the `fread' function. */ #undef HAVE_FREAD /* Define if fread is declared. */ #undef HAVE_FREAD_DECL /* Define to 1 if you have the `fseek' function. */ #undef HAVE_FSEEK /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Define if fseek is declared. */ #undef HAVE_FSEEK_DECL /* Define to 1 if you have the header file. */ #undef HAVE_FSTAB_H /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `fwrite' function. */ #undef HAVE_FWRITE /* Define if fwrite is declared. */ #undef HAVE_FWRITE_DECL /* Define to 1 if you have the `getgrgid_r' function. */ #undef HAVE_GETGRGID_R /* Define to 1 if your system has a working `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define if gethostname is declared. */ #undef HAVE_GETHOSTNAME_DECL /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define if getopt is declared. */ #undef HAVE_GETOPT_DECL /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the `getpeername' function. */ #undef HAVE_GETPEERNAME /* Define if getpeername is declared. */ #undef HAVE_GETPEERNAME_DECL /* Define to 1 if you have the `getpwuid_r' function. */ #undef HAVE_GETPWUID_R /* Define to 1 if you have the `getservbyname' function. */ #undef HAVE_GETSERVBYNAME /* Define to 1 if you have the `getsockname' function. */ #undef HAVE_GETSOCKNAME /* Define if getsockname is declared. */ #undef HAVE_GETSOCKNAME_DECL /* Define to 1 if you have the `getsockopt' function. */ #undef HAVE_GETSOCKOPT /* Define if getsockopt is declared. */ #undef HAVE_GETSOCKOPT_DECL /* Define to 1 if you have the `getsysinfo' function. */ #undef HAVE_GETSYSINFO /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define this if glibc's backtrace functionality (execinfo.h) is present */ #undef HAVE_GLIBC_BACKTRACE /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define if Amanda is using the gzip program. */ #undef HAVE_GZIP /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_HMAC_H /* Define this if dump accepts -h for honoring nodump. */ #undef HAVE_HONOR_NODUMP /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define if initgroups is declared. */ #undef HAVE_INITGROUPS_DECL /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define to 1 if you have the `ioctl' function. */ #undef HAVE_IOCTL /* Define if ioctl is declared. */ #undef HAVE_IOCTL_DECL /* Define to 1 if defines AF_INET. */ #undef HAVE_IPV4 /* Define to 1 if defines AF_INET6. */ #undef HAVE_IPV6 /* Define to 1 if you have the `isblank' function. */ #undef HAVE_ISBLANK /* Define to 1 if you have the `isnormal' function. */ #undef HAVE_ISNORMAL /* Define if isnormal is declared. */ #undef HAVE_ISNORMAL_DECL /* Define to 1 if you have the `issetugid' function. */ #undef HAVE_ISSETUGID /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL /* Define to 1 if you have the `iswctype' function. */ #undef HAVE_ISWCTYPE /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have a functional curl library. */ #undef HAVE_LIBCURL /* Define to 1 if you have the `cur_colr' library (-lcur_colr). */ #undef HAVE_LIBCUR_COLR /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `krb5support' library (-lkrb5support). */ #undef HAVE_LIBKRB5SUPPORT /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define if you have a readline compatible library */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `sun' library (-lsun). */ #undef HAVE_LIBSUN /* Define to 1 if you have the `xpg4' library (-lxpg4). */ #undef HAVE_LIBXPG4 /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_ZFTAPE_H /* Define to 1 if you have the `listen' function. */ #undef HAVE_LISTEN /* Define if listen is declared. */ #undef HAVE_LISTEN_DECL /* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT /* Set to 1 if an LPR command was found at configure time */ #undef HAVE_LPR_CMD /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define if lstat is declared. */ #undef HAVE_LSTAT_DECL /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_HAL_SYSINFO_H /* Define to 1 if you have the `malloc' function. */ #undef HAVE_MALLOC /* Define if malloc is declared. */ #undef HAVE_MALLOC_DECL /* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC_GNU /* Define if the 'malloc' function is POSIX compliant. */ #undef HAVE_MALLOC_POSIX /* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including config.h and . */ #undef HAVE_MAP_ANONYMOUS /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the `mbrtowc' function. */ #undef HAVE_MBRTOWC /* Define to 1 if you have the `mbsinit' function. */ #undef HAVE_MBSINIT /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define if memmove is declared. */ #undef HAVE_MEMMOVE_DECL /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define if memset is declared. */ #undef HAVE_MEMSET_DECL /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define if mkstemp is declared. */ #undef HAVE_MKSTEMP_DECL /* Define to 1 if you have the `mktemp' function. */ #undef HAVE_MKTEMP /* Define if mktemp is declared. */ #undef HAVE_MKTEMP_DECL /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME /* Define if mktime is declared. */ #undef HAVE_MKTIME_DECL /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_MNTTAB_H /* Define to 1 if you have the `mprotect' function. */ #undef HAVE_MPROTECT /* Define to 1 on MSVC platforms that have the "invalid parameter handler" concept. */ #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER /* Define if the mtget structure has an mt_blkno field */ #undef HAVE_MT_BLKNO /* Define if the mtget structure has an mt_dsreg field */ #undef HAVE_MT_DSREG /* Define if the mtget structure has an mt_erreg field */ #undef HAVE_MT_ERREG /* Define if the mtget structure has an mt_fileno field */ #undef HAVE_MT_FILENO /* Define if the mtget structure has an mt_flags field */ #undef HAVE_MT_FLAGS /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT /* Define to 1 if you have the `openlog' function. */ #undef HAVE_OPENLOG /* Define if openlog is declared. */ #undef HAVE_OPENLOG_DECL /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_HMAC_H /* Define to 1 if you have the `pclose' function. */ #undef HAVE_PCLOSE /* Define if pclose is declared. */ #undef HAVE_PCLOSE_DECL /* Define to 1 if you have the `perror' function. */ #undef HAVE_PERROR /* Define if perror is declared. */ #undef HAVE_PERROR_DECL /* Define to 1 if you have the `printf' function. */ #undef HAVE_PRINTF /* Define if printf is declared. */ #undef HAVE_PRINTF_DECL /* Define to 1 if you have the `pstat_getdynamic' function. */ #undef HAVE_PSTAT_GETDYNAMIC /* Define to 1 if you have the `pstat_getstatic' function. */ #undef HAVE_PSTAT_GETSTATIC /* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE /* Define if the POSIX multithreading library has read/write locks. */ #undef HAVE_PTHREAD_RWLOCK /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `puts' function. */ #undef HAVE_PUTS /* Define if puts is declared. */ #undef HAVE_PUTS_DECL /* Define to 1 if you have the `raise' function. */ #undef HAVE_RAISE /* Define to 1 if accept is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ACCEPT /* Define to 1 if accept4 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ACCEPT4 /* Define to 1 if atoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ATOLL /* Define to 1 if bind is declared even after undefining macros. */ #undef HAVE_RAW_DECL_BIND /* Define to 1 if btowc is declared even after undefining macros. */ #undef HAVE_RAW_DECL_BTOWC /* Define to 1 if canonicalize_file_name is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME /* Define to 1 if chdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CHDIR /* Define to 1 if chown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CHOWN /* Define to 1 if connect is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CONNECT /* Define to 1 if dprintf is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DPRINTF /* Define to 1 if dup is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP /* Define to 1 if dup2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP2 /* Define to 1 if dup3 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP3 /* Define to 1 if duplocale is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUPLOCALE /* Define to 1 if endusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ENDUSERSHELL /* Define to 1 if environ is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ENVIRON /* Define to 1 if euidaccess is declared even after undefining macros. */ #undef HAVE_RAW_DECL_EUIDACCESS /* Define to 1 if faccessat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FACCESSAT /* Define to 1 if fchdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHDIR /* Define to 1 if fchmodat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHMODAT /* Define to 1 if fchownat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHOWNAT /* Define to 1 if fcntl is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCNTL /* Define to 1 if fdatasync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FDATASYNC /* Define to 1 if ffsl is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FFSL /* Define to 1 if ffsll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FFSLL /* Define to 1 if fpurge is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FPURGE /* Define to 1 if freeaddrinfo is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FREEADDRINFO /* Define to 1 if fseeko is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSEEKO /* Define to 1 if fstat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSTAT /* Define to 1 if fstatat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSTATAT /* Define to 1 if fsync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSYNC /* Define to 1 if ftello is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FTELLO /* Define to 1 if ftruncate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FTRUNCATE /* Define to 1 if futimens is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FUTIMENS /* Define to 1 if gai_strerror is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GAI_STRERROR /* Define to 1 if getaddrinfo is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETADDRINFO /* Define to 1 if getcwd is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETCWD /* Define to 1 if getdelim is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETDELIM /* Define to 1 if getdomainname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETDOMAINNAME /* Define to 1 if getdtablesize is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETDTABLESIZE /* Define to 1 if getgroups is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETGROUPS /* Define to 1 if gethostname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETHOSTNAME /* Define to 1 if getline is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLINE /* Define to 1 if getloadavg is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOADAVG /* Define to 1 if getlogin is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOGIN /* Define to 1 if getlogin_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOGIN_R /* Define to 1 if getnameinfo is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETNAMEINFO /* Define to 1 if getpagesize is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETPAGESIZE /* Define to 1 if getpeername is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETPEERNAME /* Define to 1 if gets is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETS /* Define to 1 if getsockname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETSOCKNAME /* Define to 1 if getsockopt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETSOCKOPT /* Define to 1 if getsubopt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETSUBOPT /* Define to 1 if gettimeofday is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETTIMEOFDAY /* Define to 1 if getusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETUSERSHELL /* Define to 1 if grantpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GRANTPT /* Define to 1 if group_member is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GROUP_MEMBER /* Define to 1 if inet_ntop is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INET_NTOP /* Define to 1 if inet_pton is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INET_PTON /* Define to 1 if initstate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INITSTATE /* Define to 1 if initstate_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INITSTATE_R /* Define to 1 if isatty is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ISATTY /* Define to 1 if iswctype is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ISWCTYPE /* Define to 1 if lchmod is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LCHMOD /* Define to 1 if lchown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LCHOWN /* Define to 1 if link is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LINK /* Define to 1 if linkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LINKAT /* Define to 1 if listen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LISTEN /* Define to 1 if lseek is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LSEEK /* Define to 1 if lstat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LSTAT /* Define to 1 if mbrlen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MBRLEN /* Define to 1 if mbrtowc is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MBRTOWC /* Define to 1 if mbsinit is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MBSINIT /* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MBSNRTOWCS /* Define to 1 if mbsrtowcs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MBSRTOWCS /* Define to 1 if memmem is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MEMMEM /* Define to 1 if mempcpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MEMPCPY /* Define to 1 if memrchr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MEMRCHR /* Define to 1 if mkdirat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKDIRAT /* Define to 1 if mkdtemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKDTEMP /* Define to 1 if mkfifo is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKFIFO /* Define to 1 if mkfifoat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKFIFOAT /* Define to 1 if mknod is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKNOD /* Define to 1 if mknodat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKNODAT /* Define to 1 if mkostemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKOSTEMP /* Define to 1 if mkostemps is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKOSTEMPS /* Define to 1 if mkstemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKSTEMP /* Define to 1 if mkstemps is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKSTEMPS /* Define to 1 if nl_langinfo is declared even after undefining macros. */ #undef HAVE_RAW_DECL_NL_LANGINFO /* Define to 1 if openat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_OPENAT /* Define to 1 if pclose is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PCLOSE /* Define to 1 if pipe is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE /* Define to 1 if pipe2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE2 /* Define to 1 if popen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_POPEN /* Define to 1 if posix_openpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_POSIX_OPENPT /* Define to 1 if pread is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PREAD /* Define to 1 if pthread_sigmask is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTHREAD_SIGMASK /* Define to 1 if ptsname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTSNAME /* Define to 1 if ptsname_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTSNAME_R /* Define to 1 if pwrite is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PWRITE /* Define to 1 if random is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM /* Define to 1 if random_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM_R /* Define to 1 if rawmemchr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RAWMEMCHR /* Define to 1 if readlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_READLINK /* Define to 1 if readlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_READLINKAT /* Define to 1 if realpath is declared even after undefining macros. */ #undef HAVE_RAW_DECL_REALPATH /* Define to 1 if recv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RECV /* Define to 1 if recvfrom is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RECVFROM /* Define to 1 if renameat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RENAMEAT /* Define to 1 if rmdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RMDIR /* Define to 1 if rpmatch is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RPMATCH /* Define to 1 if secure_getenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SECURE_GETENV /* Define to 1 if send is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SEND /* Define to 1 if sendto is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SENDTO /* Define to 1 if setenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETENV /* Define to 1 if sethostname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETHOSTNAME /* Define to 1 if setlocale is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETLOCALE /* Define to 1 if setsockopt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSOCKOPT /* Define to 1 if setstate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSTATE /* Define to 1 if setstate_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSTATE_R /* Define to 1 if setusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETUSERSHELL /* Define to 1 if shutdown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SHUTDOWN /* Define to 1 if sigaction is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGACTION /* Define to 1 if sigaddset is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGADDSET /* Define to 1 if sigdelset is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGDELSET /* Define to 1 if sigemptyset is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGEMPTYSET /* Define to 1 if sigfillset is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGFILLSET /* Define to 1 if sigismember is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGISMEMBER /* Define to 1 if sigpending is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGPENDING /* Define to 1 if sigprocmask is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SIGPROCMASK /* Define to 1 if sleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SLEEP /* Define to 1 if snprintf is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SNPRINTF /* Define to 1 if socket is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SOCKET /* Define to 1 if srandom is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SRANDOM /* Define to 1 if srandom_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SRANDOM_R /* Define to 1 if stat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STAT /* Define to 1 if stpcpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STPCPY /* Define to 1 if stpncpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STPNCPY /* Define to 1 if strcasestr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRCASESTR /* Define to 1 if strchrnul is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRCHRNUL /* Define to 1 if strdup is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRDUP /* Define to 1 if strerror_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRERROR_R /* Define to 1 if strncat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRNCAT /* Define to 1 if strndup is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRNDUP /* Define to 1 if strnlen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRNLEN /* Define to 1 if strpbrk is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRPBRK /* Define to 1 if strsep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRSEP /* Define to 1 if strsignal is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRSIGNAL /* Define to 1 if strtod is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOD /* Define to 1 if strtok_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOK_R /* Define to 1 if strtoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOLL /* Define to 1 if strtoull is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOULL /* Define to 1 if strverscmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRVERSCMP /* Define to 1 if symlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SYMLINK /* Define to 1 if symlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SYMLINKAT /* Define to 1 if tmpfile is declared even after undefining macros. */ #undef HAVE_RAW_DECL_TMPFILE /* Define to 1 if towctrans is declared even after undefining macros. */ #undef HAVE_RAW_DECL_TOWCTRANS /* Define to 1 if ttyname_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_TTYNAME_R /* Define to 1 if unlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLINK /* Define to 1 if unlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLINKAT /* Define to 1 if unlockpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLOCKPT /* Define to 1 if unsetenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNSETENV /* Define to 1 if usleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_USLEEP /* Define to 1 if utimensat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UTIMENSAT /* Define to 1 if vdprintf is declared even after undefining macros. */ #undef HAVE_RAW_DECL_VDPRINTF /* Define to 1 if vsnprintf is declared even after undefining macros. */ #undef HAVE_RAW_DECL_VSNPRINTF /* Define to 1 if wcpcpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCPCPY /* Define to 1 if wcpncpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCPNCPY /* Define to 1 if wcrtomb is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCRTOMB /* Define to 1 if wcscasecmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCASECMP /* Define to 1 if wcscat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCAT /* Define to 1 if wcschr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCHR /* Define to 1 if wcscmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCMP /* Define to 1 if wcscoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCOLL /* Define to 1 if wcscpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCPY /* Define to 1 if wcscspn is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSCSPN /* Define to 1 if wcsdup is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSDUP /* Define to 1 if wcslen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSLEN /* Define to 1 if wcsncasecmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNCASECMP /* Define to 1 if wcsncat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNCAT /* Define to 1 if wcsncmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNCMP /* Define to 1 if wcsncpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNCPY /* Define to 1 if wcsnlen is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNLEN /* Define to 1 if wcsnrtombs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNRTOMBS /* Define to 1 if wcspbrk is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSPBRK /* Define to 1 if wcsrchr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSRCHR /* Define to 1 if wcsrtombs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSRTOMBS /* Define to 1 if wcsspn is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSSPN /* Define to 1 if wcsstr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSSTR /* Define to 1 if wcstok is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSTOK /* Define to 1 if wcswidth is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSWIDTH /* Define to 1 if wcsxfrm is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSXFRM /* Define to 1 if wctob is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCTOB /* Define to 1 if wctrans is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCTRANS /* Define to 1 if wctype is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCTYPE /* Define to 1 if wcwidth is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCWIDTH /* Define to 1 if wmemchr is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WMEMCHR /* Define to 1 if wmemcmp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WMEMCMP /* Define to 1 if wmemcpy is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WMEMCPY /* Define to 1 if wmemmove is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WMEMMOVE /* Define to 1 if wmemset is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WMEMSET /* Define to 1 if _Exit is declared even after undefining macros. */ #undef HAVE_RAW_DECL__EXIT /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H /* Define if your readline library has \`add_history' */ #undef HAVE_READLINE_HISTORY /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the `realloc' function. */ #undef HAVE_REALLOC /* Define if realloc is declared. */ #undef HAVE_REALLOC_DECL /* Define to 1 if you have the `recvfrom' function. */ #undef HAVE_RECVFROM /* Define if recvfrom is declared. */ #undef HAVE_RECVFROM_DECL /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `remove' function. */ #undef HAVE_REMOVE /* Define if remove is declared. */ #undef HAVE_REMOVE_DECL /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME /* Define if rename is declared. */ #undef HAVE_RENAME_DECL /* Define to 1 if you have the `rewind' function. */ #undef HAVE_REWIND /* Define if rewind is declared. */ #undef HAVE_REWIND_DECL /* Define to 1 if you have the header file. */ #undef HAVE_RPC_RPC_H /* Define to 1 if you have the `ruserok' function. */ #undef HAVE_RUSEROK /* Define if ruserok is declared. */ #undef HAVE_RUSEROK_DECL /* Define to 1 if the system has the type `sa_family_t'. */ #undef HAVE_SA_FAMILY_T /* Define to 1 if you have the `secure_getenv' function. */ #undef HAVE_SECURE_GETENV /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define if select is declared. */ #undef HAVE_SELECT_DECL /* Define to 1 if you have the `sendto' function. */ #undef HAVE_SENDTO /* Define if sendto is declared. */ #undef HAVE_SENDTO_DECL /* Define to 1 if you have the `setegid' function. */ #undef HAVE_SETEGID /* Define if setegid is declared. */ #undef HAVE_SETEGID_DECL /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Define if seteuid is declared. */ #undef HAVE_SETEUID_DECL /* Define to 1 if you have the `setmntent' function. */ #undef HAVE_SETMNTENT /* Define to 1 if you have the `setpgid' function. */ #undef HAVE_SETPGID /* Define if setpgid is declared. */ #undef HAVE_SETPGID_DECL /* Define to 1 if you have the `setpgrp' function. */ #undef HAVE_SETPGRP /* Define if setpgrp is declared. */ #undef HAVE_SETPGRP_DECL /* Define to 1 if you have the `setresgid' function. */ #undef HAVE_SETRESGID /* Define if setresgid is declared. */ #undef HAVE_SETRESGID_DECL /* Define to 1 if you have the `setresuid' function. */ #undef HAVE_SETRESUID /* Define if setresuid is declared. */ #undef HAVE_SETRESUID_DECL /* Define to 1 if you have the `setsockopt' function. */ #undef HAVE_SETSOCKOPT /* Define if setsockopt is declared. */ #undef HAVE_SETSOCKOPT_DECL /* Define to 1 if you have the `shutdown' function. */ #undef HAVE_SHUTDOWN /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `sigemptyset' function. */ #undef HAVE_SIGEMPTYSET /* Define to 1 if 'sig_atomic_t' is a signed integer type. */ #undef HAVE_SIGNED_SIG_ATOMIC_T /* Define to 1 if 'wchar_t' is a signed integer type. */ #undef HAVE_SIGNED_WCHAR_T /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T /* Define to 1 if you have the `sigvec' function. */ #undef HAVE_SIGVEC /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define if snprintf is declared. */ #undef HAVE_SNPRINTF_DECL /* Define if the return value of the snprintf function is the number of of bytes (excluding the terminating NUL) that would have been produced if the buffer had been large enough. */ #undef HAVE_SNPRINTF_RETVAL_C99 /* struct sockaddr_storage exists */ #undef HAVE_SOCKADDR_STORAGE /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the `socketpair' function. */ #undef HAVE_SOCKETPAIR /* Define if socketpair is declared. */ #undef HAVE_SOCKETPAIR_DECL /* Define if socket is declared. */ #undef HAVE_SOCKET_DECL /* Define to 1 if you have the `sscanf' function. */ #undef HAVE_SSCANF /* Define if sscanf is declared. */ #undef HAVE_SSCANF_DECL /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define if strcasecmp is declared. */ #undef HAVE_STRCASECMP_DECL /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define if strerror is declared. */ #undef HAVE_STRERROR_DECL /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define if strftime is declared. */ #undef HAVE_STRFTIME_DECL /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define if strncasecmp is declared. */ #undef HAVE_STRNCASECMP_DECL /* Define to 1 if you have the `strnlen' function. */ #undef HAVE_STRNLEN /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define if strtoll is declared. */ #undef HAVE_STRTOLL_DECL /* Define if strtol is declared. */ #undef HAVE_STRTOL_DECL /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if `decimal_point' is a member of `struct lconv'. */ #undef HAVE_STRUCT_LCONV_DECIMAL_POINT /* Define to 1 if `sa_len' is a member of `struct sockaddr'. */ #undef HAVE_STRUCT_SOCKADDR_SA_LEN /* Define to 1 if the system has the type `struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY /* Define to 1 if you have the `symlink' function. */ #undef HAVE_SYMLINK /* Define to 1 if you have the `sysctl' function. */ #undef HAVE_SYSCTL /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define if syslog is declared. */ #undef HAVE_SYSLOG_DECL /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the `sysmp' function. */ #undef HAVE_SYSMP /* Define to 1 if you have the `system' function. */ #undef HAVE_SYSTEM /* Define if system is declared. */ #undef HAVE_SYSTEM_DECL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILSYS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FS_S5PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_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_IPC_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_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MTIO_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PSTAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_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_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSMP_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTEMCFG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TABLE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TAPE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFSTAB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `table' function. */ #undef HAVE_TABLE /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define if time is declared. */ #undef HAVE_TIME_DECL /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the `tolower' function. */ #undef HAVE_TOLOWER /* Define if tolower is declared. */ #undef HAVE_TOLOWER_DECL /* Define to 1 if you have the `toupper' function. */ #undef HAVE_TOUPPER /* Define if toupper is declared. */ #undef HAVE_TOUPPER_DECL /* Define to 1 if you have the `towlower' function. */ #undef HAVE_TOWLOWER /* Define to 1 if you have the `ungetc' function. */ #undef HAVE_UNGETC /* Define if ungetc is declared. */ #undef HAVE_UNGETC_DECL /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the "util.h" header file. */ #undef HAVE_UTIL_H /* Define to 1 if you have the `vasnprintf' function. */ #undef HAVE_VASNPRINTF /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF /* Define if vfprintf is declared. */ #undef HAVE_VFPRINTF_DECL /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define if vprintf is declared. */ #undef HAVE_VPRINTF_DECL /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define if vsnprintf is declared. */ #undef HAVE_VSNPRINTF_DECL /* Define to 1 if you have the header file. */ #undef HAVE_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcrtomb' function. */ #undef HAVE_WCRTOMB /* Define to 1 if you have the `wcscoll' function. */ #undef HAVE_WCSCOLL /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define to 1 if you have the `wcsnlen' function. */ #undef HAVE_WCSNLEN /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if O_NOATIME works. */ #undef HAVE_WORKING_O_NOATIME /* Define to 1 if O_NOFOLLOW works. */ #undef HAVE_WORKING_O_NOFOLLOW /* Define to 1 if you have the `writev' function. */ #undef HAVE_WRITEV /* Define if writev is declared. */ #undef HAVE_WRITEV_DECL /* Define to 1 if you have the header file. */ #undef HAVE_WS2TCPIP_H /* Define to 1 if you have the header file. */ #undef HAVE_XLOCALE_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if you have the `_fseeki64' function. */ #undef HAVE__FSEEKI64 /* Define to 1 if you have the `_ftelli64' function. */ #undef HAVE__FTELLI64 /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME /* Define to 1 if you have the `_set_invalid_parameter_handler' function. */ #undef HAVE__SET_INVALID_PARAMETER_HANDLER /* Define to 1 if you have the external variable, _system_configuration with a member named physmem. */ #undef HAVE__SYSTEM_CONFIGURATION /* Define to 1 if you have the `__secure_getenv' function. */ #undef HAVE___SECURE_GETENV /* Define on Cygwin. */ #undef IGNORE_FSTAB /* Define on Cygwin. */ #undef IGNORE_TAR_ERRORS /* The name for the Kerberized Amanda service. */ #undef KAMANDA_SERVICE_NAME /* Define if Kerberos 5 security is to be enabled. */ #undef KRB5_SECURITY /* Defined if libcurl supports AsynchDNS */ #undef LIBCURL_FEATURE_ASYNCHDNS /* Defined if libcurl supports IDN */ #undef LIBCURL_FEATURE_IDN /* Defined if libcurl supports IPv6 */ #undef LIBCURL_FEATURE_IPV6 /* Defined if libcurl supports KRB4 */ #undef LIBCURL_FEATURE_KRB4 /* Defined if libcurl supports libz */ #undef LIBCURL_FEATURE_LIBZ /* Defined if libcurl supports NTLM */ #undef LIBCURL_FEATURE_NTLM /* Defined if libcurl supports SSL */ #undef LIBCURL_FEATURE_SSL /* Defined if libcurl supports SSPI */ #undef LIBCURL_FEATURE_SSPI /* Defined if libcurl supports DICT */ #undef LIBCURL_PROTOCOL_DICT /* Defined if libcurl supports FILE */ #undef LIBCURL_PROTOCOL_FILE /* Defined if libcurl supports FTP */ #undef LIBCURL_PROTOCOL_FTP /* Defined if libcurl supports FTPS */ #undef LIBCURL_PROTOCOL_FTPS /* Defined if libcurl supports HTTP */ #undef LIBCURL_PROTOCOL_HTTP /* Defined if libcurl supports HTTPS */ #undef LIBCURL_PROTOCOL_HTTPS /* Defined if libcurl supports LDAP */ #undef LIBCURL_PROTOCOL_LDAP /* Defined if libcurl supports TELNET */ #undef LIBCURL_PROTOCOL_TELNET /* Defined if libcurl supports TFTP */ #undef LIBCURL_PROTOCOL_TFTP /* Defined if libcurl use GnuTLS */ #undef LIBCURL_USE_GNUTLS /* Defined if libcurl use NSS */ #undef LIBCURL_USE_NSS /* Defined if libcurl use OpenSSL */ #undef LIBCURL_USE_OPENSSL /* A comma-separated list of two integers, determining the minimum and maximum * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) */ #undef LOW_TCPPORTRANGE /* Define to 1 if lseek does not detect pipes. */ #undef LSEEK_PIPE_BROKEN /* Define to 1 if 'lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ #undef MALLOC_0_IS_NONNULL /* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ #undef MAP_ANONYMOUS /* Define if the mbrtowc function has the NULL pwc argument bug. */ #undef MBRTOWC_NULL_ARG1_BUG /* Define if the mbrtowc function has the NULL string argument bug. */ #undef MBRTOWC_NULL_ARG2_BUG /* Define if the mbrtowc function does not return 0 for a NUL character. */ #undef MBRTOWC_NUL_RETVAL_BUG /* Define if the mbrtowc function returns a wrong return value. */ #undef MBRTOWC_RETVAL_BUG /* The switch to be used when invoking mt to specify the * tape device. */ #undef MT_FILE_FLAG /* Define on Cygwin. */ #undef NEED_PATH_ENV /* Define if we have to reset tape offsets when reaching 2GB. */ #undef NEED_RESETOFS /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* 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 if the pthread_in_use() detection is hard. */ #undef PTHREAD_IN_USE_DETECTION_HARD /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX /* Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ */ #undef RDEV_PREFIX /* Define to 1 if stat needs help when passed a directory name with a trailing slash */ #undef REPLACE_FUNC_STAT_DIR /* Define to 1 if stat needs help when passed a file name with a trailing slash */ #undef REPLACE_FUNC_STAT_FILE /* Define if nl_langinfo exists but is overridden by gnulib. */ #undef REPLACE_NL_LANGINFO /* Define if vasnprintf exists but is overridden by gnulib. */ #undef REPLACE_VASNPRINTF /* Define the location of the ufsrestore or restore program. */ #undef RESTORE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if RSH transport should be enabled. */ #undef RSH_SECURITY /* Define the location of smbclient for backing up Samba PC clients. */ #undef SAMBA_CLIENT /* Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. */ #undef SAMBA_VERSION /* Define to type of select arguments. */ #undef SELECT_ARG_TYPE /* A suffix that will be appended to service names. * Useful for testing in parallel with a working version. */ #undef SERVICE_SUFFIX /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX /* Define if all of Amanda will run as a single userid (e.g., on Cygwin or for installchecks) */ #undef SINGLE_USERID /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `intmax_t', as computed by sizeof. */ #undef SIZEOF_INTMAX_T /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The size of `ssize_t', as computed by sizeof. */ #undef SIZEOF_SSIZE_T /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'size_t'. */ #undef SIZE_T_SUFFIX /* Define to the exact path to the sort program. */ #undef SORT_PATH /* Path to the SSH binary */ #undef SSH /* Arguments to ssh */ #undef SSH_OPTIONS /* Define if SSH transport should be enabled. */ #undef SSH_SECURITY /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Location of the 'star' binary */ #undef STAR /* Define if the block counts reported by statfs may be truncated to 2GB and the correct values may be stored in the f_spare array. (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be affected.) */ #undef STATFS_TRUNCATES_BLOCK_COUNTS /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define if there is no specific function for reading file systems usage information and you have the header file. (SVR2) */ #undef STAT_READ_FILSYS /* Define if statfs takes 2 args and struct statfs has a field named f_bsize. (4.3BSD, SunOS 4, HP-UX, AIX PS/2) */ #undef STAT_STATFS2_BSIZE /* Define if statfs takes 2 args and struct statfs has a field named f_frsize. (glibc/Linux > 2.6) */ #undef STAT_STATFS2_FRSIZE /* Define if statfs takes 2 args and struct statfs has a field named f_fsize. (4.4BSD, NetBSD) */ #undef STAT_STATFS2_FSIZE /* Define if statfs takes 2 args and the second argument has type struct fs_data. (Ultrix) */ #undef STAT_STATFS2_FS_DATA /* Define if statfs takes 3 args. (DEC Alpha running OSF/1) */ #undef STAT_STATFS3_OSF1 /* Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin) */ #undef STAT_STATFS4 /* Define if there is a function named statvfs. (SVR4) */ #undef STAT_STATVFS /* Define if statvfs64 should be preferred over statvfs. */ #undef STAT_STATVFS64 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Location of the 'suntar' binary */ #undef SUNTAR /* A comma-separated list of two integers, determining the minimum and * maximum unreserved TCP port numbers sockets should be bound to. */ #undef TCPPORTRANGE /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* A comma-separated list of two integers, determining the minimum and * maximum reserved UDP port numbers sockets should be bound to. */ #undef UDPPORTRANGE /* Define the location of the uname program. */ #undef UNAME_PATH /* Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. */ #undef UNCOMPRESS_OPT /* Define as the exact path to the gzip or compress command. */ #undef UNCOMPRESS_PATH /* Define if you want to use the ".amandahosts" for BSD security. */ #undef USE_AMANDAHOSTS /* Define for backups being done on a multiple networks and FQDNs are used. */ #undef USE_FQDN /* Define to 1 if files will be processed with gettextize */ #undef USE_GETTEXT /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS /* Define if references to the POSIX multithreading library should be made weak. */ #undef USE_POSIX_THREADS_WEAK /* Define if the GNU Pth multithreading library can be used. */ #undef USE_PTH_THREADS /* Define if references to the GNU Pth multithreading library should be made weak. */ #undef USE_PTH_THREADS_WEAK /* Define to set SO_REUSEADDR on network connections. */ #undef USE_REUSEADDR /* Define to invoke rundump (setuid-root) instead of DUMP program directly. */ #undef USE_RUNDUMP /* Define if the old Solaris multithreading library can be used. */ #undef USE_SOLARIS_THREADS /* Define if references to the old Solaris multithreading library should be made weak. */ #undef USE_SOLARIS_THREADS_WEAK /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on OS X. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions if necessary. HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define if the native Windows multithreading API can be used. */ #undef USE_WINDOWS_THREADS /* Define the location of the vdump program. */ #undef VDUMP /* Version number of package */ #undef VERSION /* Amanda version information beyond patch */ #undef VERSION_COMMENT /* major Amanda version number */ #undef VERSION_MAJOR /* minor Amanda version number */ #undef VERSION_MINOR /* Amanda patch number */ #undef VERSION_PATCH /* Define the location of the vrestore program. */ #undef VRESTORE /* Define the location of the vxdump program on HPUX and SINIX hosts or on * other hosts where the Veritas filesystem (vxfs) has been installed. */ #undef VXDUMP /* Define the location of the vxrestore program on HPUX and SINIX hosts or on * other hosts where the Veritas filesystem (vxfs) has been installed. */ #undef VXRESTORE /* Defined if wait() puts the status in a int instead of a union wait. */ #undef WAIT_USES_INT /* Defined if wait() puts the status in a union wait instead of int. */ #undef WAIT_USES_UNION /* Define to use flock(2) for file locking */ #undef WANT_AMFLOCK_FLOCK /* Define to use link(2) to emulate file locking. */ #undef WANT_AMFLOCK_LNLOCK /* Define to use lockf(3) for file locking. */ #undef WANT_AMFLOCK_LOCKF /* Define to use POSIX (fcntl()) for file locking */ #undef WANT_AMFLOCK_POSIX /* Compile DVD-RW driver */ #undef WANT_DVDRW_DEVICE /* Compile NDMP device */ #undef WANT_NDMP_DEVICE /* Compile Amazon S3 driver */ #undef WANT_S3_DEVICE /* Define if clients should be built setuid-root */ #undef WANT_SETUID_CLIENT /* Define if the tape-device will be built */ #undef WANT_TAPE_DEVICE /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wchar_t'. */ #undef WCHAR_T_SUFFIX /* Define if WSAStartup is needed. */ #undef WINDOWS_SOCKETS /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wint_t'. */ #undef WINT_T_SUFFIX /* 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 /* This system has functional IPv6 support (kernel and compiler) */ #undef WORKING_IPV6 /* Define the location of the xfsdump program on Irix hosts. */ #undef XFSDUMP /* Define the location of the xfsrestore program on Irix hosts. */ #undef XFSRESTORE /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable large inode numbers on Mac OS X 10.5. */ #undef _DARWIN_USE_64_BIT_INODE /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct stat.st_size becomes 64-bit. */ #undef _GL_WINDOWS_64_BIT_ST_SIZE /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 on Solaris. */ #undef _LCONV_C99 /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ #undef _NETBSD_SOURCE /* The _Noreturn keyword of C11. */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 in order to get the POSIX compatible declarations of socket functions. */ #undef _POSIX_PII_SOCKET /* Define to 1 if you need to in order for 'stat' and other things to work. */ #undef _POSIX_SOURCE /* Define if you want to include , so that it consistently overrides 's RE_DUP_MAX. */ #undef _REGEX_INCLUDE_LIMITS_H /* Define if you want regoff_t to be at least as wide POSIX requires. */ #undef _REGEX_LARGE_OFFSETS /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX /* Directory in which amanda's templates and examples are installed. */ #undef amdatadir /* Directory in which Amanda header files should be installed */ #undef amincludedir /* Directory in which Amanda libraries should be installed */ #undef amlibdir /* Directory in which Amanda own programs should be installed */ #undef amlibexecdir /* Directory in which perl modules should be installed */ #undef amperldir /* Directory in which user binaries should be installed. */ #undef bindir /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define curl_free() as free() if our version of curl lacks curl_free. */ #undef curl_free /* Type for curl_off_t, if it is not defined by the system */ #undef curl_off_t /* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. _GL_INLINE_HEADER_BEGIN contains useful stuff to put in an include file, before uses of _GL_INLINE. It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, when FOO is an inline function in the header; see . _GL_INLINE_HEADER_END contains useful stuff to put in the same include file, after uses of _GL_INLINE. Suppress extern inline with HP-UX cc, as it appears to be broken; see . Suppress extern inline with Sun C in standards-conformance mode, as it mishandles inline functions that call each other. E.g., for 'inline void f (void) { } inline void g (void) { f (); }', c99 incorrectly complains 'reference to static identifier "f" in extern inline function'. This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. Suppress the use of extern inline on Apple's platforms, as Libc at least through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g., . Perhaps Apple will fix this some day. */ #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined __APPLE__) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__ # if __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) # else # define _GL_INLINE extern inline # endif # define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static _GL_UNUSED # define _GL_EXTERN_INLINE static _GL_UNUSED #endif #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ _GL_INLINE_HEADER_CONST_PRAGMA # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") #else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif /* Define to `int' if doesn't define. */ #undef gid_t /* Define to rpl_gmtime if the replacement function should be used. */ #undef gmtime /* Type for in_port_t, if it is not defined by the system */ #undef in_port_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to long or long long if and don't define. */ #undef intmax_t /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif /* Directory in which internal binaries should be installed. */ #undef libexecdir /* Define to rpl_localtime if the replacement function should be used. */ #undef localtime /* Directory in which man-pages should be installed */ #undef mandir /* Define to a type if does not define. */ #undef mbstate_t /* Define to `int' if does not define. */ #undef mode_t /* Define to the type of st_nlink in struct stat, or a supertype. */ #undef nlink_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define as the type of the result of subtracting two pointers, if the system doesn't define it. */ #undef ptrdiff_t /* Define to rpl_re_comp if the replacement should be used. */ #undef re_comp /* Define to rpl_re_compile_fastmap if the replacement should be used. */ #undef re_compile_fastmap /* Define to rpl_re_compile_pattern if the replacement should be used. */ #undef re_compile_pattern /* Define to rpl_re_exec if the replacement should be used. */ #undef re_exec /* Define to rpl_re_match if the replacement should be used. */ #undef re_match /* Define to rpl_re_match_2 if the replacement should be used. */ #undef re_match_2 /* Define to rpl_re_search if the replacement should be used. */ #undef re_search /* Define to rpl_re_search_2 if the replacement should be used. */ #undef re_search_2 /* Define to rpl_re_set_registers if the replacement should be used. */ #undef re_set_registers /* Define to rpl_re_set_syntax if the replacement should be used. */ #undef re_set_syntax /* Define to rpl_re_syntax_options if the replacement should be used. */ #undef re_syntax_options /* Define to rpl_regcomp if the replacement should be used. */ #undef regcomp /* Define to rpl_regerror if the replacement should be used. */ #undef regerror /* Define to rpl_regexec if the replacement should be used. */ #undef regexec /* Define to rpl_regfree if the replacement should be used. */ #undef regfree /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Work around a bug in Sun C++: it does not support _Restrict or __restrict__, even though the corresponding Sun C compiler ends up with "#define restrict _Restrict" or "#define restrict __restrict__" in the previous line. Perhaps some future version of Sun C++ will work with restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict # define __restrict__ #endif /* Type for sa_family_t, if it is not defined by the system */ #undef sa_family_t /* Directory in which administrator binaries should be installed. */ #undef sbindir /* Define to `unsigned int' if does not define. */ #undef size_t /* type to use in place of socklen_t if not defined */ #undef socklen_t /* type to use for socket length parameters; use instead of socklen_t */ #undef socklen_t_equiv /* Define as a signed type of the same size as size_t. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as a marker that can be attached to declarations that might not be used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _GL_UNUSED __attribute__ ((__unused__)) #else # define _GL_UNUSED #endif /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else # define _GL_ATTRIBUTE_PURE /* empty */ #endif /* The __const__ attribute was added in gcc 2.95. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else # define _GL_ATTRIBUTE_CONST /* empty */ #endif amanda-3.3.6/config/macro-archive/0000775000076400007640000000000012357750426020440 5ustar00martineamartinea00000000000000amanda-3.3.6/config/macro-archive/ac_prog_perl_version.m40000664000076400007640000000276012357250006025075 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_prog_perl_version.html # # SYNOPSIS # # AC_PROG_PERL_VERSION(VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # Makes sure that perl supports the version indicated. If true the # shell commands in ACTION-IF-TRUE are executed. If not the shell # commands in ACTION-IF-FALSE are run. Note if $PERL is not set (for # example by running AC_CHECK_PROG or AC_PATH_PROG), # AC_CHECK_PROG(PERL, perl, perl) will be run. # # Example: # # AC_PROG_PERL_VERSION(5.6.0) # # This will check to make sure that the perl you have supports at # least version 5.6.0. # # LAST MODIFICATION # # 2002-09-25 # # COPYLEFT # # Copyright (c) 2002 Dean Povey # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided # the copyright notice and this notice are preserved. AC_DEFUN([AC_PROG_PERL_VERSION],[dnl # Make sure we have perl if test -z "$PERL"; then AC_CHECK_PROG(PERL,perl,perl) fi # Check if version of Perl is sufficient ac_perl_version="$1" if test "x$PERL" != "x"; then AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version) # NB: It would be nice to log the error if there is one, but we cannot rely # on autoconf internals $PERL -e "use $ac_perl_version;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_RESULT(no); $3 else AC_MSG_RESULT(ok); $2 fi else AC_MSG_WARN(could not find perl) fi ])dnl amanda-3.3.6/config/macro-archive/ac_prog_swig.m40000664000076400007640000000735512357250006023344 0ustar00martineamartinea00000000000000# Modified by Dustin J. Mitchell, Zmanda, Inc. as follows: # - remove warnings -- Amanda tarballs ship pre-swigged, so users # need not be alarmed if they don't have SWIG. # ##### http://autoconf-archive.cryp.to/ac_pkg_swig.html # # SYNOPSIS # # AC_PROG_SWIG([major.minor.micro]) # # DESCRIPTION # # This macro searches for a SWIG installation on your system. If # found you should call SWIG via $(SWIG). You can use the optional # first argument to check if the version of the available SWIG is # greater than or equal to the value of the argument. It should have # the format: N[.N[.N]] (N is a number between 0 and 999. Only the # first N is mandatory.) # # If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks # that the swig package is this version number or higher. # # In configure.in, use as: # # AC_PROG_SWIG(1.3.17) # SWIG_ENABLE_CXX # SWIG_MULTI_MODULE_SUPPORT # SWIG_PYTHON # # LAST MODIFICATION # # 2007-07-15 # # COPYLEFT # # Copyright (c) 2006 Sebastian Huber # Copyright (c) 2006 Alan W. Irwin # Copyright (c) 2006 Rafael Laboissiere # Copyright (c) 2006 Andrew Collier # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, 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 Macro 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. AC_DEFUN([AC_PROG_SWIG],[ AC_PATH_PROG([SWIG],[swig]) if test -z "$SWIG" ; then SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' elif test -n "$1" ; then AC_MSG_CHECKING([for SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then AX_COMPARE_VERSION($swig_version, ge, $1, [ dnl action-if-true SWIG_LIB=`$SWIG -swiglib` ], [ dnl action-if-false SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' ]) else SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' fi fi AC_SUBST([SWIG_LIB]) ]) amanda-3.3.6/config/macro-archive/docbook-xslt.m40000664000076400007640000000635712357250006023312 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_check_docbook_xslt.html # # SYNOPSIS # # AC_CHECK_DOCBOOK_XSLT([xslt-version]) # # DESCRIPTION # # Check for access to docbook stylesheets of a particular revision. # # This macro can be used for multiple versions within the same script. # # Input: # $1 is the version of docbook to search for; default 'current' # Output: # $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending # on the results of the test, where VERS is $1, with '_' substituted # for '.' $HAVE_DOCBOOK_XSLT will also be set to the same value. # # Example: # AC_CHECK_DOCBOOK_XSLT(1.72.0) # if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xyes"; then # .. # # LAST MODIFICATION # # 2007-06-28 # # AUTHOR # # Dustin J. Mitchell # # COPYRIGHT # # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro 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. # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_XSLT], [ AC_REQUIRE([AC_PROG_XSLTPROC]) dnl define a temporary variable for the version, so this macro can be dnl used with multiple versions define([_VERS], $1) ifelse(_VERS, [], [define([_VERS], [current])]) dnl define variable names ending in _VERS which will actually have the dnl version number as a suffix define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_])) define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_])) AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS], [ ac_cv_docbook_xslt_VERS=no if test -n "$XSLTPROC"; then echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD if test "$?" = 0; then ac_cv_docbook_xslt_VERS=yes fi fi ]) HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS" HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_VERS" dnl clean up m4 namespace undefine([_VERS]) undefine([ac_cv_docbook_xslt_VERS]) undefine([HAVE_DOCBOOK_XSLT_VERS]) ]) amanda-3.3.6/config/macro-archive/docbook-dtd.m40000664000076400007640000000750112357250006023063 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_check_docbook_dtd.html # # SYNOPSIS # # AC_CHECK_DOCBOOK_DTD([dtd-version]) # # DESCRIPTION # # Check for access to a docbook DTD of a particular revision. # # This macro can be used for multiple versions within the same script. # # Input: # $1 is the version of docbook to search for; default 'current' # Output: # $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending # on the results of the test, where VERS is $1, with '_' substituted # for '.' $HAVE_DOCBOOK_DTD will also be set to the same value. # # Example: # AC_CHECK_DOCBOOK_DTD(4.3) # if test "x$HAVE_DOCBOOK_DTD_4_3" = "xyes"; then # .. # # LAST MODIFICATION # # 2007-06-28 # # AUTHOR # # Dustin J. Mitchell # # COPYRIGHT # # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro 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. # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_DTD], [ AC_REQUIRE([AC_PROG_XSLTPROC]) dnl define a temporary variable for the version, so this macro can be dnl used with multiple versions define([_VERS], $1) ifelse(_VERS, [], [define([_VERS], [current])]) dnl define variable names ending in _VERS which will actually have the dnl version number as a suffix define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_])) define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_])) AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS], [ ac_cv_docbook_dtd_VERS=no if test -n "$XSLTPROC"; then MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g` cat <conftest.xml EOF echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD echo "conftest.xml:" >&AS_MESSAGE_LOG_FD echo "====" >&AS_MESSAGE_LOG_FD cat conftest.xml >&AS_MESSAGE_LOG_FD echo "====" >&AS_MESSAGE_LOG_FD $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1 if test "$?" = 0 -o "$?" = 5; then # failing to load the DTD is just a warning, so check for it in the output. if grep 'warning: failed to load external entity' conftest.out >/dev/null 2>&1; then : # no good.. else ac_cv_docbook_dtd_VERS=yes fi fi cat conftest.out >&AS_MESSAGE_LOG_FD rm -f conftest.xml conftest.out fi ]) HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS" HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_VERS" dnl clean up m4 namespace undefine([_VERS]) undefine([ac_cv_docbook_dtd_VERS]) undefine([HAVE_DOCBOOK_DTD_VERS]) ]) amanda-3.3.6/config/macro-archive/file-list0000664000076400007640000000072712357750226022257 0ustar00martineamartinea00000000000000## this file is automatically generated by autogen EXTRA_DIST += macro-archive/ac_define_dir.m4 EXTRA_DIST += macro-archive/ac_perl_module_version.m4 EXTRA_DIST += macro-archive/ac_prog_perl_version.m4 EXTRA_DIST += macro-archive/ac_prog_swig.m4 EXTRA_DIST += macro-archive/ax_compare_version.m4 EXTRA_DIST += macro-archive/docbook-dtd.m4 EXTRA_DIST += macro-archive/docbook-xslt.m4 EXTRA_DIST += macro-archive/docbook-xslt-min.m4 EXTRA_DIST += macro-archive/xsltproc.m4 amanda-3.3.6/config/macro-archive/docbook-xslt-min.m40000664000076400007640000000702212357250006024061 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_check_docbook_xslt_min.html # # SYNOPSIS # # AC_CHECK_DOCBOOK_XSLT_MIN(min-xslt-version) # # DESCRIPTION # # Check that the 'current' version of docbook is at least version # min-xslt-version. # # If the test is successful, $DOCBOOK_XSLT_CURRENT_VERSION will be set to the # current docbook version; if not, it will be set to 'no'. # # Example: # AC_CHECK_DOCBOOK_XSLT_MIN(1.72.0) # if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then # .. # # LAST MODIFICATION # # 2007-06-28 # # AUTHOR # # Dustin J. Mitchell # # COPYRIGHT # # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro 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. # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN], [ AC_REQUIRE([AC_PROG_XSLTPROC]) AC_CACHE_CHECK([for current Docbook XSLT version], [ac_cv_docbook_xslt_current_version], [ ac_cv_docbook_xslt_current_version=no if test -n "$XSLTPROC"; then cat >conftest.xsl < EOF echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&AS_MESSAGE_LOG_FD echo "====" >&AS_MESSAGE_LOG_FD cat conftest.xsl >&AS_MESSAGE_LOG_FD echo "====" >&AS_MESSAGE_LOG_FD ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&AS_MESSAGE_LOG_FD` if test "$?" != 0; then ac_cv_docbook_xslt_current_version='no' fi rm conftest.xsl fi ]) DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version" AC_MSG_CHECKING([whether Docbook XSLT version is $1 or newer]) if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then AC_MSG_RESULT([no]) else AX_COMPARE_VERSION([$DOCBOOK_XSLT_CURRENT_VERSION], [lt], [$1], [ # version is less than required, so mark it as "no" DOCBOOK_XSLT_CURRENT_VERSION=no ]) if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes ($DOCBOOK_XSLT_CURRENT_VERSION)]) fi fi ]) amanda-3.3.6/config/macro-archive/ax_compare_version.m40000664000076400007640000001715112357250006024557 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ax_compare_version.html # # SYNOPSIS # # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # This macro compares two version strings. It is used heavily in the # macro _AX_PATH_BDB for library checking. Due to the various number # of minor-version numbers that can exist, and the fact that string # comparisons are not compatible with numeric comparisons, this is # not necessarily trivial to do in a autoconf script. This macro # makes doing these comparisons easy. # # The six basic comparisons are available, as well as checking # equality limited to a certain number of minor-version levels. # # The operator OP determines what type of comparison to do, and can # be one of: # # eq - equal (test A == B) # ne - not equal (test A != B) # le - less than or equal (test A <= B) # ge - greater than or equal (test A >= B) # lt - less than (test A < B) # gt - greater than (test A > B) # # Additionally, the eq and ne operator can have a number after it to # limit the test to that number of minor versions. # # eq0 - equal up to the length of the shorter version # ne0 - not equal up to the length of the shorter version # eqN - equal up to N sub-version levels # neN - not equal up to N sub-version levels # # When the condition is true, shell commands ACTION-IF-TRUE are run, # otherwise shell commands ACTION-IF-FALSE are run. The environment # variable 'ax_compare_version' is always set to either 'true' or # 'false' as well. # # Examples: # # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) # AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) # # would both be true. # # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) # AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) # # would both be false. # # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) # # would be true because it is only comparing two minor versions. # # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) # # would be true because it is only comparing the lesser number of # minor versions of the two values. # # Note: The characters that separate the version numbers do not # matter. An empty string is the same as version 0. OP is evaluated # by autoconf, not configure, so must be a string, not a variable. # # The author would like to acknowledge Guido Draheim whose advice # about the m4_case and m4_ifvaln functions make this macro only # include the portions necessary to perform the specific comparison # specified by the OP argument in the final configure script. # # LAST MODIFICATION # # 2004-03-01 # # COPYLEFT # # Copyright (c) 2004 Tim Toolan # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, 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 Macro 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. dnl ######################################################################### AC_DEFUN([AX_COMPARE_VERSION], [ # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. AS_VAR_PUSHDEF([A],[ax_compare_version_A]) A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` AS_VAR_PUSHDEF([B],[ax_compare_version_B]) B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary dnl # then the first line is used to determine if the condition is true. dnl # The sed right after the echo is to remove any indented white space. m4_case(m4_tolower($2), [lt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [gt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [le],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` ], [ge],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` ],[ dnl Split the operator from the subversion count if present. m4_bmatch(m4_substr($2,2), [0],[ # A count of zero means use the length of the shorter version. # Determine the number of characters in A and B. ax_compare_version_len_A=`echo "$A" | awk '{print(length)}'` ax_compare_version_len_B=`echo "$B" | awk '{print(length)}'` # Set A to no more than B's length and B to no more than A's length. A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` ], [[0-9]+],[ # A count greater than zero means use only that many subversions A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` ], [.+],[ AC_WARNING( [illegal OP numeric parameter: $2]) ],[]) # Pad zeros at end of numbers to make same length. ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" B="$B`echo $A | sed 's/./0/g'`" A="$ax_compare_version_tmp_A" # Check for equality or inequality as necessary. m4_case(m4_tolower(m4_substr($2,0,2)), [eq],[ test "x$A" = "x$B" && ax_compare_version=true ], [ne],[ test "x$A" != "x$B" && ax_compare_version=true ],[ AC_WARNING([illegal OP parameter: $2]) ]) ]) AS_VAR_POPDEF([A])dnl AS_VAR_POPDEF([B])dnl dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. if test "$ax_compare_version" = "true" ; then m4_ifvaln([$4],[$4],[:])dnl m4_ifvaln([$5],[else $5])dnl fi ]) dnl AX_COMPARE_VERSION amanda-3.3.6/config/macro-archive/ac_define_dir.m40000664000076400007640000000267412357250006023433 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_define_dir.html # # SYNOPSIS # # AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) # # DESCRIPTION # # This macro sets VARNAME to the expansion of the DIR variable, # taking care of fixing up ${prefix} and such. # # VARNAME is then offered as both an output variable and a C # preprocessor symbol. # # Example: # # AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) # # LAST MODIFICATION # # 2006-10-13 # # COPYLEFT # # Copyright (c) 2006 Stepan Kasal # Copyright (c) 2006 Andreas Schwab # Copyright (c) 2006 Guido U. Draheim # Copyright (c) 2006 Alexandre Oliva # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided # the copyright notice and this notice are preserved. AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"$ac_define_dir\"" AC_SUBST($1, "$ac_define_dir") AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) amanda-3.3.6/config/macro-archive/xsltproc.m40000664000076400007640000000570212357250006022551 0ustar00martineamartinea00000000000000##### http://autoconf-archive.cryp.to/ac_prog_xsltproc.html # # SYNOPSIS # # AC_PROG_XSLTPROC([default-flags]) # # DESCRIPTION # # Finds an xsltproc executable. # # Input: # default-flags is the default $XSLTPROC_FLAGS, which will be # overridden if the user specifies --with-xsltproc-flags. # # Output: # $XSLTPROC contains the path to xsltproc, or is empty if none was # found or the user specified --without-xsltproc. $XSLTPROC_FLAGS # contains the flags to use with xsltproc. # # LAST MODIFICATION # # 2007-04-17 # # AUTHOR # # Dustin J. Mitchell # # COPYRIGHT # # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro 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. # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_PROG_XSLTPROC], [ XSLTPROC_FLAGS="$1" AC_SUBST(XSLTPROC_FLAGS) # The (lack of) whitespace and overquoting here are all necessary for # proper formatting. AC_ARG_WITH(xsltproc, AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]], [Use the xsltproc binary in in PATH.]), [ ac_with_xsltproc=$withval; ], [ ac_with_xsltproc=maybe; ]) AC_ARG_WITH(xsltproc-flags, AS_HELP_STRING([ --with-xsltproc-flags=FLAGS], [Flags to pass to xsltproc (default $1)]), [ if test "x$withval" == "xno"; then XSLTPROC_FLAGS='' else if test "x$withval" != "xyes"; then XSLTPROC_FLAGS="$withval" fi fi ]) # search for xsltproc if it wasn't specified if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH) else if test "$ac_with_xsltproc" != "no"; then if test -x "$ac_with_xsltproc"; then XSLTPROC="$ac_with_xsltproc"; else AMANDA_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative.]) AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH) fi fi fi ]) amanda-3.3.6/config/macro-archive/ac_perl_module_version.m40000664000076400007640000000447412357250006025417 0ustar00martineamartinea00000000000000# =========================================================================== # http://autoconf-archive.cryp.to/ac_perl_module_version.html # =========================================================================== # # SYNOPSIS # # AC_PERL_MODULE_VERSION([MODULE VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # Checks to see if the list of 'Module Version' are avaiable in the # system. If all the modules in the list are avaiable ACTION-IF-TRUE is # executed. Case one module is not avaiable ACTION-IF-FALSE is executed # and the macro execution is aborted. NOTE: Perl is needed. # # Example: # # AC_PERL_MODULE_VERSION(CGI::Test 0.104 CGI::Ajax 0.694, , # AC_MSG_ERROR(Need some Perl modules)) # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Marco Gomes # Copyright (c) 2008 Ruben Fonseca # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AC_PERL_MODULE_VERSION],[dnl ac_perl_list_modules="$1" # Make sure we have perl if test -z "$PERL"; then AC_CHECK_PROG(PERL,perl,perl) fi # Check the number of arguments args_num=`echo $ac_perl_list_modules | wc -w` let "ckeck_args = $args_num % 2" if test "$check_args" = "1" ; then AC_MSG_ERROR(syntax error) else eval fi if test "x$PERL" != x; then ac_failed=0 while test ${#ac_perl_list_modules} -gt 2 ; do module_name=`echo $ac_perl_list_modules | cut -d " " -f 1` module_version=`echo $ac_perl_list_modules | cut -d " " -f 2` ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-` AC_MSG_CHECKING(for perl module $module_name version $module_version) $PERL "-M$module_name" -e exit > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_RESULT(no); ac_failed=1 ac_perl_list_modules="" else version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1` $PERL -e 'exit(shift cmp shift)' "$version" "$module_version" if test $? -eq 0 -o $? -eq 1 ; then AC_MSG_RESULT(ok); else AC_MSG_RESULT(no) ac_failed=1 ac_perl_list_modules="" fi fi; done if test "$ac_failed" = 0; then : $2 else : $3 fi else AC_MSG_ERROR(could not find perl) fi])dnl amanda-3.3.6/config/ylwrap0000775000076400007640000001407412357250007017160 0ustar00martineamartinea00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2007-11-22.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/gnulib/0000775000076400007640000000000012357750426017200 5ustar00martineamartinea00000000000000amanda-3.3.6/config/gnulib/sockpfaf.m40000664000076400007640000000522612357250007021231 0ustar00martineamartinea00000000000000# sockpfaf.m4 serial 8 dnl Copyright (C) 2004, 2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...) dnl and some common address families (AF_INET, AF_INET6, ...). dnl This test assumes that a system supports an address family if and only if dnl it supports the corresponding protocol family. dnl From Bruno Haible. AC_DEFUN([gl_SOCKET_FAMILIES], [ AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) AC_MSG_CHECKING([for IPv4 sockets]) AC_CACHE_VAL([gl_cv_socket_ipv4], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif]], [[int x = AF_INET; struct in_addr y; struct sockaddr_in z; if (&x && &y && &z) return 0;]])], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) AC_MSG_RESULT([$gl_cv_socket_ipv4]) if test $gl_cv_socket_ipv4 = yes; then AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if defines AF_INET.]) fi AC_MSG_CHECKING([for IPv6 sockets]) AC_CACHE_VAL([gl_cv_socket_ipv6], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif]], [[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; if (&x && &y && &z) return 0;]])], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) AC_MSG_RESULT([$gl_cv_socket_ipv6]) if test $gl_cv_socket_ipv6 = yes; then AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if defines AF_INET6.]) fi ]) AC_DEFUN([gl_SOCKET_FAMILY_UNIX], [ AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([sys/un.h]) AC_MSG_CHECKING([for UNIX domain sockets]) AC_CACHE_VAL([gl_cv_socket_unix], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif]], [[int x = AF_UNIX; struct sockaddr_un y; if (&x && &y) return 0;]])], gl_cv_socket_unix=yes, gl_cv_socket_unix=no)]) AC_MSG_RESULT([$gl_cv_socket_unix]) if test $gl_cv_socket_unix = yes; then AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if defines AF_UNIX.]) fi ]) amanda-3.3.6/config/gnulib/netdb_h.m40000664000076400007640000000304112357250007021031 0ustar00martineamartinea00000000000000# netdb_h.m4 serial 11 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_HEADER_NETDB], [ AC_REQUIRE([gl_NETDB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([netdb.h]) if test $ac_cv_header_netdb_h = yes; then HAVE_NETDB_H=1 else HAVE_NETDB_H=0 fi AC_SUBST([HAVE_NETDB_H]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [getaddrinfo freeaddrinfo gai_strerror getnameinfo]) ]) AC_DEFUN([gl_NETDB_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_NETDB_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_NETDB_H_DEFAULTS], [ GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO]) HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO]) HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR]) HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO]) HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO]) REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR]) ]) amanda-3.3.6/config/gnulib/lib-prefix.m40000664000076400007640000002042212357250007021471 0ustar00martineamartinea00000000000000# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) amanda-3.3.6/config/gnulib/stdio_h.m40000664000076400007640000002243312357250007021065 0ustar00martineamartinea00000000000000# stdio_h.m4 serial 43 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDIO_H], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. GNULIB_FSCANF=1 gl_MODULE_INDICATOR([fscanf]) GNULIB_SCANF=1 gl_MODULE_INDICATOR([scanf]) GNULIB_FGETC=1 GNULIB_GETC=1 GNULIB_GETCHAR=1 GNULIB_FGETS=1 GNULIB_FREAD=1 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is dnl also an optimization, to avoid performing a configure check whose result dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING dnl or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_READ_FUNCS=1 AC_LIBOBJ([stdio-read]) fi ]) dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. GNULIB_FPRINTF=1 GNULIB_PRINTF=1 GNULIB_VFPRINTF=1 GNULIB_VPRINTF=1 GNULIB_FPUTC=1 GNULIB_PUTC=1 GNULIB_PUTCHAR=1 GNULIB_FPUTS=1 GNULIB_PUTS=1 GNULIB_FWRITE=1 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is dnl also an optimization, to avoid performing a configure check whose result dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or dnl GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_STDIO_WRITE_FUNCS=1 AC_LIBOBJ([stdio-write]) fi ]) dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is dnl also an optimization, to avoid performing a configure check whose result dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING dnl or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_WRITE_FUNCS=1 AC_LIBOBJ([stdio-write]) fi ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by both C89 and C11. gl_WARN_ON_USE_PREPARE([[#include ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf]) ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_STDIO_H_DEFAULTS], [ GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN]) GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE]) HAVE_POPEN=1; AC_SUBST([HAVE_POPEN]) HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN]) REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE]) REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME]) REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) ]) amanda-3.3.6/config/gnulib/math_h.m40000664000076400007640000004211112357250007020667 0ustar00martineamartinea00000000000000# math_h.m4 serial 114 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_MATH_H], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([math.h]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], [[/* Solaris 10 has a broken definition of NAN. Other platforms fail to provide NAN, or provide it only in C99 mode; this test only needs to fail when NAN is provided but wrong. */ float f = 1.0f; #ifdef NAN f = NAN; #endif return f == 0;]])], [gl_cv_header_math_nan_works=yes], [gl_cv_header_math_nan_works=no])]) if test $gl_cv_header_math_nan_works = no; then REPLACE_NAN=1 fi AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], [[/* Solaris 10 has a broken definition of HUGE_VAL. */ double d = HUGE_VAL; return d == 0;]])], [gl_cv_header_math_huge_val_works=yes], [gl_cv_header_math_huge_val_works=no])]) if test $gl_cv_header_math_huge_val_works = no; then REPLACE_HUGE_VAL=1 fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [acosf acosl asinf asinl atanf atanl cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf expf expl exp2 exp2f exp2l expm1 expm1f expm1l fabsf fabsl floorf floorl fma fmaf fmal fmod fmodf fmodl frexpf frexpl hypotf hypotl ilogb ilogbf ilogbl ldexpf ldexpl log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l logb logbf logbl modf modff modfl powf remainder remainderf remainderl rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl tanf tanl tanhf trunc truncf truncl]) ]) AC_DEFUN([gl_MATH_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_MATH_H_DEFAULTS], [ GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF]) GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL]) GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF]) GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL]) GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF]) GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL]) GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F]) GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT]) GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF]) GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL]) GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL]) GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN]) GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF]) GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL]) GNULIB_COSF=0; AC_SUBST([GNULIB_COSF]) GNULIB_COSL=0; AC_SUBST([GNULIB_COSL]) GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF]) GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF]) GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL]) GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2]) GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F]) GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L]) GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1]) GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F]) GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L]) GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF]) GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL]) GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR]) GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) GNULIB_FMA=0; AC_SUBST([GNULIB_FMA]) GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF]) GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL]) GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD]) GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF]) GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL]) GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF]) GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT]) GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF]) GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL]) GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB]) GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF]) GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL]) GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF]) GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) GNULIB_LOG=0; AC_SUBST([GNULIB_LOG]) GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF]) GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL]) GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10]) GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F]) GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L]) GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P]) GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF]) GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL]) GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2]) GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F]) GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L]) GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB]) GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF]) GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL]) GNULIB_MODF=0; AC_SUBST([GNULIB_MODF]) GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF]) GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL]) GNULIB_POWF=0; AC_SUBST([GNULIB_POWF]) GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER]) GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF]) GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL]) GNULIB_RINT=0; AC_SUBST([GNULIB_RINT]) GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF]) GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL]) GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF]) GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL]) GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT]) GNULIB_SINF=0; AC_SUBST([GNULIB_SINF]) GNULIB_SINL=0; AC_SUBST([GNULIB_SINL]) GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF]) GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF]) GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL]) GNULIB_TANF=0; AC_SUBST([GNULIB_TANF]) GNULIB_TANL=0; AC_SUBST([GNULIB_TANL]) GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF]) GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) HAVE_COSF=1; AC_SUBST([HAVE_COSF]) HAVE_COSL=1; AC_SUBST([HAVE_COSL]) HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) HAVE_FMA=1; AC_SUBST([HAVE_FMA]) HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) HAVE_POWF=1; AC_SUBST([HAVE_POWF]) HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) HAVE_RINT=1; AC_SUBST([HAVE_RINT]) HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) HAVE_SINF=1; AC_SUBST([HAVE_SINF]) HAVE_SINL=1; AC_SUBST([HAVE_SINL]) HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) HAVE_TANF=1; AC_SUBST([HAVE_TANF]) HAVE_TANL=1; AC_SUBST([HAVE_TANL]) HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) ]) # gl_LONG_DOUBLE_VS_DOUBLE # determines whether 'long double' and 'double' have the same representation. # Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines # HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly. # The currently known platforms where this is the case are: # Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9. AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE], [ AC_CACHE_CHECK([whether long double and double are the same], [gl_cv_long_double_equals_double], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[typedef int check[sizeof (long double) == sizeof (double) && LDBL_MANT_DIG == DBL_MANT_DIG && LDBL_MAX_EXP == DBL_MAX_EXP && LDBL_MIN_EXP == DBL_MIN_EXP ? 1 : -1]; ]])], [gl_cv_long_double_equals_double=yes], [gl_cv_long_double_equals_double=no]) ]) if test $gl_cv_long_double_equals_double = yes; then AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1], [Define to 1 if 'long double' and 'double' have the same representation.]) HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 else HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 fi AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]) ]) amanda-3.3.6/config/gnulib/ftello.m40000664000076400007640000000732712357250007020726 0ustar00martineamartinea00000000000000# ftello.m4 serial 11 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FTELLO], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_STDIN_LARGE_OFFSET]) AC_REQUIRE([gl_SYS_TYPES_H]) dnl Persuade glibc to declare ftello(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CHECK_DECLS_ONCE([ftello]) if test $ac_cv_have_decl_ftello = no; then HAVE_DECL_FTELLO=0 fi AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[ftello (stdin);]])], [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no]) ]) if test $gl_cv_func_ftello = no; then HAVE_FTELLO=0 else if test $WINDOWS_64_BIT_OFF_T = 1; then REPLACE_FTELLO=1 fi if test $gl_cv_var_stdin_large_offset = no; then REPLACE_FTELLO=1 fi if test $REPLACE_FTELLO = 0; then dnl Detect bug on Solaris. dnl ftell and ftello produce incorrect results after putc that followed a dnl getc call that reached EOF on Solaris. This is because the _IOREAD dnl flag does not get cleared in this case, even though _IOWRT gets set, dnl and ftell and ftello look whether the _IOREAD flag is set. AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether ftello works], [gl_cv_func_ftello_works], [ dnl Initial guess, used when cross-compiling or when /dev/tty cannot dnl be opened. changequote(,)dnl case "$host_os" in # Guess no on Solaris. solaris*) gl_cv_func_ftello_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_ftello_works="guessing yes" ;; esac changequote([,])dnl AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #define TESTFILE "conftest.tmp" int main (void) { FILE *fp; /* Create a file with some contents. */ fp = fopen (TESTFILE, "w"); if (fp == NULL) return 70; if (fwrite ("foogarsh", 1, 8, fp) < 8) return 71; if (fclose (fp)) return 72; /* The file's contents is now "foogarsh". */ /* Try writing after reading to EOF. */ fp = fopen (TESTFILE, "r+"); if (fp == NULL) return 73; if (fseek (fp, -1, SEEK_END)) return 74; if (!(getc (fp) == 'h')) return 1; if (!(getc (fp) == EOF)) return 2; if (!(ftell (fp) == 8)) return 3; if (!(ftell (fp) == 8)) return 4; if (!(putc ('!', fp) == '!')) return 5; if (!(ftell (fp) == 9)) return 6; if (!(fclose (fp) == 0)) return 7; fp = fopen (TESTFILE, "r"); if (fp == NULL) return 75; { char buf[10]; if (!(fread (buf, 1, 10, fp) == 9)) return 10; if (!(memcmp (buf, "foogarsh!", 9) == 0)) return 11; } if (!(fclose (fp) == 0)) return 12; /* The file's contents is now "foogarsh!". */ return 0; }]])], [gl_cv_func_ftello_works=yes], [gl_cv_func_ftello_works=no], [:]) ]) case "$gl_cv_func_ftello_works" in *yes) ;; *) REPLACE_FTELLO=1 AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1], [Define to 1 if the system's ftello function has the Solaris bug.]) ;; esac fi fi ]) # Prerequisites of lib/ftello.c. AC_DEFUN([gl_PREREQ_FTELLO], [ dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64 dnl makes it usable again. AC_CHECK_FUNCS([_ftelli64]) ]) amanda-3.3.6/config/gnulib/malloc.m40000664000076400007640000000627612357250007020712 0ustar00martineamartinea00000000000000# malloc.m4 serial 14 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ # This is taken from the following Autoconf patch: # http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles AC_CHECK_HEADERS([stdlib.h]) AC_CACHE_CHECK([for GNU libc compatible malloc], [ac_cv_func_malloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif ]], [[return ! malloc (0);]]) ], [ac_cv_func_malloc_0_nonnull=yes], [ac_cv_func_malloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_malloc_0_nonnull=no ;; esac ]) ]) AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2]) ])# _AC_FUNC_MALLOC_IF ]) # gl_FUNC_MALLOC_GNU # ------------------ # Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if # it is not. AC_DEFUN([gl_FUNC_MALLOC_GNU], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) dnl _AC_FUNC_MALLOC_IF is defined in Autoconf. _AC_FUNC_MALLOC_IF( [AC_DEFINE([HAVE_MALLOC_GNU], [1], [Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise.])], [AC_DEFINE([HAVE_MALLOC_GNU], [0]) REPLACE_MALLOC=1 ]) ]) # gl_FUNC_MALLOC_POSIX # -------------------- # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it # fails), and replace malloc if it is not. AC_DEFUN([gl_FUNC_MALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else REPLACE_MALLOC=1 fi ]) # Test whether malloc, realloc, calloc are POSIX compliant, # Set gl_cv_func_malloc_posix to yes or no accordingly. AC_DEFUN([gl_CHECK_MALLOC_POSIX], [ AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant], [gl_cv_func_malloc_posix], [ dnl It is too dangerous to try to allocate a large amount of memory: dnl some systems go to their knees when you do that. So assume that dnl all Unix implementations of the function are POSIX compliant. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[]], [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ choke me #endif ]])], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no]) ]) ]) amanda-3.3.6/config/gnulib/vasnprintf.m40000664000076400007640000002113312357250007021622 0ustar00martineamartinea00000000000000# vasnprintf.m4 serial 36 dnl Copyright (C) 2002-2004, 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_CHECK_FUNCS_ONCE([vasnprintf]) if test $ac_cv_func_vasnprintf = no; then gl_REPLACE_VASNPRINTF fi ]) AC_DEFUN([gl_REPLACE_VASNPRINTF], [ AC_CHECK_FUNCS_ONCE([vasnprintf]) AC_LIBOBJ([vasnprintf]) AC_LIBOBJ([printf-args]) AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS gl_PREREQ_PRINTF_PARSE gl_PREREQ_VASNPRINTF gl_PREREQ_ASNPRINTF ]) # Prerequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) ]) # Prerequisites of lib/printf-parse.h, lib/printf-parse.c. AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([gl_FEATURES_H]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) ]) # Prerequisites of lib/vasnprintf.c. AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [[#include ]]) dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) dnl We can avoid a lot of code by assuming that snprintf's return value dnl conforms to ISO C99. So check that. AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) case "$gl_cv_func_snprintf_retval_c99" in *yes) AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], [Define if the return value of the snprintf function is the number of of bytes (excluding the terminating NUL) that would have been produced if the buffer had been large enough.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting 'long double' # arguments. AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) case "$gl_cv_func_printf_long_double" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double' # arguments. AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], [ AC_REQUIRE([gl_PRINTF_INFINITE]) case "$gl_cv_func_printf_infinite" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double' # arguments. AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if dnl NEED_PRINTF_LONG_DOUBLE is already set. AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) case "$gl_cv_func_printf_long_double" in *yes) case "$gl_cv_func_printf_infinite_long_double" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; esac ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) case "$gl_cv_func_printf_directive_a" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], [Define if the vasnprintf implementation needs special code for the 'a' and 'A' directives.]) AC_CHECK_FUNCS([nl_langinfo]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) case "$gl_cv_func_printf_directive_f" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], [Define if the vasnprintf implementation needs special code for the 'F' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) case "$gl_cv_func_printf_directive_ls" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], [Define if the vasnprintf implementation needs special code for the 'ls' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], [ AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) case "$gl_cv_func_printf_flag_grouping" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], [ AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) case "$gl_cv_func_printf_flag_leftadjust" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], [ AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) case "$gl_cv_func_printf_flag_zero" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting large precisions. AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], [ AC_REQUIRE([gl_PRINTF_PRECISION]) case "$gl_cv_func_printf_precision" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory # conditions. AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], [ AC_REQUIRE([gl_PRINTF_ENOMEM]) case "$gl_cv_func_printf_enomem" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], [ AC_REQUIRE([gl_PREREQ_VASNPRINTF]) gl_PREREQ_VASNPRINTF_LONG_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO gl_PREREQ_VASNPRINTF_PRECISION gl_PREREQ_VASNPRINTF_ENOMEM ]) # Prerequisites of lib/asnprintf.c. AC_DEFUN([gl_PREREQ_ASNPRINTF], [ ]) amanda-3.3.6/config/gnulib/fstat.m40000664000076400007640000000164612357250007020560 0ustar00martineamartinea00000000000000# fstat.m4 serial 4 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FSTAT], [ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then REPLACE_FSTAT=1 fi AC_REQUIRE([gl_HEADER_SYS_STAT_H]) if test $WINDOWS_64_BIT_ST_SIZE = 1; then REPLACE_FSTAT=1 fi dnl Replace fstat() for supporting the gnulib-defined open() on directories. m4_ifdef([gl_FUNC_FCHDIR], [ gl_TEST_FCHDIR if test $HAVE_FCHDIR = 0; then case "$gl_cv_func_open_directory_works" in *yes) ;; *) REPLACE_FSTAT=1 ;; esac fi ]) ]) # Prerequisites of lib/fstat.c. AC_DEFUN([gl_PREREQ_FSTAT], [:]) amanda-3.3.6/config/gnulib/wchar_h.m40000664000076400007640000002224012357250007021043 0ustar00martineamartinea00000000000000dnl A placeholder for ISO C99 , for platforms that have issues. dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. # wchar_h.m4 serial 39 AC_DEFUN([gl_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) dnl Prepare for creating substitute . dnl Check for (missing in Linux uClibc when built without wide dnl character support). dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) AC_REQUIRE([gl_FEATURES_H]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include # include # include #endif #include ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth ]) ]) dnl Check whether is usable at all. AC_DEFUN([gl_WCHAR_H_INLINE_OK], [ dnl Test whether suffers due to the transition from '__inline' to dnl 'gnu_inline'. See dnl and . In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken . AC_CACHE_CHECK([whether uses 'inline' correctly], [gl_cv_header_wchar_h_correct_inline], [gl_cv_header_wchar_h_correct_inline=yes AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include extern int zero (void); int main () { return zero(); } ]])]) if AC_TRY_EVAL([ac_compile]); then mv conftest.$ac_objext conftest1.$ac_objext AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int zero (void) { return 0; } ]])]) if AC_TRY_EVAL([ac_compile]); then mv conftest.$ac_objext conftest2.$ac_objext if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then : else gl_cv_header_wchar_h_correct_inline=no fi fi fi rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext ]) if test $gl_cv_header_wchar_h_correct_inline = no; then AC_MSG_ERROR([ cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in C99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of , or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99. Configuration aborted.]) fi ]) AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS]) REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) ]) amanda-3.3.6/config/gnulib/codeset.m40000664000076400007640000000150012357250007021052 0ustar00martineamartinea00000000000000# codeset.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char* cs = nl_langinfo(CODESET); return !cs;]])], [am_cv_langinfo_codeset=yes], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) amanda-3.3.6/config/gnulib/fseeko.m40000664000076400007640000000435512357250007020713 0ustar00martineamartinea00000000000000# fseeko.m4 serial 16 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FSEEKO], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_STDIN_LARGE_OFFSET]) AC_REQUIRE([gl_SYS_TYPES_H]) AC_REQUIRE([AC_PROG_CC]) dnl Persuade glibc to declare fseeko(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [fseeko (stdin, 0, 0);])], [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no]) ]) AC_CHECK_DECLS_ONCE([fseeko]) if test $ac_cv_have_decl_fseeko = no; then HAVE_DECL_FSEEKO=0 fi if test $gl_cv_func_fseeko = no; then HAVE_FSEEKO=0 else if test $WINDOWS_64_BIT_OFF_T = 1; then REPLACE_FSEEKO=1 fi if test $gl_cv_var_stdin_large_offset = no; then REPLACE_FSEEKO=1 fi m4_ifdef([gl_FUNC_FFLUSH_STDIN], [ gl_FUNC_FFLUSH_STDIN if test $gl_cv_func_fflush_stdin = no; then REPLACE_FSEEKO=1 fi ]) fi ]) dnl Code shared by fseeko and ftello. Determine if large files are supported, dnl but stdin does not start as a large file by default. AC_DEFUN([gl_STDIN_LARGE_OFFSET], [ AC_CACHE_CHECK([whether stdin defaults to large file offsets], [gl_cv_var_stdin_large_offset], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if defined __SL64 && defined __SCLE /* cygwin */ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and it is easier to do a version check than building a runtime test. */ # include # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) choke me # endif #endif]])], [gl_cv_var_stdin_large_offset=yes], [gl_cv_var_stdin_large_offset=no])]) ]) # Prerequisites of lib/fseeko.c. AC_DEFUN([gl_PREREQ_FSEEKO], [ dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64 dnl makes it usable again. AC_CHECK_FUNCS([_fseeki64]) ]) amanda-3.3.6/config/gnulib/tempname.m40000664000076400007640000000103212357250007021232 0ustar00martineamartinea00000000000000#serial 5 # Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose # it as a public API, and provide it on systems that are lacking. AC_DEFUN([gl_FUNC_GEN_TEMPNAME], [ gl_PREREQ_TEMPNAME ]) # Prerequisites of lib/tempname.c. AC_DEFUN([gl_PREREQ_TEMPNAME], [ : ]) amanda-3.3.6/config/gnulib/configmake.m40000664000076400007640000000354012357250007021535 0ustar00martineamartinea00000000000000# configmake.m4 serial 1 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # gl_CONFIGMAKE_PREP # ------------------ # Guarantee all of the standard directory variables, even when used with # autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake # 1.9.6 (pkglibexecdir wasn't supported until 1.10b.). AC_DEFUN([gl_CONFIGMAKE_PREP], [ dnl Technically, datadir should default to datarootdir. But if dnl autoconf is too old to provide datarootdir, then reversing the dnl definition is a reasonable compromise. Only AC_SUBST a variable dnl if it was not already defined earlier by autoconf. if test "x$datarootdir" = x; then AC_SUBST([datarootdir], ['${datadir}']) fi dnl Copy the approach used in autoconf 2.60. if test "x$docdir" = x; then AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) fi dnl The remaining variables missing from autoconf 2.59 are easier. if test "x$htmldir" = x; then AC_SUBST([htmldir], ['${docdir}']) fi if test "x$dvidir" = x; then AC_SUBST([dvidir], ['${docdir}']) fi if test "x$pdfdir" = x; then AC_SUBST([pdfdir], ['${docdir}']) fi if test "x$psdir" = x; then AC_SUBST([psdir], ['${docdir}']) fi if test "x$lispdir" = x; then AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) fi if test "x$localedir" = x; then AC_SUBST([localedir], ['${datarootdir}/locale']) fi dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) ]) amanda-3.3.6/config/gnulib/alloca.m40000664000076400007640000001037212357250007020666 0ustar00martineamartinea00000000000000# alloca.m4 serial 14 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_ALLOCA], [ AC_REQUIRE([AC_FUNC_ALLOCA]) if test $ac_cv_func_alloca_works = no; then gl_PREREQ_ALLOCA fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ AC_EGREP_CPP([Need own alloca], [ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h else dnl alloca exists as a library function, i.e. it is slow and probably dnl a memory leak. Don't define HAVE_ALLOCA in this case. ALLOCA_H= fi else ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) ]) # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) # This works around a bug in autoconf <= 2.68. # See . m4_version_prereq([2.69], [] ,[ # This is taken from the following Autoconf patch: # http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 # _AC_LIBOBJ_ALLOCA # ----------------- # Set up the LIBOBJ replacement of 'alloca'. Well, not exactly # AC_LIBOBJ since we actually set the output variable 'ALLOCA'. # Nevertheless, for Automake, AC_LIBSOURCES it. m4_define([_AC_LIBOBJ_ALLOCA], [# The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. AC_LIBSOURCES(alloca.c) AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray, [AC_EGREP_CPP(webecray, [#if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif ], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, [Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems.]) break]) done fi AC_CACHE_CHECK([stack direction for C alloca], [ac_cv_c_stack_direction], [AC_RUN_IFELSE([AC_LANG_SOURCE( [AC_INCLUDES_DEFAULT int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; }])], [ac_cv_c_stack_direction=1], [ac_cv_c_stack_direction=-1], [ac_cv_c_stack_direction=0])]) AH_VERBATIM([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ @%:@undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) ])# _AC_LIBOBJ_ALLOCA ]) amanda-3.3.6/config/gnulib/00gnulib.m40000664000076400007640000000252212357250007021051 0ustar00martineamartinea00000000000000# 00gnulib.m4 serial 2 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file must be named something that sorts before all other dnl gnulib-provided .m4 files. It is needed until such time as we can dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics. # AC_DEFUN_ONCE([NAME], VALUE) # ---------------------------- # Define NAME to expand to VALUE on the first use (whether by direct # expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. # Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This # definition is slower than the version in Autoconf 2.64, because it # can only use interfaces that existed since 2.59; but it achieves the # same effect. Quoting is necessary to avoid confusing Automake. m4_version_prereq([2.63.263], [], [m4_define([AC][_DEFUN_ONCE], [AC][_DEFUN([$1], [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl [AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) # gl_00GNULIB # ----------- # Witness macro that this file has been included. Needed to force # Automake to include this file prior to all other gnulib .m4 files. AC_DEFUN([gl_00GNULIB]) amanda-3.3.6/config/gnulib/euidaccess.m40000664000076400007640000000346512357250007021550 0ustar00martineamartinea00000000000000# euidaccess.m4 serial 15 dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_NONREENTRANT_EUIDACCESS], [ AC_REQUIRE([gl_FUNC_EUIDACCESS]) AC_CHECK_DECLS([setregid]) AC_DEFINE([PREFER_NONREENTRANT_EUIDACCESS], [1], [Define this if you prefer euidaccess to return the correct result even if this would make it nonreentrant. Define this only if your entire application is safe even if the uid or gid might temporarily change. If your application uses signal handlers or threads it is probably not safe.]) ]) AC_DEFUN([gl_FUNC_EUIDACCESS], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl Persuade glibc to declare euidaccess(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CHECK_FUNCS([euidaccess]) if test $ac_cv_func_euidaccess = no; then HAVE_EUIDACCESS=0 fi ]) # Prerequisites of lib/euidaccess.c. AC_DEFUN([gl_PREREQ_EUIDACCESS], [ dnl Prefer POSIX faccessat over non-standard euidaccess. AC_CHECK_FUNCS_ONCE([faccessat]) dnl Try various other non-standard fallbacks. AC_CHECK_HEADERS([libgen.h]) AC_FUNC_GETGROUPS # Solaris 9 and 10 need -lgen to get the eaccess function. # Save and restore LIBS so -lgen isn't added to it. Otherwise, *all* # programs in the package would end up linked with that potentially-shared # library, inducing unnecessary run-time overhead. LIB_EACCESS= AC_SUBST([LIB_EACCESS]) gl_saved_libs=$LIBS AC_SEARCH_LIBS([eaccess], [gen], [test "$ac_cv_search_eaccess" = "none required" || LIB_EACCESS=$ac_cv_search_eaccess]) AC_CHECK_FUNCS([eaccess]) LIBS=$gl_saved_libs ]) amanda-3.3.6/config/gnulib/time_h.m40000664000076400007640000001020612357250007020674 0ustar00martineamartinea00000000000000# Configure a more-standard replacement for . # Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc. # serial 7 # 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. # Written by Paul Eggert and Jim Meyering. AC_DEFUN([gl_HEADER_TIME_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_HEADER_TIME_H_BODY]) ]) AC_DEFUN([gl_HEADER_TIME_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) gl_NEXT_HEADERS([time.h]) AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) ]) dnl Check whether 'struct timespec' is declared dnl in time.h, sys/time.h, or pthread.h. AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], [ AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_time_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_time_h=yes], [gl_cv_sys_struct_timespec_in_time_h=no])]) TIME_H_DEFINES_STRUCT_TIMESPEC=0 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_sys_time_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_sys_time_h=yes], [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 else AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_pthread_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_pthread_h=yes], [gl_cv_sys_struct_timespec_in_pthread_h=no])]) if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 fi fi fi AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) ]) AC_DEFUN([gl_TIME_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], [ GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) dnl If another module says to replace or to not replace, do that. dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; dnl this lets maintainers check for portability. REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) ]) amanda-3.3.6/config/gnulib/safe-read.m40000664000076400007640000000063112357250007021257 0ustar00martineamartinea00000000000000# safe-read.m4 serial 6 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prerequisites of lib/safe-read.c. AC_DEFUN([gl_PREREQ_SAFE_READ], [ AC_REQUIRE([gt_TYPE_SSIZE_T]) ]) amanda-3.3.6/config/gnulib/socketlib.m40000664000076400007640000000524412357250007021414 0ustar00martineamartinea00000000000000# socketlib.m4 serial 1 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl gl_SOCKETLIB dnl Determines the library to use for socket functions. dnl Sets and AC_SUBSTs LIBSOCKET. AC_DEFUN([gl_SOCKETLIB], [ gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H LIBSOCKET= if test $HAVE_WINSOCK2_H = 1; then dnl Native Windows API (not Cygwin). AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32], [gl_cv_func_wsastartup], [ gl_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_WINSOCK2_H # include #endif]], [[ WORD wVersionRequested = MAKEWORD(1, 1); WSADATA wsaData; int err = WSAStartup(wVersionRequested, &wsaData); WSACleanup ();]])], gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no) LIBS="$gl_save_LIBS" ]) if test "$gl_cv_func_wsastartup" = "yes"; then AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) LIBSOCKET='-lws2_32' fi else dnl Unix API. dnl Solaris has most socket functions in libsocket. dnl Haiku has most socket functions in libnetwork. dnl BeOS has most socket functions in libnet. AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ gl_cv_lib_socket= AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" #endif char setsockopt();]], [[setsockopt();]])], [], [gl_save_LIBS="$LIBS" LIBS="$gl_save_LIBS -lsocket" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" #endif char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lsocket"]) if test -z "$gl_cv_lib_socket"; then LIBS="$gl_save_LIBS -lnetwork" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" #endif char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lnetwork"]) if test -z "$gl_cv_lib_socket"; then LIBS="$gl_save_LIBS -lnet" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" #endif char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lnet"]) fi fi LIBS="$gl_save_LIBS" ]) if test -z "$gl_cv_lib_socket"; then gl_cv_lib_socket="none needed" fi ]) if test "$gl_cv_lib_socket" != "none needed"; then LIBSOCKET="$gl_cv_lib_socket" fi fi AC_SUBST([LIBSOCKET]) ]) amanda-3.3.6/config/gnulib/stdbool.m40000664000076400007640000000637112357250007021105 0ustar00martineamartinea00000000000000# Check for stdbool.h that conforms to C99. dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. #serial 5 # Prepare for substituting if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi AC_SUBST([HAVE__BOOL]) ]) # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) # This version of the macro is needed in autoconf <= 2.68. AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; ]], [[ bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) ]) amanda-3.3.6/config/gnulib/lib-link.m40000664000076400007640000010044312357250007021133 0ustar00martineamartinea00000000000000# lib-link.m4 serial 26 (gettext-0.18.2) dnl Copyright (C) 2001-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_LINK_IFELSE( [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_libname_spec, dnl acl_library_names_spec, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) amanda-3.3.6/config/gnulib/errno_h.m40000664000076400007640000000623412357250007021071 0ustar00martineamartinea00000000000000# errno_h.m4 serial 12 dnl Copyright (C) 2004, 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ AC_EGREP_CPP([booboo],[ #include #if !defined ETXTBSY booboo #endif #if !defined ENOMSG booboo #endif #if !defined EIDRM booboo #endif #if !defined ENOLINK booboo #endif #if !defined EPROTO booboo #endif #if !defined EMULTIHOP booboo #endif #if !defined EBADMSG booboo #endif #if !defined EOVERFLOW booboo #endif #if !defined ENOTSUP booboo #endif #if !defined ENETRESET booboo #endif #if !defined ECONNABORTED booboo #endif #if !defined ESTALE booboo #endif #if !defined EDQUOT booboo #endif #if !defined ECANCELED booboo #endif #if !defined EOWNERDEAD booboo #endif #if !defined ENOTRECOVERABLE booboo #endif #if !defined EILSEQ booboo #endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) ]) if test $gl_cv_header_errno_h_complete = yes; then ERRNO_H='' else gl_NEXT_HEADERS([errno.h]) ERRNO_H='errno.h' fi AC_SUBST([ERRNO_H]) AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) gl_REPLACE_ERRNO_VALUE([ENOLINK]) gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) ]) # Assuming $1 = EOVERFLOW. # The EOVERFLOW errno value ought to be defined in , according to # POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and # some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. # Check for the value of EOVERFLOW. # Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE. AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ AC_EGREP_CPP([yes],[ #include #ifdef ]$1[ yes #endif ], [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then AC_EGREP_CPP([yes],[ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef ]$1[ yes #endif ], [gl_cv_header_errno_h_]$1[=hidden]) if test $gl_cv_header_errno_h_]$1[ = hidden; then dnl The macro exists but is hidden. dnl Define it to the same value. AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include ]) fi fi ]) case $gl_cv_header_errno_h_]$1[ in yes | no) ]$1[_HIDDEN=0; ]$1[_VALUE= ;; *) ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1[" ;; esac AC_SUBST($1[_HIDDEN]) AC_SUBST($1[_VALUE]) fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) amanda-3.3.6/config/gnulib/sys_stat_h.m40000664000076400007640000000723612357250007021620 0ustar00martineamartinea00000000000000# sys_stat_h.m4 serial 28 -*- Autoconf -*- dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Eric Blake. dnl Provide a GNU-like . AC_DEFUN([gl_HEADER_SYS_STAT_H], [ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) dnl Check for broken stat macros. AC_REQUIRE([AC_HEADER_STAT]) gl_CHECK_NEXT_HEADERS([sys/stat.h]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Whether to override 'struct stat'. m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([gl_LARGEFILE]) ], [ WINDOWS_64_BIT_ST_SIZE=0 ]) AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) if test $WINDOWS_64_BIT_ST_SIZE = 1; then AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1], [Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct stat.st_size becomes 64-bit.]) fi dnl Define types that are supposed to be defined in or dnl . AC_CHECK_TYPE([nlink_t], [], [AC_DEFINE([nlink_t], [int], [Define to the type of st_nlink in struct stat, or a supertype.])], [#include #include ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat]) ]) # gl_HEADER_SYS_STAT_H AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) ]) amanda-3.3.6/config/gnulib/wcrtomb.m40000664000076400007640000000661012357250007021110 0ustar00martineamartinea00000000000000# wcrtomb.m4 serial 11 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WCRTOMB], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN AC_CHECK_FUNCS_ONCE([wcrtomb]) if test $ac_cv_func_wcrtomb = no; then HAVE_WCRTOMB=0 AC_CHECK_DECLS([wcrtomb],,, [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include ]]) if test $ac_cv_have_decl_wcrtomb = yes; then dnl On Minix 3.1.8, the system's declares wcrtomb() although dnl it does not have the function. Avoid a collision with gnulib's dnl replacement. REPLACE_WCRTOMB=1 fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCRTOMB=1 else dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes dnl returns 0 instead of 1. AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether wcrtomb return value is correct], [gl_cv_func_wcrtomb_retval], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on AIX 4, OSF/1 and Solaris. aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_wcrtomb_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { int result = 0; if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) { if (wcrtomb (NULL, 0, NULL) != 1) result |= 1; } if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { if (wcrtomb (NULL, 0, NULL) != 1) result |= 2; } if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) { if (wcrtomb (NULL, 0, NULL) != 1) result |= 4; } if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { if (wcrtomb (NULL, 0, NULL) != 1) result |= 8; } return result; }]])], [gl_cv_func_wcrtomb_retval=yes], [gl_cv_func_wcrtomb_retval=no], [:]) fi ]) case "$gl_cv_func_wcrtomb_retval" in *yes) ;; *) REPLACE_WCRTOMB=1 ;; esac fi fi ]) # Prerequisites of lib/wcrtomb.c. AC_DEFUN([gl_PREREQ_WCRTOMB], [ : ]) amanda-3.3.6/config/gnulib/sys_types_h.m40000664000076400007640000000121712357250007022002 0ustar00martineamartinea00000000000000# sys_types_h.m4 serial 5 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_SYS_TYPES_H], [ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) gl_NEXT_HEADERS([sys/types.h]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Whether to override the 'off_t' type. AC_REQUIRE([gl_TYPE_OFF_T]) ]) AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) amanda-3.3.6/config/gnulib/gnulib-comp.m40000664000076400007640000005400512357250007021650 0ustar00martineamartinea00000000000000# DO NOT EDIT! GENERATED AUTOMATICALLY! # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # 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 file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that # contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. # In projects that use version control, this file can be treated like # other built files. # This macro should be invoked from ./configure.in, in the section # "Checks for programs", right after AC_PROG_CC, and certainly before # any checks for libraries, header files, types and library functions. AC_DEFUN([gl_EARLY], [ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable AC_REQUIRE([gl_PROG_AR_RANLIB]) AC_REQUIRE([AM_PROG_CC_C_O]) # Code from module alloca-opt: # Code from module arpa_inet: # Code from module base64: # Code from module btowc: # Code from module c-ctype: # Code from module configmake: # Code from module dosname: # Code from module environ: # Code from module errno: # Code from module euidaccess: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: # Code from module fcntl-h: # Code from module fd-hook: # Code from module float: # Code from module fseek: # Code from module fseeko: AC_REQUIRE([AC_FUNC_FSEEKO]) # Code from module fstat: # Code from module fsusage: # Code from module ftell: # Code from module ftello: AC_REQUIRE([AC_FUNC_FSEEKO]) # Code from module ftruncate: # Code from module full-read: # Code from module full-write: # Code from module getaddrinfo: # Code from module getgroups: # Code from module getopt-gnu: # Code from module getopt-posix: # Code from module gettext-h: # Code from module gettimeofday: # Code from module group-member: # Code from module havelib: # Code from module hostent: # Code from module include_next: # Code from module inet_ntop: # Code from module inet_pton: # Code from module langinfo: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module localcharset: # Code from module locale: # Code from module localeconv: # Code from module lock: # Code from module lseek: # Code from module lstat: # Code from module malloc-gnu: # Code from module malloc-posix: # Code from module mbrtowc: # Code from module mbsinit: # Code from module mbtowc: # Code from module memchr: # Code from module mkdtemp: # Code from module msvc-inval: # Code from module msvc-nothrow: # Code from module multiarch: # Code from module netdb: # Code from module netinet_in: # Code from module nl_langinfo: # Code from module nocrash: # Code from module pathmax: # Code from module physmem: # Code from module raise: # Code from module read: # Code from module regex: # Code from module root-uid: # Code from module safe-read: # Code from module safe-write: # Code from module secure_getenv: # Code from module servent: # Code from module signal-h: # Code from module size_max: # Code from module snippet/_Noreturn: # Code from module snippet/arg-nonnull: # Code from module snippet/c++defs: # Code from module snippet/warn-on-use: # Code from module snprintf: # Code from module socketlib: # Code from module sockets: # Code from module socklen: # Code from module ssize_t: # Code from module stat: # Code from module stdalign: # Code from module stdbool: # Code from module stddef: # Code from module stdint: # Code from module stdio: # Code from module stdlib: # Code from module streq: # Code from module string: # Code from module sys_socket: # Code from module sys_stat: # Code from module sys_time: # Code from module sys_types: # Code from module sys_uio: # Code from module tempname: # Code from module threadlib: gl_THREADLIB_EARLY # Code from module time: # Code from module unistd: # Code from module vasnprintf: # Code from module verify: # Code from module wchar: # Code from module wcrtomb: # Code from module wctype-h: # Code from module write: # Code from module xalloc-oversized: # Code from module xsize: ]) # This macro should be invoked from ./configure.in, in the section # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ AM_CONDITIONAL([GL_COND_LIBTOOL], [true]) gl_cond_libtool=true gl_m4_base='config/gnulib' m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) m4_pushdef([gl_LIBSOURCES_LIST], []) m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib' gl_FUNC_ALLOCA gl_HEADER_ARPA_INET AC_PROG_MKDIR_P gl_FUNC_BASE64 gl_FUNC_BTOWC if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then AC_LIBOBJ([btowc]) gl_PREREQ_BTOWC fi gl_WCHAR_MODULE_INDICATOR([btowc]) gl_CONFIGMAKE_PREP gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) gl_HEADER_ERRNO_H gl_FUNC_EUIDACCESS if test $HAVE_EUIDACCESS = 0; then AC_LIBOBJ([euidaccess]) gl_PREREQ_EUIDACCESS fi gl_UNISTD_MODULE_INDICATOR([euidaccess]) AC_REQUIRE([gl_EXTERN_INLINE]) gl_FCNTL_H gl_FLOAT_H if test $REPLACE_FLOAT_LDBL = 1; then AC_LIBOBJ([float]) fi if test $REPLACE_ITOLD = 1; then AC_LIBOBJ([itold]) fi gl_FUNC_FSEEK if test $REPLACE_FSEEK = 1; then AC_LIBOBJ([fseek]) fi gl_STDIO_MODULE_INDICATOR([fseek]) gl_FUNC_FSEEKO if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then AC_LIBOBJ([fseeko]) gl_PREREQ_FSEEKO fi gl_STDIO_MODULE_INDICATOR([fseeko]) gl_FUNC_FSTAT if test $REPLACE_FSTAT = 1; then AC_LIBOBJ([fstat]) gl_PREREQ_FSTAT fi gl_SYS_STAT_MODULE_INDICATOR([fstat]) gl_FSUSAGE if test $gl_cv_fs_space = yes; then AC_LIBOBJ([fsusage]) gl_PREREQ_FSUSAGE_EXTRA fi gl_FUNC_FTELL if test $REPLACE_FTELL = 1; then AC_LIBOBJ([ftell]) fi gl_STDIO_MODULE_INDICATOR([ftell]) gl_FUNC_FTELLO if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then AC_LIBOBJ([ftello]) gl_PREREQ_FTELLO fi gl_STDIO_MODULE_INDICATOR([ftello]) gl_FUNC_FTRUNCATE if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then AC_LIBOBJ([ftruncate]) gl_PREREQ_FTRUNCATE fi gl_UNISTD_MODULE_INDICATOR([ftruncate]) gl_GETADDRINFO if test $HAVE_GETADDRINFO = 0; then AC_LIBOBJ([getaddrinfo]) fi if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then AC_LIBOBJ([gai_strerror]) fi gl_NETDB_MODULE_INDICATOR([getaddrinfo]) gl_FUNC_GETGROUPS if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then AC_LIBOBJ([getgroups]) fi gl_UNISTD_MODULE_INDICATOR([getgroups]) gl_FUNC_GETOPT_GNU if test $REPLACE_GETOPT = 1; then AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1]) gl_PREREQ_GETOPT dnl Arrange for unistd.h to include getopt.h. GNULIB_GL_UNISTD_H_GETOPT=1 fi AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) gl_FUNC_GETOPT_POSIX if test $REPLACE_GETOPT = 1; then AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1]) gl_PREREQ_GETOPT dnl Arrange for unistd.h to include getopt.h. GNULIB_GL_UNISTD_H_GETOPT=1 fi AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_FUNC_GETTIMEOFDAY if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY fi gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) gl_FUNC_GROUP_MEMBER if test $HAVE_GROUP_MEMBER = 0; then AC_LIBOBJ([group-member]) gl_PREREQ_GROUP_MEMBER fi gl_UNISTD_MODULE_INDICATOR([group-member]) gl_HOSTENT gl_FUNC_INET_NTOP if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then AC_LIBOBJ([inet_ntop]) gl_PREREQ_INET_NTOP fi gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) gl_FUNC_INET_PTON if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then AC_LIBOBJ([inet_pton]) gl_PREREQ_INET_PTON fi gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) gl_LANGINFO_H AC_REQUIRE([gl_LARGEFILE]) gl_LOCALCHARSET LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) gl_LOCALE_H gl_FUNC_LOCALECONV if test $REPLACE_LOCALECONV = 1; then AC_LIBOBJ([localeconv]) gl_PREREQ_LOCALECONV fi gl_LOCALE_MODULE_INDICATOR([localeconv]) gl_LOCK gl_FUNC_LSEEK if test $REPLACE_LSEEK = 1; then AC_LIBOBJ([lseek]) fi gl_UNISTD_MODULE_INDICATOR([lseek]) gl_FUNC_LSTAT if test $REPLACE_LSTAT = 1; then AC_LIBOBJ([lstat]) gl_PREREQ_LSTAT fi gl_SYS_STAT_MODULE_INDICATOR([lstat]) gl_FUNC_MALLOC_GNU if test $REPLACE_MALLOC = 1; then AC_LIBOBJ([malloc]) fi gl_MODULE_INDICATOR([malloc-gnu]) gl_FUNC_MALLOC_POSIX if test $REPLACE_MALLOC = 1; then AC_LIBOBJ([malloc]) fi gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_FUNC_MBRTOWC if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then AC_LIBOBJ([mbrtowc]) gl_PREREQ_MBRTOWC fi gl_WCHAR_MODULE_INDICATOR([mbrtowc]) gl_FUNC_MBSINIT if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then AC_LIBOBJ([mbsinit]) gl_PREREQ_MBSINIT fi gl_WCHAR_MODULE_INDICATOR([mbsinit]) gl_FUNC_MBTOWC if test $REPLACE_MBTOWC = 1; then AC_LIBOBJ([mbtowc]) gl_PREREQ_MBTOWC fi gl_STDLIB_MODULE_INDICATOR([mbtowc]) gl_FUNC_MEMCHR if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then AC_LIBOBJ([memchr]) gl_PREREQ_MEMCHR fi gl_STRING_MODULE_INDICATOR([memchr]) gl_FUNC_MKDTEMP if test $HAVE_MKDTEMP = 0; then AC_LIBOBJ([mkdtemp]) gl_PREREQ_MKDTEMP fi gl_STDLIB_MODULE_INDICATOR([mkdtemp]) gl_MSVC_INVAL if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-inval]) fi gl_MSVC_NOTHROW if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-nothrow]) fi gl_MULTIARCH gl_HEADER_NETDB gl_HEADER_NETINET_IN AC_PROG_MKDIR_P gl_FUNC_NL_LANGINFO if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then AC_LIBOBJ([nl_langinfo]) fi gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) gl_PATHMAX gl_PHYSMEM gl_FUNC_RAISE if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then AC_LIBOBJ([raise]) gl_PREREQ_RAISE fi gl_SIGNAL_MODULE_INDICATOR([raise]) gl_FUNC_READ if test $REPLACE_READ = 1; then AC_LIBOBJ([read]) gl_PREREQ_READ fi gl_UNISTD_MODULE_INDICATOR([read]) gl_REGEX if test $ac_use_included_regex = yes; then AC_LIBOBJ([regex]) gl_PREREQ_REGEX fi gl_PREREQ_SAFE_READ gl_PREREQ_SAFE_WRITE gl_FUNC_SECURE_GETENV if test $HAVE_SECURE_GETENV = 0; then AC_LIBOBJ([secure_getenv]) gl_PREREQ_SECURE_GETENV fi gl_STDLIB_MODULE_INDICATOR([secure_getenv]) gl_SERVENT gl_SIGNAL_H gl_SIZE_MAX gl_FUNC_SNPRINTF gl_STDIO_MODULE_INDICATOR([snprintf]) gl_MODULE_INDICATOR([snprintf]) gl_SOCKETLIB gl_SOCKETS gl_TYPE_SOCKLEN_T gt_TYPE_SSIZE_T gl_FUNC_STAT if test $REPLACE_STAT = 1; then AC_LIBOBJ([stat]) gl_PREREQ_STAT fi gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_STDALIGN_H AM_STDBOOL_H gl_STDDEF_H gl_STDINT_H gl_STDIO_H gl_STDLIB_H gl_HEADER_STRING_H gl_HEADER_SYS_SOCKET AC_PROG_MKDIR_P gl_HEADER_SYS_STAT_H AC_PROG_MKDIR_P gl_HEADER_SYS_TIME_H AC_PROG_MKDIR_P gl_SYS_TYPES_H AC_PROG_MKDIR_P gl_HEADER_SYS_UIO AC_PROG_MKDIR_P gl_FUNC_GEN_TEMPNAME gl_THREADLIB gl_HEADER_TIME_H gl_UNISTD_H gl_FUNC_VASNPRINTF gl_WCHAR_H gl_FUNC_WCRTOMB if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then AC_LIBOBJ([wcrtomb]) gl_PREREQ_WCRTOMB fi gl_WCHAR_MODULE_INDICATOR([wcrtomb]) gl_WCTYPE_H gl_FUNC_WRITE if test $REPLACE_WRITE = 1; then AC_LIBOBJ([write]) gl_PREREQ_WRITE fi gl_UNISTD_MODULE_INDICATOR([write]) gl_XSIZE # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || for gl_file in ]gl_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([gl_LIBSOURCES_DIR]) m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) ]) gltests_libdeps= gltests_ltlibdeps= m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) m4_pushdef([gltests_LIBSOURCES_LIST], []) m4_pushdef([gltests_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='tests' changequote(,)dnl gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) m4_popdef([gl_MODULE_INDICATOR_CONDITION]) m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || for gl_file in ]gltests_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([gltests_LIBSOURCES_DIR]) m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gltests_libobjs= gltests_ltlibobjs= if test -n "$gltests_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs $i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" done fi AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_LIBOBJ], [ AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gl_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gl_LIBSOURCES_DIR], [gnulib]) m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_LIBOBJ], [ AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gltests_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gltests_LIBSOURCES_DIR], [tests]) m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath build-aux/snippet/_Noreturn.h build-aux/snippet/arg-nonnull.h build-aux/snippet/c++defs.h build-aux/snippet/warn-on-use.h lib/alloca.in.h lib/arpa_inet.in.h lib/asnprintf.c lib/base64.c lib/base64.h lib/btowc.c lib/c-ctype.c lib/c-ctype.h lib/config.charset lib/dosname.h lib/errno.in.h lib/euidaccess.c lib/fcntl.in.h lib/fd-hook.c lib/fd-hook.h lib/float+.h lib/float.c lib/float.in.h lib/fseek.c lib/fseeko.c lib/fstat.c lib/fsusage.c lib/fsusage.h lib/ftell.c lib/ftello.c lib/ftruncate.c lib/full-read.c lib/full-read.h lib/full-write.c lib/full-write.h lib/gai_strerror.c lib/getaddrinfo.c lib/getgroups.c lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/gettimeofday.c lib/glthread/lock.c lib/glthread/lock.h lib/glthread/threadlib.c lib/group-member.c lib/inet_ntop.c lib/inet_pton.c lib/itold.c lib/langinfo.in.h lib/localcharset.c lib/localcharset.h lib/locale.in.h lib/localeconv.c lib/lseek.c lib/lstat.c lib/malloc.c lib/mbrtowc.c lib/mbsinit.c lib/mbtowc-impl.h lib/mbtowc.c lib/memchr.c lib/memchr.valgrind lib/mkdtemp.c lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c lib/msvc-nothrow.h lib/netdb.in.h lib/netinet_in.in.h lib/nl_langinfo.c lib/pathmax.h lib/physmem.c lib/physmem.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/raise.c lib/read.c lib/ref-add.sin lib/ref-del.sin lib/regcomp.c lib/regex.c lib/regex.h lib/regex_internal.c lib/regex_internal.h lib/regexec.c lib/root-uid.h lib/safe-read.c lib/safe-read.h lib/safe-write.c lib/safe-write.h lib/secure_getenv.c lib/signal.in.h lib/size_max.h lib/snprintf.c lib/sockets.c lib/sockets.h lib/stat.c lib/stdalign.in.h lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h lib/stdio-impl.h lib/stdio.in.h lib/stdlib.in.h lib/streq.h lib/string.in.h lib/sys_socket.c lib/sys_socket.in.h lib/sys_stat.in.h lib/sys_time.in.h lib/sys_types.in.h lib/sys_uio.in.h lib/tempname.c lib/tempname.h lib/time.in.h lib/unistd.c lib/unistd.in.h lib/vasnprintf.c lib/vasnprintf.h lib/verify.h lib/w32sock.h lib/wchar.in.h lib/wcrtomb.c lib/wctype-h.c lib/wctype.in.h lib/write.c lib/xalloc-oversized.h lib/xsize.c lib/xsize.h m4/00gnulib.m4 m4/alloca.m4 m4/arpa_inet_h.m4 m4/base64.m4 m4/btowc.m4 m4/codeset.m4 m4/configmake.m4 m4/eealloc.m4 m4/environ.m4 m4/errno_h.m4 m4/euidaccess.m4 m4/exponentd.m4 m4/extensions.m4 m4/extern-inline.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 m4/float_h.m4 m4/fseek.m4 m4/fseeko.m4 m4/fstat.m4 m4/fsusage.m4 m4/ftell.m4 m4/ftello.m4 m4/ftruncate.m4 m4/getaddrinfo.m4 m4/getgroups.m4 m4/getopt.m4 m4/gettimeofday.m4 m4/glibc21.m4 m4/gnulib-common.m4 m4/group-member.m4 m4/hostent.m4 m4/include_next.m4 m4/inet_ntop.m4 m4/inet_pton.m4 m4/intmax_t.m4 m4/inttypes_h.m4 m4/langinfo_h.m4 m4/largefile.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/localcharset.m4 m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 m4/locale_h.m4 m4/localeconv.m4 m4/lock.m4 m4/longlong.m4 m4/lseek.m4 m4/lstat.m4 m4/malloc.m4 m4/math_h.m4 m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbstate_t.m4 m4/mbtowc.m4 m4/memchr.m4 m4/mkdtemp.m4 m4/mmap-anon.m4 m4/msvc-inval.m4 m4/msvc-nothrow.m4 m4/multiarch.m4 m4/netdb_h.m4 m4/netinet_in_h.m4 m4/nl_langinfo.m4 m4/nocrash.m4 m4/off_t.m4 m4/pathmax.m4 m4/physmem.m4 m4/printf.m4 m4/raise.m4 m4/read.m4 m4/regex.m4 m4/safe-read.m4 m4/safe-write.m4 m4/secure_getenv.m4 m4/servent.m4 m4/signal_h.m4 m4/size_max.m4 m4/snprintf.m4 m4/socketlib.m4 m4/sockets.m4 m4/socklen.m4 m4/sockpfaf.m4 m4/ssize_t.m4 m4/stat.m4 m4/stdalign.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdint_h.m4 m4/stdio_h.m4 m4/stdlib_h.m4 m4/string_h.m4 m4/sys_socket_h.m4 m4/sys_stat_h.m4 m4/sys_time_h.m4 m4/sys_types_h.m4 m4/sys_uio_h.m4 m4/tempname.m4 m4/threadlib.m4 m4/time_h.m4 m4/unistd_h.m4 m4/vasnprintf.m4 m4/warn-on-use.m4 m4/wchar_h.m4 m4/wchar_t.m4 m4/wcrtomb.m4 m4/wctype_h.m4 m4/wint_t.m4 m4/write.m4 m4/xsize.m4 ]) amanda-3.3.6/config/gnulib/gettimeofday.m40000664000076400007640000001172512357250007022117 0ustar00martineamartinea00000000000000# serial 20 # Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. AC_DEFUN([gl_FUNC_GETTIMEOFDAY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([gettimeofday]) gl_gettimeofday_timezone=void if test $ac_cv_func_gettimeofday != yes; then HAVE_GETTIMEOFDAY=0 else gl_FUNC_GETTIMEOFDAY_CLOBBER AC_CACHE_CHECK([for gettimeofday with POSIX signature], [gl_cv_func_gettimeofday_posix_signature], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include struct timeval c; int gettimeofday (struct timeval *restrict, void *restrict); ]], [[/* glibc uses struct timezone * rather than the POSIX void * if _GNU_SOURCE is defined. However, since the only portable use of gettimeofday uses NULL as the second parameter, and since the glibc definition is actually more typesafe, it is not worth wrapping this to get a compliant signature. */ int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; int x = f (&c, 0); return !(x | c.tv_sec | c.tv_usec); ]])], [gl_cv_func_gettimeofday_posix_signature=yes], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int gettimeofday (struct timeval *restrict, struct timezone *restrict); ]])], [gl_cv_func_gettimeofday_posix_signature=almost], [gl_cv_func_gettimeofday_posix_signature=no])])]) if test $gl_cv_func_gettimeofday_posix_signature = almost; then gl_gettimeofday_timezone='struct timezone' elif test $gl_cv_func_gettimeofday_posix_signature != yes; then REPLACE_GETTIMEOFDAY=1 fi dnl If we override 'struct timeval', we also have to override gettimeofday. if test $REPLACE_STRUCT_TIMEVAL = 1; then REPLACE_GETTIMEOFDAY=1 fi m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ gl_FUNC_TZSET_CLOBBER case "$gl_cv_func_tzset_clobber" in *yes) REPLACE_GETTIMEOFDAY=1 gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([tzset], [rpl_tzset], [Define to rpl_tzset if the wrapper function should be used.]) AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], [Define if tzset clobbers localtime's static buffer.]) ;; esac ]) fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], [Define this to 'void' or 'struct timezone' to match the system's declaration of the second argument to gettimeofday.]) ]) dnl See if gettimeofday clobbers the static buffer that localtime uses dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 dnl (i.e., Darwin 1.3.7) has this problem. dnl dnl If it does, then arrange to use gettimeofday and localtime only via dnl the wrapper functions that work around the problem. AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], [gl_cv_func_gettimeofday_clobber], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #include #include ]], [[ time_t t = 0; struct tm *lt; struct tm saved_lt; struct timeval tv; lt = localtime (&t); saved_lt = *lt; gettimeofday (&tv, NULL); return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; ]])], [gl_cv_func_gettimeofday_clobber=no], [gl_cv_func_gettimeofday_clobber=yes], [# When cross-compiling: case "$host_os" in # Guess all is fine on glibc systems. *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; # If we don't know, assume the worst. *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; esac ])]) case "$gl_cv_func_gettimeofday_clobber" in *yes) REPLACE_GETTIMEOFDAY=1 gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) ;; esac ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ AC_DEFINE([gmtime], [rpl_gmtime], [Define to rpl_gmtime if the replacement function should be used.]) AC_DEFINE([localtime], [rpl_localtime], [Define to rpl_localtime if the replacement function should be used.]) ]) # Prerequisites of lib/gettimeofday.c. AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ AC_CHECK_HEADERS([sys/timeb.h]) AC_CHECK_FUNCS([_ftime]) ]) amanda-3.3.6/config/gnulib/inet_pton.m40000664000076400007640000000414512357250007021433 0ustar00martineamartinea00000000000000# inet_pton.m4 serial 17 dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_INET_PTON], [ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) dnl Persuade Solaris to declare inet_pton. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_C_RESTRICT]) dnl Most platforms that provide inet_pton define it in libc. dnl Solaris 8..10 provide inet_pton in libnsl instead. dnl Solaris 2.6..7 provide inet_pton in libresolv instead. dnl Native Windows provides it in -lws2_32 instead, with a declaration in dnl , and it uses stdcall calling convention, not cdecl dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). HAVE_INET_PTON=1 INET_PTON_LIB= gl_PREREQ_SYS_H_WINSOCK2 if test $HAVE_WINSOCK2_H = 1; then AC_CHECK_DECLS([inet_pton],,, [[#include ]]) if test $ac_cv_have_decl_inet_pton = yes; then dnl It needs to be overridden, because the stdcall calling convention dnl is not compliant with POSIX. REPLACE_INET_PTON=1 INET_PTON_LIB="-lws2_32" else HAVE_DECL_INET_PTON=0 HAVE_INET_PTON=0 fi else gl_save_LIBS=$LIBS AC_SEARCH_LIBS([inet_pton], [nsl resolv], [], [AC_CHECK_FUNCS([inet_pton]) if test $ac_cv_func_inet_pton = no; then HAVE_INET_PTON=0 fi ]) LIBS=$gl_save_LIBS if test "$ac_cv_search_inet_pton" != "no" \ && test "$ac_cv_search_inet_pton" != "none required"; then INET_PTON_LIB="$ac_cv_search_inet_pton" fi AC_CHECK_HEADERS_ONCE([netdb.h]) AC_CHECK_DECLS([inet_pton],,, [[#include #if HAVE_NETDB_H # include #endif ]]) if test $ac_cv_have_decl_inet_pton = no; then HAVE_DECL_INET_PTON=0 fi fi AC_SUBST([INET_PTON_LIB]) ]) # Prerequisites of lib/inet_pton.c. AC_DEFUN([gl_PREREQ_INET_PTON], [ AC_REQUIRE([gl_SOCKET_FAMILIES]) ]) amanda-3.3.6/config/gnulib/stat.m40000664000076400007640000000521412357250007020405 0ustar00martineamartinea00000000000000# serial 11 # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STAT], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([lstat]) dnl mingw is the only known platform where stat(".") and stat("./") differ AC_CACHE_CHECK([whether stat handles trailing slashes on directories], [gl_cv_func_stat_dir_slash], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])], [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no], [case $host_os in mingw*) gl_cv_func_stat_dir_slash="guessing no";; *) gl_cv_func_stat_dir_slash="guessing yes";; esac])]) dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). AC_CACHE_CHECK([whether stat handles trailing slashes on files], [gl_cv_func_stat_file_slash], [touch conftest.tmp # Assume that if we have lstat, we can also check symlinks. if test $ac_cv_func_lstat = yes; then ln -s conftest.tmp conftest.lnk fi AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int result = 0; struct stat st; if (!stat ("conftest.tmp/", &st)) result |= 1; #if HAVE_LSTAT if (!stat ("conftest.lnk/", &st)) result |= 2; #endif return result; ]])], [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; # If we don't know, assume the worst. *) gl_cv_func_stat_file_slash="guessing no" ;; esac ]) rm -f conftest.tmp conftest.lnk]) case $gl_cv_func_stat_dir_slash in *no) REPLACE_STAT=1 AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs help when passed a directory name with a trailing slash]);; esac case $gl_cv_func_stat_file_slash in *no) REPLACE_STAT=1 AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs help when passed a file name with a trailing slash]);; esac ]) # Prerequisites of lib/stat.c. AC_DEFUN([gl_PREREQ_STAT], [:]) amanda-3.3.6/config/gnulib/physmem.m40000664000076400007640000000321212357250007021110 0ustar00martineamartinea00000000000000# physmem.m4 serial 11 dnl Copyright (C) 2002-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Check for the external symbol, _system_configuration, # a struct with member 'physmem'. AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION], [AC_CACHE_CHECK([for external symbol _system_configuration], gl_cv_var__system_configuration, [AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[double x = _system_configuration.physmem; if (x > 0.0) return 0;]])], [gl_cv_var__system_configuration=yes], [gl_cv_var__system_configuration=no])]) if test $gl_cv_var__system_configuration = yes; then AC_DEFINE([HAVE__SYSTEM_CONFIGURATION], [1], [Define to 1 if you have the external variable, _system_configuration with a member named physmem.]) fi ] ) AC_DEFUN([gl_PHYSMEM], [ # Prerequisites of lib/physmem.c. AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \ machine/hal_sysinfo.h sys/table.h sys/param.h sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT]) dnl requires on OpenBSD 4.0. AC_CHECK_HEADERS([sys/sysctl.h],,, [AC_INCLUDES_DEFAULT #if HAVE_SYS_PARAM_H # include #endif ]) AC_CHECK_FUNCS([pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table]) AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION]) ]) amanda-3.3.6/config/gnulib/include_next.m40000664000076400007640000002542412357250007022120 0ustar00martineamartinea00000000000000# include_next.m4 serial 23 dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Derek Price. dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER. dnl dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to dnl 'include' otherwise. dnl dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler dnl supports it in the special case that it is the first include directive in dnl the given file, or to 'include' otherwise. dnl dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next, dnl so as to avoid GCC warnings when the gcc option -pedantic is used. dnl '#pragma GCC system_header' has the same effect as if the file was found dnl through the include search path specified with '-isystem' options (as dnl opposed to the search path specified with '-I' options). Namely, gcc dnl does not warn about some things, and on some systems (Solaris and Interix) dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead dnl of plain '__STDC__'. dnl dnl PRAGMA_COLUMNS can be used in files that override system header files, so dnl as to avoid compilation errors on HP NonStop systems when the gnulib file dnl is included by a system header file that does a "#pragma COLUMNS 80" (which dnl has the effect of truncating the lines of that file and all files that it dnl includes to 80 columns) and the gnulib file has lines longer than 80 dnl columns. AC_DEFUN([gl_INCLUDE_NEXT], [ AC_LANG_PREPROC_REQUIRE() AC_CACHE_CHECK([whether the preprocessor supports include_next], [gl_cv_have_include_next], [rm -rf conftestd1a conftestd1b conftestd2 mkdir conftestd1a conftestd1b conftestd2 dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on dnl AIX 6.1 support include_next when used as first preprocessor directive dnl in a file, but not when preceded by another include directive. Check dnl for this bug by including . dnl Additionally, with this same compiler, include_next is a no-op when dnl used in a header file that was included by specifying its absolute dnl file name. Despite these two bugs, include_next is used in the dnl compiler's . By virtue of the second bug, we need to use dnl include_next as well in this case. cat < conftestd1a/conftest.h #define DEFINED_IN_CONFTESTD1 #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd1b/conftest.h #define DEFINED_IN_CONFTESTD1 #include #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd2/conftest.h #ifndef DEFINED_IN_CONFTESTD1 #error "include_next test doesn't work" #endif #define DEFINED_IN_CONFTESTD2 EOF gl_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" dnl We intentionally avoid using AC_LANG_SOURCE here. AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=yes], [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=buggy], [gl_cv_have_include_next=no]) ]) CPPFLAGS="$gl_save_CPPFLAGS" rm -rf conftestd1a conftestd1b conftestd2 ]) PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else if test $gl_cv_have_include_next = buggy; then INCLUDE_NEXT=include INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next else INCLUDE_NEXT=include INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include fi fi AC_SUBST([INCLUDE_NEXT]) AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) AC_CACHE_CHECK([whether system header files limit the line length], [gl_cv_pragma_columns], [dnl HP NonStop systems, which define __TANDEM, have this misfeature. AC_EGREP_CPP([choke me], [ #ifdef __TANDEM choke me #endif ], [gl_cv_pragma_columns=yes], [gl_cv_pragma_columns=no]) ]) if test $gl_cv_pragma_columns = yes; then PRAGMA_COLUMNS="#pragma COLUMNS 10000" else PRAGMA_COLUMNS= fi AC_SUBST([PRAGMA_COLUMNS]) ]) # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) # ------------------------------------------ # For each arg foo.h, if #include_next works, define NEXT_FOO_H to be # ''; otherwise define it to be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # Also, if #include_next works as first preprocessing directive in a file, # define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be ''; otherwise define it to # be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # That way, a header file with the following line: # #@INCLUDE_NEXT@ @NEXT_FOO_H@ # or # #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@ # behaves (after sed substitution) as if it contained # #include_next # even if the compiler does not support include_next. # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". # Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. # # This macro also checks whether each header exists, by invoking # AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument. AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ gl_NEXT_HEADERS_INTERNAL([$1], [check]) ]) # gl_NEXT_HEADERS(HEADER1 HEADER2 ...) # ------------------------------------ # Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist. # This is suitable for headers like that are standardized by C89 # and therefore can be assumed to exist. AC_DEFUN([gl_NEXT_HEADERS], [ gl_NEXT_HEADERS_INTERNAL([$1], [assume]) ]) # The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS. AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], [ AC_REQUIRE([gl_INCLUDE_NEXT]) AC_REQUIRE([AC_CANONICAL_HOST]) m4_if([$2], [check], [AC_CHECK_HEADERS_ONCE([$1]) ]) dnl FIXME: gl_next_header and gl_header_exists must be used unquoted dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_defn([gl_HEADER_NAME])) if test $gl_cv_have_include_next = yes; then AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_defn([gl_HEADER_NAME])[>], m4_defn([gl_next_header]), [m4_if([$2], [check], [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME])) if test AS_VAR_GET(gl_header_exists) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) AC_LANG_CONFTEST( [AC_LANG_SOURCE( [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] )]) dnl AIX "xlc -E" and "cc -E" omit #line directives for header dnl files that contain only a #include of other header files and dnl no non-comment tokens of their own. This leads to a failure dnl to detect the absolute name of , , dnl and others. The workaround is to force preservation dnl of comments through option -C. This ensures all necessary dnl #line directives are present. GCC supports option -C as well. case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac changequote(,) case "$host_os" in mingw*) dnl For the sake of native Windows compilers (excluding gcc), dnl treat backslash as a directory separator, like /. dnl Actually, these compilers use a double-backslash as dnl directory separator, inside the dnl # line "filename" dnl directives. gl_dirsep_regex='[/\\]' ;; *) gl_dirsep_regex='\/' ;; esac dnl A sed expression that turns a string into a basic regular dnl expression, for use within "/.../". gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' changequote([,]) gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \ | sed -e "$gl_make_literal_regex_sed"` gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ changequote(,)dnl s|^/[^/]|//&| changequote([,])dnl p q }' dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. AS_VAR_SET(gl_next_header, ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n "$gl_absolute_header_sed"`'"']) m4_if([$2], [check], [else AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) fi ]) ]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), [AS_VAR_GET(gl_next_header)]) if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' gl_next_as_first_directive='<'gl_HEADER_NAME'>' else # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' gl_next_as_first_directive=AS_VAR_GET(gl_next_header) fi AC_SUBST( AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), [$gl_next_as_first_directive]) AS_VAR_POPDEF([gl_next_header])]) ]) # Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE; # this fallback is safe for all earlier autoconf versions. m4_define_default([AC_LANG_DEFINES_PROVIDED]) amanda-3.3.6/config/gnulib/snprintf.m40000664000076400007640000000305512357250007021276 0ustar00martineamartinea00000000000000# snprintf.m4 serial 6 dnl Copyright (C) 2002-2004, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Libintl 0.17 will replace snprintf only if it does not support %1$s, dnl but defers to any gnulib snprintf replacements. Therefore, gnulib dnl must guarantee that the decision for replacing snprintf is a superset dnl of the reasons checked by libintl. AC_DEFUN([gl_FUNC_SNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_cv_func_snprintf_usable=no AC_CHECK_FUNCS([snprintf]) if test $ac_cv_func_snprintf = yes; then gl_SNPRINTF_SIZE1 case "$gl_cv_func_snprintf_size1" in *yes) gl_SNPRINTF_RETVAL_C99 case "$gl_cv_func_snprintf_retval_c99" in *yes) gl_PRINTF_POSITIONS case "$gl_cv_func_printf_positions" in *yes) gl_cv_func_snprintf_usable=yes ;; esac ;; esac ;; esac fi if test $gl_cv_func_snprintf_usable = no; then gl_REPLACE_SNPRINTF fi AC_CHECK_DECLS_ONCE([snprintf]) if test $ac_cv_have_decl_snprintf = no; then HAVE_DECL_SNPRINTF=0 fi ]) AC_DEFUN([gl_REPLACE_SNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_LIBOBJ([snprintf]) if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 fi gl_PREREQ_SNPRINTF ]) # Prerequisites of lib/snprintf.c. AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) amanda-3.3.6/config/gnulib/memchr.m40000664000076400007640000000534012357250007020705 0ustar00martineamartinea00000000000000# memchr.m4 serial 12 dnl Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_FUNC_MEMCHR], [ dnl Check for prerequisites for memory fence checks. gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ dnl These days, we assume memchr is present. But if support for old dnl platforms is desired: AC_CHECK_FUNCS_ONCE([memchr]) if test $ac_cv_func_memchr = no; then HAVE_MEMCHR=0 fi ]) if test $HAVE_MEMCHR = 1; then # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # http://bugzilla.redhat.com/499689 # memchr should not dereference overestimated length after a match # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 # Assume that memchr works on platforms that lack mprotect. AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #if HAVE_SYS_MMAN_H # include # include # include # include # ifndef MAP_FILE # define MAP_FILE 0 # endif #endif ]], [[ int result = 0; char *fence = NULL; #if HAVE_SYS_MMAN_H && HAVE_MPROTECT # if HAVE_MAP_ANONYMOUS const int flags = MAP_ANONYMOUS | MAP_PRIVATE; const int fd = -1; # else /* !HAVE_MAP_ANONYMOUS */ const int flags = MAP_FILE | MAP_PRIVATE; int fd = open ("/dev/zero", O_RDONLY, 0666); if (fd >= 0) # endif { int pagesize = getpagesize (); char *two_pages = (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, flags, fd, 0); if (two_pages != (char *)(-1) && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) fence = two_pages + pagesize; } #endif if (fence) { if (memchr (fence, 0, 0)) result |= 1; strcpy (fence - 9, "12345678"); if (memchr (fence - 9, 0, 79) != fence - 1) result |= 2; if (memchr (fence - 1, 0, 3) != fence - 1) result |= 4; } return result; ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], [dnl Be pessimistic for now. gl_cv_func_memchr_works="guessing no"])]) if test "$gl_cv_func_memchr_works" != yes; then REPLACE_MEMCHR=1 fi fi ]) # Prerequisites of lib/memchr.c. AC_DEFUN([gl_PREREQ_MEMCHR], [ AC_CHECK_HEADERS([bp-sym.h]) ]) amanda-3.3.6/config/gnulib/socklen.m40000664000076400007640000000623612357250007021075 0ustar00martineamartinea00000000000000# socklen.m4 serial 10 dnl Copyright (C) 2005-2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Albert Chin, Windows fixes from Simon Josefsson. dnl Check for socklen_t: historically on BSD it is an int, and in dnl POSIX 1g it is a type of its own, but some platforms use different dnl types for the argument to getsockopt, getpeername, etc.: dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. dnl So we have to test to find something that will work. AC_DEFUN([gl_TYPE_SOCKLEN_T], [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl AC_CHECK_TYPE([socklen_t], , [AC_MSG_CHECKING([for socklen_t equivalent]) AC_CACHE_VAL([gl_cv_socklen_t_equiv], [# Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername gl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t "unsigned int" "long int" "unsigned long int"; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include #include int getpeername (int, $arg2 *, $t *);]], [[$t len; getpeername (0, 0, &len);]])], [gl_cv_socklen_t_equiv="$t"]) test "$gl_cv_socklen_t_equiv" != "" && break done test "$gl_cv_socklen_t_equiv" != "" && break done ]) if test "$gl_cv_socklen_t_equiv" = ""; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) fi AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], [type to use in place of socklen_t if not defined])], [gl_SOCKET_HEADERS])]) dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users dnl of this module should use the same include pattern as gl_SOCKET_HEADERS. dnl When you change this macro, keep also in sync: dnl - gl_CHECK_SOCKET_HEADERS, dnl - the Include section of modules/socklen. AC_DEFUN([gl_SOCKET_HEADERS], [ /* is not needed according to POSIX, but the in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #if HAVE_SYS_SOCKET_H # include #elif HAVE_WS2TCPIP_H # include #endif ]) dnl Tests for the existence of the header for socket facilities. dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H. dnl This macro must match gl_SOCKET_HEADERS. AC_DEFUN([gl_CHECK_SOCKET_HEADERS], [AC_CHECK_HEADERS_ONCE([sys/socket.h]) if test $ac_cv_header_sys_socket_h = no; then dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make dnl the check for those headers unconditional; yet cygwin reports dnl that the headers are present but cannot be compiled (since on dnl cygwin, all socket information should come from sys/socket.h). AC_CHECK_HEADERS([ws2tcpip.h]) fi ]) amanda-3.3.6/config/gnulib/wint_t.m40000664000076400007640000000203512357250007020734 0ustar00martineamartinea00000000000000# wint_t.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include wint_t foo = (wchar_t)'\0';]], [[]])], [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) amanda-3.3.6/config/gnulib/secure_getenv.m40000664000076400007640000000143012357250007022264 0ustar00martineamartinea00000000000000# Look up an environment variable more securely. dnl Copyright 2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_SECURE_GETENV], [ dnl Persuade glibc to declare secure_getenv(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([secure_getenv]) if test $ac_cv_func_secure_getenv = no; then HAVE_SECURE_GETENV=0 fi ]) # Prerequisites of lib/secure_getenv.c. AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ AC_CHECK_FUNCS([__secure_getenv]) if test $ac_cv_func___secure_getenv = no; then AC_CHECK_FUNCS([issetugid]) fi ]) amanda-3.3.6/config/gnulib/environ.m40000664000076400007640000000261612357250007021115 0ustar00martineamartinea00000000000000# environ.m4 serial 6 dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_ENVIRON], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl Persuade glibc to declare environ. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([unistd.h]) gt_CHECK_VAR_DECL( [#if HAVE_UNISTD_H #include #endif /* mingw, BeOS, Haiku declare environ in , not in . */ #include ], [environ]) if test $gt_cv_var_environ_declaration != yes; then HAVE_DECL_ENVIRON=0 fi ]) # Check if a variable is properly declared. # gt_CHECK_VAR_DECL(includes,variable) AC_DEFUN([gt_CHECK_VAR_DECL], [ define([gt_cv_var], [gt_cv_var_]$2[_declaration]) AC_MSG_CHECKING([if $2 is properly declared]) AC_CACHE_VAL([gt_cv_var], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[$1 extern struct { int foo; } $2;]], [[$2.foo = 1;]])], [gt_cv_var=no], [gt_cv_var=yes])]) AC_MSG_RESULT([$gt_cv_var]) if test $gt_cv_var = yes; then AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, [Define if you have the declaration of $2.]) fi undefine([gt_cv_var]) ]) amanda-3.3.6/config/gnulib/stdlib_h.m40000664000076400007640000001310112357250007021214 0ustar00martineamartinea00000000000000# stdlib_h.m4 serial 42 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_NEXT_HEADERS([stdlib.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include #if HAVE_SYS_LOADAVG_H # include #endif #if HAVE_RANDOM_H # include #endif ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) ]) amanda-3.3.6/config/gnulib/group-member.m40000664000076400007640000000141212357250007022027 0ustar00martineamartinea00000000000000# serial 14 # Copyright (C) 1999-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl Written by Jim Meyering AC_DEFUN([gl_FUNC_GROUP_MEMBER], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl Persuade glibc to declare group_member(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl Do this replacement check manually because I want the hyphen dnl (not the underscore) in the filename. AC_CHECK_FUNC([group_member], , [ HAVE_GROUP_MEMBER=0 ]) ]) # Prerequisites of lib/group-member.c. AC_DEFUN([gl_PREREQ_GROUP_MEMBER], [ AC_REQUIRE([AC_FUNC_GETGROUPS]) ]) amanda-3.3.6/config/gnulib/off_t.m40000664000076400007640000000100612357250007020522 0ustar00martineamartinea00000000000000# off_t.m4 serial 1 dnl Copyright (C) 2012-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Check whether to override the 'off_t' type. dnl Set WINDOWS_64_BIT_OFF_T. AC_DEFUN([gl_TYPE_OFF_T], [ m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([gl_LARGEFILE]) ], [ WINDOWS_64_BIT_OFF_T=0 ]) AC_SUBST([WINDOWS_64_BIT_OFF_T]) ]) amanda-3.3.6/config/gnulib/gnulib-cache.m40000664000076400007640000000415512357250007021756 0ustar00martineamartinea00000000000000# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # 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 file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that # contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the specification of how gnulib-tool is used. # It acts as a cache: It is written and read by gnulib-tool. # In projects that use version control, this file is meant to be put under # version control, like the configure.ac and various Makefile.am files. # Specification in the form of a command-line invocation: # gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --no-conditional-dependencies --libtool --macro-prefix=gl base64 environ euidaccess fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt-gnu inet_pton lock lseek mkdtemp physmem regex # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ base64 environ euidaccess fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt-gnu inet_pton lock lseek mkdtemp physmem regex ]) gl_AVOID([]) gl_SOURCE_BASE([gnulib]) gl_M4_BASE([config/gnulib]) gl_PO_BASE([]) gl_DOC_BASE([doc]) gl_TESTS_BASE([tests]) gl_LIB([libgnu]) gl_MAKEFILE_NAME([]) gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) gl_WITNESS_C_MACRO([]) amanda-3.3.6/config/gnulib/stdint_h.m40000664000076400007640000000174312357250007021251 0ustar00martineamartinea00000000000000# stdint_h.m4 serial 9 dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[uintmax_t i = (uintmax_t) -1; return !i;]])], [gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) amanda-3.3.6/config/gnulib/exponentd.m40000664000076400007640000000755212357250007021445 0ustar00martineamartinea00000000000000# exponentd.m4 serial 3 dnl Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION], [ AC_CACHE_CHECK([where to find the exponent in a 'double'], [gl_cv_cc_double_expbit0], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #define NWORDS \ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { double value; unsigned int word[NWORDS]; } memory_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; static void add_to_ored_words (double x) { memory_double m; size_t i; /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ memset (&m, 0, sizeof (memory_double)); m.value = x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; anded_words[i] &= m.word[i]; } } int main () { size_t j; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; add_to_ored_words (0.25); add_to_ored_words (0.5); add_to_ored_words (1.0); add_to_ored_words (2.0); add_to_ored_words (4.0); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) ored_words[j] &= ~anded_words[j]; /* Now find the nonzero word. */ for (j = 0; j < NWORDS; j++) if (ored_words[j] != 0) break; if (j < NWORDS) { size_t i; for (i = j + 1; i < NWORDS; i++) if (ored_words[i] != 0) { fprintf (fp, "unknown"); return (fclose (fp) != 0); } for (i = 0; ; i++) if ((ored_words[j] >> i) & 1) { fprintf (fp, "word %d bit %d", (int) j, (int) i); return (fclose (fp) != 0); } } fprintf (fp, "unknown"); return (fclose (fp) != 0); } ]])], [gl_cv_cc_double_expbit0=`cat conftest.out`], [gl_cv_cc_double_expbit0="unknown"], [ dnl On ARM, there are two 'double' floating-point formats, used by dnl different sets of instructions: The older FPA instructions assume dnl that they are stored in big-endian word order, while the words dnl (like integer types) are stored in little-endian byte order. dnl The newer VFP instructions assume little-endian order dnl consistently. AC_EGREP_CPP([mixed_endianness], [ #if defined arm || defined __arm || defined __arm__ mixed_endianness #endif ], [gl_cv_cc_double_expbit0="unknown"], [ pushdef([AC_MSG_CHECKING],[:])dnl pushdef([AC_MSG_RESULT],[:])dnl pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl AC_C_BIGENDIAN( [gl_cv_cc_double_expbit0="word 0 bit 20"], [gl_cv_cc_double_expbit0="word 1 bit 20"], [gl_cv_cc_double_expbit0="unknown"]) popdef([AC_MSG_RESULT_UNQUOTED])dnl popdef([AC_MSG_RESULT])dnl popdef([AC_MSG_CHECKING])dnl ]) ]) rm -f conftest.out ]) case "$gl_cv_cc_double_expbit0" in word*bit*) word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word], [Define as the word index where to find the exponent of 'double'.]) AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit], [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.]) ;; esac ]) amanda-3.3.6/config/gnulib/getgroups.m40000664000076400007640000000712212357250007021451 0ustar00martineamartinea00000000000000# serial 18 dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. # Copyright (C) 1996-1997, 1999-2004, 2008-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ # This is taken from the following Autoconf patch: # http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 AC_DEFUN([AC_FUNC_GETGROUPS], [ AC_REQUIRE([AC_TYPE_GETGROUPS])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles AC_CHECK_FUNC([getgroups]) # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. ac_save_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd]) fi # Run the program to test the functionality of the system-supplied # getgroups function only if there is such a function. if test $ac_cv_func_getgroups = yes; then AC_CACHE_CHECK([for working getgroups], [ac_cv_func_getgroups_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[/* On Ultrix 4.3, getgroups (0, 0) always fails. */ return getgroups (0, 0) == -1;]]) ], [ac_cv_func_getgroups_works=yes], [ac_cv_func_getgroups_works=no], [case "$host_os" in # (( # Guess yes on glibc systems. *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;; # If we don't know, assume the worst. *) ac_cv_func_getgroups_works="guessing no" ;; esac ]) ]) else ac_cv_func_getgroups_works=no fi case "$ac_cv_func_getgroups_works" in *yes) AC_DEFINE([HAVE_GETGROUPS], [1], [Define to 1 if your system has a working `getgroups' function.]) ;; esac LIBS=$ac_save_LIBS ])# AC_FUNC_GETGROUPS ]) AC_DEFUN([gl_FUNC_GETGROUPS], [ AC_REQUIRE([AC_TYPE_GETGROUPS]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_FUNC_GETGROUPS if test $ac_cv_func_getgroups != yes; then HAVE_GETGROUPS=0 else if test "$ac_cv_type_getgroups" != gid_t \ || { case "$ac_cv_func_getgroups_works" in *yes) false;; *) true;; esac }; then REPLACE_GETGROUPS=1 AC_DEFINE([GETGROUPS_ZERO_BUG], [1], [Define this to 1 if getgroups(0,NULL) does not return the number of groups.]) else dnl Detect FreeBSD bug; POSIX requires getgroups(-1,ptr) to fail. AC_CACHE_CHECK([whether getgroups handles negative values], [gl_cv_func_getgroups_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[int size = getgroups (0, 0); gid_t *list = malloc (size * sizeof *list); return getgroups (-1, list) != -1;]])], [gl_cv_func_getgroups_works=yes], [gl_cv_func_getgroups_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_getgroups_works="guessing yes" ;; # If we don't know, assume the worst. *) gl_cv_func_getgroups_works="guessing no" ;; esac ])]) case "$gl_cv_func_getgroups_works" in *yes) ;; *) REPLACE_GETGROUPS=1 ;; esac fi fi test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS" ]) amanda-3.3.6/config/gnulib/fcntl_h.m40000664000076400007640000000327112357250007021050 0ustar00martineamartinea00000000000000# serial 15 # Configure fcntl.h. dnl Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. AC_DEFUN([gl_FCNTL_H], [ AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) AC_REQUIRE([gl_FCNTL_O_FLAGS]) gl_NEXT_HEADERS([fcntl.h]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include ]], [fcntl openat]) ]) AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) ]) amanda-3.3.6/config/gnulib/pathmax.m40000664000076400007640000000220412357250007021070 0ustar00martineamartinea00000000000000# pathmax.m4 serial 10 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_PATHMAX], [ dnl Prerequisites of lib/pathmax.h. AC_CHECK_HEADERS_ONCE([sys/param.h]) ]) # Expands to a piece of C program that defines PATH_MAX in the same way as # "pathmax.h" will do. AC_DEFUN([gl_PATHMAX_SNIPPET], [[ /* Arrange to define PATH_MAX, like "pathmax.h" does. */ #if HAVE_UNISTD_H # include #endif #include #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifdef __hpux # undef PATH_MAX # define PATH_MAX 1024 #endif #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif ]]) # Prerequisites of gl_PATHMAX_SNIPPET. AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], [ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) ]) amanda-3.3.6/config/gnulib/largefile.m40000664000076400007640000001233212357250007021363 0ustar00martineamartinea00000000000000# Enable large files on systems where this is not the default. # Copyright 1992-1996, 1998-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # The following implementation works around a problem in autoconf <= 2.69; # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. m4_version_prereq([2.70], [] ,[ # _AC_SYS_LARGEFILE_TEST_INCLUDES # ------------------------------- m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], [@%:@include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ @%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl ]) # _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, # CACHE-VAR, # DESCRIPTION, # PROLOGUE, [FUNCTION-BODY]) # -------------------------------------------------------- m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], [AC_CACHE_CHECK([for $1 value needed for large files], [$3], [while :; do m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( [AC_LANG_PROGRAM([$5], [$6])], [$3=no; break]) m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( [AC_LANG_PROGRAM([@%:@define $1 $2 $5], [$6])], [$3=$2; break]) $3=unknown break done]) case $$3 in #( no | unknown) ;; *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);; esac rm -rf conftest*[]dnl ])# _AC_SYS_LARGEFILE_MACRO_VALUE # AC_SYS_LARGEFILE # ---------------- # By default, many hosts won't let programs access large files; # one must use special compiler options to get large-file access to work. # For more details about this brain damage please see: # http://www.unix-systems.org/version2/whatsnew/lfs20mar.html AC_DEFUN([AC_SYS_LARGEFILE], [AC_ARG_ENABLE(largefile, [ --disable-largefile omit support for large files]) if test "$enable_largefile" != no; then AC_CACHE_CHECK([for special C compiler options needed for large files], ac_cv_sys_largefile_CC, [ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) AC_COMPILE_IFELSE([], [break]) CC="$CC -n32" AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) break done CC=$ac_save_CC rm -f conftest.$ac_ext fi]) if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits, [Number of bits in a file offset, on hosts where this is settable.], [_AC_SYS_LARGEFILE_TEST_INCLUDES]) if test $ac_cv_sys_file_offset_bits = unknown; then _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files, [Define for large files, on AIX-style hosts.], [_AC_SYS_LARGEFILE_TEST_INCLUDES]) fi AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1], [Enable large inode numbers on Mac OS X 10.5.]) fi ])# AC_SYS_LARGEFILE ])# m4_version_prereq 2.70 # Enable large files on systems where this is implemented by Gnulib, not by the # system headers. # Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib # overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively. AC_DEFUN([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw*) dnl Native Windows. dnl mingw64 defines off_t to a 64-bit type already, if dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; ]], [[]])], [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) ]) if test $gl_cv_type_off_t_64 = no; then WINDOWS_64_BIT_OFF_T=1 else WINDOWS_64_BIT_OFF_T=0 fi dnl But all native Windows platforms (including mingw64) have a 32-bit dnl st_size member in 'struct stat'. WINDOWS_64_BIT_ST_SIZE=1 ;; *) dnl Nothing to do on gnulib's side. dnl A 64-bit off_t is dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, dnl OSF/1, Cygwin, dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on dnl glibc, HP-UX, Solaris, dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, dnl - impossible to achieve on Minix 3.1.8. WINDOWS_64_BIT_OFF_T=0 WINDOWS_64_BIT_ST_SIZE=0 ;; esac ]) amanda-3.3.6/config/gnulib/servent.m40000664000076400007640000000336212357250007021122 0ustar00martineamartinea00000000000000# servent.m4 serial 2 dnl Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SERVENT], [ dnl Where are getservent(), setservent(), endservent(), getservbyname(), dnl getservbyport() defined? dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(), dnl getprotobynumber() defined? dnl - On Solaris, they are in libsocket. Ignore libxnet. dnl - On Haiku, they are in libnetwork. dnl - On BeOS, they are in libnet. dnl - On native Windows, they are in ws2_32.dll. dnl - Otherwise they are in libc. AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H SERVENT_LIB= gl_saved_libs="$LIBS" AC_SEARCH_LIBS([getservbyname], [socket network net], [if test "$ac_cv_search_getservbyname" != "none required"; then SERVENT_LIB="$ac_cv_search_getservbyname" fi]) LIBS="$gl_saved_libs" if test -z "$SERVENT_LIB"; then AC_CHECK_FUNCS([getservbyname], , [ AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32], [gl_cv_w32_getservbyname], [gl_cv_w32_getservbyname=no gl_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_WINSOCK2_H #include #endif #include ]], [[getservbyname(NULL,NULL);]])], [gl_cv_w32_getservbyname=yes]) LIBS="$gl_save_LIBS" ]) if test "$gl_cv_w32_getservbyname" = "yes"; then SERVENT_LIB="-lws2_32" fi ]) fi AC_SUBST([SERVENT_LIB]) ]) amanda-3.3.6/config/gnulib/localcharset.m40000664000076400007640000000112512357250007022073 0ustar00martineamartinea00000000000000# localcharset.m4 serial 7 dnl Copyright (C) 2002, 2004, 2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) AC_REQUIRE([gl_FCNTL_O_FLAGS]) AC_CHECK_DECLS_ONCE([getc_unlocked]) dnl Prerequisites of the lib/Makefile.am snippet. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_GLIBC21]) ]) amanda-3.3.6/config/gnulib/signal_h.m40000664000076400007640000000604212357250007021216 0ustar00martineamartinea00000000000000# signal_h.m4 serial 18 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SIGNAL_H], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) gl_NEXT_HEADERS([signal.h]) # AIX declares sig_atomic_t to already include volatile, and C89 compilers # then choke on 'volatile sig_atomic_t'. C99 requires that it compile. AC_CHECK_TYPE([volatile sig_atomic_t], [], [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[ #include ]]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) AC_REQUIRE([AC_TYPE_UID_T]) dnl Persuade glibc to define sighandler_t. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[ #include ]]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask]) ]) AC_DEFUN([gl_CHECK_TYPE_SIGSET_T], [ AC_CHECK_TYPES([sigset_t], [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], [[ #include /* Mingw defines sigset_t not in , but in . */ #include ]]) if test $gl_cv_type_sigset_t != yes; then HAVE_SIGSET_T=0 fi ]) AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SIGNAL_H_DEFAULTS], [ GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK]) GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE]) GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK]) GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK]) HAVE_RAISE=1; AC_SUBST([HAVE_RAISE]) HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T]) HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T]) HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T]) REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK]) REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE]) ]) amanda-3.3.6/config/gnulib/stdalign.m40000664000076400007640000000376212357250007021245 0ustar00martineamartinea00000000000000# Check for stdalign.h that conforms to C11. dnl Copyright 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prepare for substituting if it is not supported. AC_DEFUN([gl_STDALIGN_H], [ AC_CACHE_CHECK([for working stdalign.h], [gl_cv_header_working_stdalign_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #include /* Test that alignof yields a result consistent with offsetof. This catches GCC bug 52023 . */ #ifdef __cplusplus template struct alignof_helper { char a; t b; }; # define ao(type) offsetof (alignof_helper, b) #else # define ao(type) offsetof (struct { char a; type b; }, b) #endif char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; /* Test _Alignas only on platforms where gnulib can help. */ #if \ (__GNUC__ || __IBMC__ || __IBMCPP__ \ || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER) struct alignas_test { char c; char alignas (8) alignas_8; }; char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 ? 1 : -1]; #endif ]])], [gl_cv_header_working_stdalign_h=yes], [gl_cv_header_working_stdalign_h=no])]) if test $gl_cv_header_working_stdalign_h = yes; then STDALIGN_H='' else STDALIGN_H='stdalign.h' fi AC_SUBST([STDALIGN_H]) AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) ]) amanda-3.3.6/config/gnulib/gnulib-tool.m40000664000076400007640000000264712357250007021674 0ustar00martineamartinea00000000000000# gnulib-tool.m4 serial 2 dnl Copyright (C) 2004-2005, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl The following macros need not be invoked explicitly. dnl Invoking them does nothing except to declare default arguments dnl for "gnulib-tool --import". dnl Usage: gl_LOCAL_DIR([DIR]) AC_DEFUN([gl_LOCAL_DIR], []) dnl Usage: gl_MODULES([module1 module2 ...]) AC_DEFUN([gl_MODULES], []) dnl Usage: gl_AVOID([module1 module2 ...]) AC_DEFUN([gl_AVOID], []) dnl Usage: gl_SOURCE_BASE([DIR]) AC_DEFUN([gl_SOURCE_BASE], []) dnl Usage: gl_M4_BASE([DIR]) AC_DEFUN([gl_M4_BASE], []) dnl Usage: gl_PO_BASE([DIR]) AC_DEFUN([gl_PO_BASE], []) dnl Usage: gl_DOC_BASE([DIR]) AC_DEFUN([gl_DOC_BASE], []) dnl Usage: gl_TESTS_BASE([DIR]) AC_DEFUN([gl_TESTS_BASE], []) dnl Usage: gl_WITH_TESTS AC_DEFUN([gl_WITH_TESTS], []) dnl Usage: gl_LIB([LIBNAME]) AC_DEFUN([gl_LIB], []) dnl Usage: gl_LGPL or gl_LGPL([VERSION]) AC_DEFUN([gl_LGPL], []) dnl Usage: gl_MAKEFILE_NAME([FILENAME]) AC_DEFUN([gl_MAKEFILE_NAME], []) dnl Usage: gl_LIBTOOL AC_DEFUN([gl_LIBTOOL], []) dnl Usage: gl_MACRO_PREFIX([PREFIX]) AC_DEFUN([gl_MACRO_PREFIX], []) dnl Usage: gl_PO_DOMAIN([DOMAIN]) AC_DEFUN([gl_PO_DOMAIN], []) dnl Usage: gl_VC_FILES([BOOLEAN]) AC_DEFUN([gl_VC_FILES], []) amanda-3.3.6/config/gnulib/sys_time_h.m40000664000076400007640000000734112357250007021600 0ustar00martineamartinea00000000000000# Configure a replacement for . # serial 8 # Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert and Martin Lambers. AC_DEFUN([gl_HEADER_SYS_TIME_H], [ dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 dnl statements that occur in other macros. AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) ]) AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) gl_CHECK_NEXT_HEADERS([sys/time.h]) if test $ac_cv_header_sys_time_h != yes; then HAVE_SYS_TIME_H=0 fi dnl On native Windows with MSVC, 'struct timeval' is defined in dnl only. So include that header in the list. gl_PREREQ_SYS_H_WINSOCK2 AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#if HAVE_SYS_TIME_H #include #endif #include #if HAVE_WINSOCK2_H # include #endif ]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])], [gl_cv_sys_struct_timeval=yes], [gl_cv_sys_struct_timeval=no]) ]) if test $gl_cv_sys_struct_timeval != yes; then HAVE_STRUCT_TIMEVAL=0 else dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined dnl (in and for mingw64, in only dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is dnl smaller than the 'time_t' type mandated by POSIX. dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but dnl that is good enough. AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], [gl_cv_sys_struct_timeval_tv_sec], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#if HAVE_SYS_TIME_H #include #endif #include #if HAVE_WINSOCK2_H # include #endif ]], [[static struct timeval x; typedef int verify_tv_sec_type[ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 ]; ]])], [gl_cv_sys_struct_timeval_tv_sec=yes], [gl_cv_sys_struct_timeval_tv_sec=no]) ]) if test $gl_cv_sys_struct_timeval_tv_sec != yes; then REPLACE_STRUCT_TIMEVAL=1 fi fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_SYS_TIME_H # include #endif #include ]], [gettimeofday]) ]) AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], [ GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) dnl Assume POSIX behavior unless another module says otherwise. HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) ]) amanda-3.3.6/config/gnulib/locale-zh.m40000664000076400007640000001222612357250007021311 0ustar00martineamartinea00000000000000# locale-zh.m4 serial 12 dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Determine the name of a chinese locale with GB18030 encoding. AC_DEFUN([gt_LOCALE_ZH_CN], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([ changequote(,)dnl #include #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { const char *p; /* Check whether the given locale name is recognized by the system. */ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; #else if (setlocale (LC_ALL, "") == NULL) return 1; #endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ #if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } #endif #ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; #endif /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; for (p = buf; *p != '\0'; p++) if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) return 1; /* Check whether a typical GB18030 multibyte sequence is recognized as a single wide character. This excludes the GB2312 and GBK encodings. */ if (mblen ("\203\062\332\066", 5) != 4) return 1; return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. mingw*) # Test for the hypothetical native Windows locale name. if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=Chinese_China.54936 else # None found. gt_cv_locale_zh_CN=none fi ;; solaris2.8) # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. gt_cv_locale_zh_CN=none ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the locale name without encoding suffix. if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=zh_CN else # Test for the locale name with explicit encoding suffix. if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=zh_CN.GB18030 else # None found. gt_cv_locale_zh_CN=none fi fi ;; esac else # If there was a link error, due to mblen(), the system is so old that # it certainly doesn't have a chinese locale. gt_cv_locale_zh_CN=none fi rm -fr conftest* ]) LOCALE_ZH_CN=$gt_cv_locale_zh_CN AC_SUBST([LOCALE_ZH_CN]) ]) amanda-3.3.6/config/gnulib/sys_uio_h.m40000664000076400007640000000165412357250007021437 0ustar00martineamartinea00000000000000# sys_uio_h.m4 serial 1 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_HEADER_SYS_UIO], [ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([sys/uio.h]) if test $ac_cv_header_sys_uio_h = yes; then HAVE_SYS_UIO_H=1 else HAVE_SYS_UIO_H=0 fi AC_SUBST([HAVE_SYS_UIO_H]) ]) AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_UIO_H_DEFAULTS], [ ]) amanda-3.3.6/config/gnulib/unistd_h.m40000664000076400007640000002143412357250007021251 0ustar00martineamartinea00000000000000# unistd_h.m4 serial 66 dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson, Bruno Haible. AC_DEFUN([gl_UNISTD_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([unistd.h]) if test $ac_cv_header_unistd_h = yes; then HAVE_UNISTD_H=1 else HAVE_UNISTD_H=0 fi AC_SUBST([HAVE_UNISTD_H]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Determine WINDOWS_64_BIT_OFF_T. AC_REQUIRE([gl_TYPE_OFF_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_UNISTD_H # include #endif /* Some systems declare various items in the wrong headers. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include # include # include # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # include # endif #endif ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) GNULIB_READ=0; AC_SUBST([GNULIB_READ]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) ]) amanda-3.3.6/config/gnulib/locale-ja.m40000664000076400007640000001260312357250007021261 0ustar00martineamartinea00000000000000# locale-ja.m4 serial 12 dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Determine the name of a japanese locale with EUC-JP encoding. AC_DEFUN([gt_LOCALE_JA], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([ changequote(,)dnl #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { const char *p; /* Check whether the given locale name is recognized by the system. */ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; #else if (setlocale (LC_ALL, "") == NULL) return 1; #endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ #if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } #endif #ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; #endif /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales on Cygwin 1.5.x. */ if (MB_CUR_MAX == 1) return 1; /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; for (p = buf; *p != '\0'; p++) if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) return 1; return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. mingw*) # Note that on native Windows, the Japanese locale is # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we # cannot use it here. gt_cv_locale_ja=none ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the AIX locale name. if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP else # Test for the locale name with explicit encoding suffix. if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC-JP else # Test for the HP-UX, OSF/1, NetBSD locale name. if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.eucJP else # Test for the IRIX, FreeBSD locale name. if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC else # Test for the Solaris 7 locale name. if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja else # Special test for NetBSD 1.6. if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then gt_cv_locale_ja=ja_JP.eucJP else # None found. gt_cv_locale_ja=none fi fi fi fi fi fi ;; esac fi rm -fr conftest* ]) LOCALE_JA=$gt_cv_locale_ja AC_SUBST([LOCALE_JA]) ]) amanda-3.3.6/config/gnulib/mbstate_t.m40000664000076400007640000000256712357250007021424 0ustar00martineamartinea00000000000000# mbstate_t.m4 serial 13 dnl Copyright (C) 2000-2002, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # From Paul Eggert. # BeOS 5 has but does not define mbstate_t, # so you can't declare an object of that type. # Check for this incompatibility with Standard C. # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11 AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include ]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then AC_DEFINE([HAVE_MBSTATE_T], [1], [Define to 1 if declares mbstate_t.]) else AC_DEFINE([mbstate_t], [int], [Define to a type if does not define.]) fi ]) amanda-3.3.6/config/gnulib/wchar_t.m40000664000076400007640000000146212357250007021062 0ustar00martineamartinea00000000000000# wchar_t.m4 serial 4 (gettext-0.18.2) dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include wchar_t foo = (wchar_t)'\0';]], [[]])], [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi ]) amanda-3.3.6/config/gnulib/getopt.m40000664000076400007640000003013412357250007020733 0ustar00martineamartinea00000000000000# getopt.m4 serial 44 dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Request a POSIX compliant getopt function. AC_DEFUN([gl_FUNC_GETOPT_POSIX], [ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) dnl Other modules can request the gnulib implementation of the getopt dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. dnl argp.m4 does this. m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ REPLACE_GETOPT=1 ], [ REPLACE_GETOPT=0 if test -n "$gl_replace_getopt"; then REPLACE_GETOPT=1 fi ]) if test $REPLACE_GETOPT = 1; then dnl Arrange for getopt.h to be created. gl_GETOPT_SUBSTITUTE_HEADER fi ]) # Request a POSIX compliant getopt function with GNU extensions (such as # options with optional arguments) and the functions getopt_long, # getopt_long_only. AC_DEFUN([gl_FUNC_GETOPT_GNU], [ m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) ]) # Determine whether to replace the entire getopt facility. AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON dnl Persuade Solaris to declare optarg, optind, opterr, optopt. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) gl_CHECK_NEXT_HEADERS([getopt.h]) if test $ac_cv_header_getopt_h = yes; then HAVE_GETOPT_H=1 else HAVE_GETOPT_H=0 fi AC_SUBST([HAVE_GETOPT_H]) gl_replace_getopt= dnl Test whether is available. if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes]) fi dnl Test whether the function getopt_long is available. if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) fi dnl POSIX 2008 does not specify leading '+' behavior, but see dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on dnl the next version of POSIX. For now, we only guarantee leading '+' dnl behavior with getopt-gnu. if test -z "$gl_replace_getopt"; then AC_CACHE_CHECK([whether getopt is POSIX compatible], [gl_cv_func_getopt_posix], [ dnl Merging these three different test programs into a single one dnl would require a reset mechanism. On BSD systems, it can be done dnl through 'optreset'; on some others (glibc), it can be done by dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1, dnl Solaris 9, musl libc), there is no such mechanism. if test $cross_compiling = no; then dnl Sanity check. Succeeds everywhere (except on MSVC, dnl which lacks and getopt() entirely). AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char a[] = "-a"; static char foo[] = "foo"; static char bar[] = "bar"; char *argv[] = { program, a, foo, bar, NULL }; int c; c = getopt (4, argv, "ab"); if (!(c == 'a')) return 1; c = getopt (4, argv, "ab"); if (!(c == -1)) return 2; if (!(optind == 2)) return 3; return 0; } ]])], [gl_cv_func_getopt_posix=maybe], [gl_cv_func_getopt_posix=no]) if test $gl_cv_func_getopt_posix = maybe; then dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, dnl which lacks and getopt() entirely). AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char donald[] = "donald"; static char p[] = "-p"; static char billy[] = "billy"; static char duck[] = "duck"; static char a[] = "-a"; static char bar[] = "bar"; char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; int c; c = getopt (7, argv, "+abp:q:"); if (!(c == -1)) return 4; if (!(strcmp (argv[0], "program") == 0)) return 5; if (!(strcmp (argv[1], "donald") == 0)) return 6; if (!(strcmp (argv[2], "-p") == 0)) return 7; if (!(strcmp (argv[3], "billy") == 0)) return 8; if (!(strcmp (argv[4], "duck") == 0)) return 9; if (!(strcmp (argv[5], "-a") == 0)) return 10; if (!(strcmp (argv[6], "bar") == 0)) return 11; if (!(optind == 1)) return 12; return 0; } ]])], [gl_cv_func_getopt_posix=maybe], [gl_cv_func_getopt_posix=no]) fi if test $gl_cv_func_getopt_posix = maybe; then dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char ab[] = "-ab"; char *argv[3] = { program, ab, NULL }; if (getopt (2, argv, "ab:") != 'a') return 13; if (getopt (2, argv, "ab:") != '?') return 14; if (optopt != 'b') return 15; if (optind != 2) return 16; return 0; } ]])], [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no]) fi else case "$host_os" in darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; *) gl_cv_func_getopt_posix="guessing yes";; esac fi ]) case "$gl_cv_func_getopt_posix" in *no) gl_replace_getopt=yes ;; esac fi if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu], [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the # optstring is necessary for programs like m4 that have POSIX-mandated # semantics for supporting options interspersed with files. # Also, since getopt_long is a GNU extension, we require optind=0. # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; # so take care to revert to the correct (non-)export state. dnl GNU Coding Standards currently allow awk but not env; besides, env dnl is ambiguous with environment values that contain newlines. gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" #include #include ]GL_NOCRASH[ ]], [[ int result = 0; nocrash_init(); /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10. */ { static char conftest[] = "conftest"; static char plus[] = "-+"; char *argv[3] = { conftest, plus, NULL }; opterr = 0; if (getopt (2, argv, "+a") != '?') result |= 1; } /* This code succeeds on glibc 2.8, mingw, and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */ { static char program[] = "program"; static char p[] = "-p"; static char foo[] = "foo"; static char bar[] = "bar"; char *argv[] = { program, p, foo, bar, NULL }; optind = 1; if (getopt (4, argv, "p::") != 'p') result |= 2; else if (optarg != NULL) result |= 4; else if (getopt (4, argv, "p::") != -1) result |= 6; else if (optind != 2) result |= 8; } /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ { static char program[] = "program"; static char foo[] = "foo"; static char p[] = "-p"; char *argv[] = { program, foo, p, NULL }; optind = 0; if (getopt (3, argv, "-p") != 1) result |= 16; else if (getopt (3, argv, "-p") != 'p') result |= 16; } /* This code fails on glibc 2.11. */ { static char program[] = "program"; static char b[] = "-b"; static char a[] = "-a"; char *argv[] = { program, b, a, NULL }; optind = opterr = 0; if (getopt (3, argv, "+:a:b") != 'b') result |= 32; else if (getopt (3, argv, "+:a:b") != ':') result |= 32; } /* This code dumps core on glibc 2.14. */ { static char program[] = "program"; static char w[] = "-W"; static char dummy[] = "dummy"; char *argv[] = { program, w, dummy, NULL }; optind = opterr = 1; if (getopt (3, argv, "W;") != 'W') result |= 64; } return result; ]])], [gl_cv_func_getopt_gnu=yes], [gl_cv_func_getopt_gnu=no], [dnl Cross compiling. Assume the worst, even on glibc platforms. gl_cv_func_getopt_gnu="guessing no" ]) case $gl_had_POSIXLY_CORRECT in exported) ;; yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;; *) AS_UNSET([POSIXLY_CORRECT]) ;; esac ]) if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes else AC_CACHE_CHECK([for working GNU getopt_long function], [gl_cv_func_getopt_long_gnu], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #include ]], [[static const struct option long_options[] = { { "xtremely-",no_argument, NULL, 1003 }, { "xtra", no_argument, NULL, 1001 }, { "xtreme", no_argument, NULL, 1002 }, { "xtremely", no_argument, NULL, 1003 }, { NULL, 0, NULL, 0 } }; /* This code fails on OpenBSD 5.0. */ { static char program[] = "program"; static char xtremel[] = "--xtremel"; char *argv[] = { program, xtremel, NULL }; int option_index; optind = 1; opterr = 0; if (getopt_long (2, argv, "", long_options, &option_index) != 1003) return 1; } return 0; ]])], [gl_cv_func_getopt_long_gnu=yes], [gl_cv_func_getopt_long_gnu=no], [dnl Cross compiling. Guess no on OpenBSD, yes otherwise. case "$host_os" in openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; *) gl_cv_func_getopt_long_gnu="guessing yes";; esac ]) ]) case "$gl_cv_func_getopt_long_gnu" in *yes) ;; *) gl_replace_getopt=yes ;; esac fi fi ]) AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ GETOPT_H=getopt.h AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) AC_SUBST([GETOPT_H]) ]) # Prerequisites of lib/getopt*. AC_DEFUN([gl_PREREQ_GETOPT], [ AC_CHECK_DECLS_ONCE([getenv]) ]) amanda-3.3.6/config/gnulib/stdint.m40000664000076400007640000003701412357250007020742 0ustar00martineamartinea00000000000000# stdint.m4 serial 43 dnl Copyright (C) 2001-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi AC_SUBST([HAVE_LONG_LONG_INT]) AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) dnl Check for , in the same way as gl_WCHAR_H does. AC_CHECK_HEADERS_ONCE([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi AC_SUBST([HAVE_SYS_TYPES_H]) gl_CHECK_NEXT_HEADERS([stdint.h]) if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi AC_SUBST([HAVE_STDINT_H]) dnl Now see whether we need a substitute . if test $ac_cv_header_stdint_h = yes; then AC_CACHE_CHECK([whether stdint.h conforms to C99], [gl_cv_header_working_stdint_h], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) #error "WCHAR_MIN, WCHAR_MAX not defined in " #endif ] gl_STDINT_INCLUDES [ #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) #define TYPE_MAXIMUM(t) \ ((t) ((t) 0 < (t) -1 \ ? (t) -1 \ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; /* Detect bug in FreeBSD 6.0 / ia64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) ? 1 : -1; int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; int check_WCHAR: WCHAR_MIN == TYPE_MINIMUM (wchar_t) && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) ? 1 : -1; /* Detect bug in mingw. */ int check_WINT: WINT_MIN == TYPE_MINIMUM (wint_t) && WINT_MAX == TYPE_MAXIMUM (wint_t) ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], [dnl Determine whether the various *_MIN, *_MAX macros are usable dnl in preprocessor expression. We could do it by compiling a test dnl program for each of these macros. It is faster to run a program dnl that inspects the macro expansion. dnl This detects a bug on HP-UX 11.23/ia64. AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include ] gl_STDINT_INCLUDES [ #include #include #define MVAL(macro) MVAL1(macro) #define MVAL1(expression) #expression static const char *macro_values[] = { #ifdef INT8_MAX MVAL (INT8_MAX), #endif #ifdef INT16_MAX MVAL (INT16_MAX), #endif #ifdef INT32_MAX MVAL (INT32_MAX), #endif #ifdef INT64_MAX MVAL (INT64_MAX), #endif #ifdef UINT8_MAX MVAL (UINT8_MAX), #endif #ifdef UINT16_MAX MVAL (UINT16_MAX), #endif #ifdef UINT32_MAX MVAL (UINT32_MAX), #endif #ifdef UINT64_MAX MVAL (UINT64_MAX), #endif NULL }; ]], [[ const char **mv; for (mv = macro_values; *mv != NULL; mv++) { const char *value = *mv; /* Test whether it looks like a cast expression. */ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 || strncmp (value, "((int)"/*)*/, 6) == 0 || strncmp (value, "((signed short)"/*)*/, 15) == 0 || strncmp (value, "((signed char)"/*)*/, 14) == 0) return mv - macro_values + 1; } return 0; ]])], [gl_cv_header_working_stdint_h=yes], [], [dnl When cross-compiling, assume it works. gl_cv_header_working_stdint_h=yes ]) ]) ]) fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi AC_SUBST([HAVE_SYS_BITYPES_H]) gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi AC_SUBST([STDINT_H]) AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) dnl Determine the size of each of the given types in bits. AC_DEFUN([gl_STDINT_BITSIZEOF], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], [$2 #include ], [result=unknown]) eval gl_cv_bitsizeof_${gltype}=\$result ]) eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, dnl do a syntax check even on unused #if conditions and give an error dnl on valid C code like this: dnl #if 0 dnl # if > 32 dnl # endif dnl #endif result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) eval BITSIZEOF_${GLTYPE}=\$result done m4_foreach_w([gltype], [$1], [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) dnl Determine the signedness of each of the given types. dnl Define HAVE_SIGNED_TYPE if type is signed. AC_DEFUN([gl_CHECK_TYPES_SIGNED], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], result=yes, result=no) eval gl_cv_type_${gltype}_signed=\$result ]) eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done m4_foreach_w([gltype], [$1], [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) dnl Determine the suffix to use for integer constants of the given types. dnl Define t_SUFFIX for each such type. AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for $gltype integer literal suffix], [gl_cv_type_${gltype}_suffix], [eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ extern $gltype foo; extern $gltype1 foo;]])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif ]]) dnl gl_STDINT_TYPE_PROPERTIES dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t dnl of interest to stdint.in.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ AC_REQUIRE([gl_MULTIARCH]) if test $APPLE_UNIVERSAL_BUILD = 0; then gl_STDINT_BITSIZEOF([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) fi gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no if test $APPLE_UNIVERSAL_BUILD = 0; then gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) fi gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's and override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. if test $BITSIZEOF_WINT_T -lt 32; then BITSIZEOF_WINT_T=32 fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) # Hey Emacs! # Local Variables: # indent-tabs-mode: nil # End: amanda-3.3.6/config/gnulib/locale_h.m40000664000076400007640000001040112357250007021172 0ustar00martineamartinea00000000000000# locale_h.m4 serial 19 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LOCALE_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) dnl Persuade glibc to define locale_t and the int_p_*, int_n_* dnl members of 'struct lconv'. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl If is replaced, then must also be replaced. AC_REQUIRE([gl_STDDEF_H]) dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv' dnl only if _LCONV_C99 is defined. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in solaris*) AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) ;; esac AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], [gl_cv_header_locale_h_posix2001], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = LC_MESSAGES; int y = sizeof (((struct lconv *) 0)->decimal_point);]], [[]])], [gl_cv_header_locale_h_posix2001=yes], [gl_cv_header_locale_h_posix2001=no])]) dnl Check for . AC_CHECK_HEADERS_ONCE([xlocale.h]) if test $ac_cv_header_xlocale_h = yes; then HAVE_XLOCALE_H=1 dnl Check whether use of locale_t requires inclusion of , dnl e.g. on Mac OS X 10.5. If does not define locale_t by dnl itself, we assume that will do so. AC_CACHE_CHECK([whether locale.h defines locale_t], [gl_cv_header_locale_has_locale_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include locale_t x;]], [[]])], [gl_cv_header_locale_has_locale_t=yes], [gl_cv_header_locale_has_locale_t=no]) ]) if test $gl_cv_header_locale_has_locale_t = yes; then gl_cv_header_locale_h_needs_xlocale_h=no else gl_cv_header_locale_h_needs_xlocale_h=yes fi else HAVE_XLOCALE_H=0 gl_cv_header_locale_h_needs_xlocale_h=no fi AC_SUBST([HAVE_XLOCALE_H]) dnl Check whether 'struct lconv' is complete. dnl Bionic libc's 'struct lconv' is just a dummy. dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. AC_CACHE_CHECK([whether struct lconv is properly defined], [gl_cv_sys_struct_lconv_ok], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include struct lconv l; int x = sizeof (l.decimal_point); int y = sizeof (l.int_p_cs_precedes);]], [[]])], [gl_cv_sys_struct_lconv_ok=yes], [gl_cv_sys_struct_lconv_ok=no]) ]) if test $gl_cv_sys_struct_lconv_ok = no; then REPLACE_STRUCT_LCONV=1 fi dnl is always overridden, because of GNULIB_POSIXCHECK. gl_NEXT_HEADERS([locale.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include /* Some systems provide declarations in a non-standard header. */ #if HAVE_XLOCALE_H # include #endif ]], [setlocale duplocale]) ]) AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_LOCALE_H_DEFAULTS], [ GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV]) GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE]) GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) ]) amanda-3.3.6/config/gnulib/netinet_in_h.m40000664000076400007640000000207512357250007022077 0ustar00martineamartinea00000000000000# netinet_in_h.m4 serial 5 dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_HEADER_NETINET_IN], [ AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_netinet_in_h_selfcontained], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [gl_cv_header_netinet_in_h_selfcontained=yes], [gl_cv_header_netinet_in_h_selfcontained=no]) ]) if test $gl_cv_header_netinet_in_h_selfcontained = yes; then NETINET_IN_H='' else NETINET_IN_H='netinet/in.h' AC_CHECK_HEADERS([netinet/in.h]) gl_CHECK_NEXT_HEADERS([netinet/in.h]) if test $ac_cv_header_netinet_in_h = yes; then HAVE_NETINET_IN_H=1 else HAVE_NETINET_IN_H=0 fi AC_SUBST([HAVE_NETINET_IN_H]) fi AC_SUBST([NETINET_IN_H]) AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) ]) amanda-3.3.6/config/gnulib/locale-fr.m40000664000076400007640000002422512357250007021301 0ustar00martineamartinea00000000000000# locale-fr.m4 serial 17 dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Determine the name of a french locale with traditional encoding. AC_DEFUN([gt_LOCALE_FR], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([ changequote(,)dnl #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* Check whether the given locale name is recognized by the system. */ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; #else if (setlocale (LC_ALL, "") == NULL) return 1; #endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ #if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } #endif #ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; #endif /* Check whether in the abbreviation of the second month, the second character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; #endif return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. mingw*) # Test for the native Windows locale name. if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=French_France.1252 else # None found. gt_cv_locale_fr=none fi ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the usual locale name. if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR else # Test for the locale name with explicit encoding suffix. if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO-8859-1 else # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO8859-1 else # Test for the HP-UX locale name. if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.iso88591 else # Test for the Solaris 7 locale name. if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr else # None found. gt_cv_locale_fr=none fi fi fi fi fi ;; esac fi rm -fr conftest* ]) LOCALE_FR=$gt_cv_locale_fr AC_SUBST([LOCALE_FR]) ]) dnl Determine the name of a french locale with UTF-8 encoding. AC_DEFUN([gt_LOCALE_FR_UTF8], [ AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([ changequote(,)dnl #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check whether in the abbreviation of the second month, the second character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is two bytes long, with UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 4 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') return 1; #endif #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; #endif return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. mingw*) # Test for the hypothetical native Windows locale name. if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=French_France.65001 else # None found. gt_cv_locale_fr_utf8=none fi ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the usual locale name. if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr_FR else # Test for the locale name with explicit encoding suffix. if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr_FR.UTF-8 else # Test for the Solaris 7 locale name. if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr.UTF-8 else # None found. gt_cv_locale_fr_utf8=none fi fi fi ;; esac fi rm -fr conftest* ]) LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 AC_SUBST([LOCALE_FR_UTF8]) ]) amanda-3.3.6/config/gnulib/raise.m40000664000076400007640000000171012357250007020532 0ustar00martineamartinea00000000000000# raise.m4 serial 3 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_RAISE], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_MSVC_INVAL]) AC_CHECK_FUNCS([raise]) if test $ac_cv_func_raise = no; then HAVE_RAISE=0 else if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then REPLACE_RAISE=1 fi m4_ifdef([gl_SIGNALBLOCKING], [ gl_SIGNALBLOCKING if test $HAVE_POSIX_SIGNALBLOCKING = 0; then m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_RAISE=1 fi ], [:]) fi ]) fi ]) # Prerequisites of lib/raise.c. AC_DEFUN([gl_PREREQ_RAISE], [:]) amanda-3.3.6/config/gnulib/hostent.m40000664000076400007640000000316612357250007021122 0ustar00martineamartinea00000000000000# hostent.m4 serial 2 dnl Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_HOSTENT], [ dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(), dnl gethostbyaddr() defined? dnl - On Solaris, they are in libnsl. Ignore libxnet. dnl - On Haiku, they are in libnetwork. dnl - On BeOS, they are in libnet. dnl - On native Windows, they are in ws2_32.dll. dnl - Otherwise they are in libc. AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H HOSTENT_LIB= gl_saved_libs="$LIBS" AC_SEARCH_LIBS([gethostbyname], [nsl network net], [if test "$ac_cv_search_gethostbyname" != "none required"; then HOSTENT_LIB="$ac_cv_search_gethostbyname" fi]) LIBS="$gl_saved_libs" if test -z "$HOSTENT_LIB"; then AC_CHECK_FUNCS([gethostbyname], , [ AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32], [gl_cv_w32_gethostbyname], [gl_cv_w32_gethostbyname=no gl_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_WINSOCK2_H #include #endif #include ]], [[gethostbyname(NULL);]])], [gl_cv_w32_gethostbyname=yes]) LIBS="$gl_save_LIBS" ]) if test "$gl_cv_w32_gethostbyname" = "yes"; then HOSTENT_LIB="-lws2_32" fi ]) fi AC_SUBST([HOSTENT_LIB]) ]) amanda-3.3.6/config/gnulib/localeconv.m40000664000076400007640000000114712357250007021560 0ustar00martineamartinea00000000000000# localeconv.m4 serial 1 dnl Copyright (C) 2012-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_LOCALECONV], [ AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) AC_REQUIRE([gl_LOCALE_H]) if test $REPLACE_STRUCT_LCONV = 1; then REPLACE_LOCALECONV=1 fi ]) # Prerequisites of lib/localeconv.c. AC_DEFUN([gl_PREREQ_LOCALECONV], [ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], [[#include ]]) ]) amanda-3.3.6/config/gnulib/read.m40000664000076400007640000000153512357250007020347 0ustar00martineamartinea00000000000000# read.m4 serial 4 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_READ], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then REPLACE_READ=1 fi dnl This ifdef is just an optimization, to avoid performing a configure dnl check whose result is not used. It does not make the test of dnl GNULIB_UNISTD_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_READ=1 fi ]) ]) # Prerequisites of lib/read.c. AC_DEFUN([gl_PREREQ_READ], [:]) amanda-3.3.6/config/gnulib/mbrtowc.m40000664000076400007640000004153712357250007021117 0ustar00martineamartinea00000000000000# mbrtowc.m4 serial 25 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MBRTOWC], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN AC_CHECK_FUNCS_ONCE([mbrtowc]) if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 AC_CHECK_DECLS([mbrtowc],,, [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include ]]) if test $ac_cv_have_decl_mbrtowc = yes; then dnl On Minix 3.1.8, the system's declares mbrtowc() although dnl it does not have the function. Avoid a collision with gnulib's dnl replacement. REPLACE_MBRTOWC=1 fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 else gl_MBRTOWC_NULL_ARG1 gl_MBRTOWC_NULL_ARG2 gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], [Define if the mbrtowc function has the NULL pwc argument bug.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_null_arg2" in *yes) ;; *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], [Define if the mbrtowc function has the NULL string argument bug.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_retval" in *yes) ;; *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], [Define if the mbrtowc function returns a wrong return value.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_nul_retval" in *yes) ;; *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], [Define if the mbrtowc function does not return 0 for a NUL character.]) REPLACE_MBRTOWC=1 ;; esac fi fi ]) dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that dnl redefines the semantics of the given mbstate_t type. dnl Result is REPLACE_MBSTATE_T. dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to dnl avoid inconsistencies. AC_DEFUN([gl_MBSTATE_T_BROKEN], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_FUNCS_ONCE([mbsinit]) AC_CHECK_FUNCS_ONCE([mbrtowc]) if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then gl_MBRTOWC_INCOMPLETE_STATE gl_MBRTOWC_SANITYCHECK REPLACE_MBSTATE_T=0 case "$gl_cv_func_mbrtowc_incomplete_state" in *yes) ;; *) REPLACE_MBSTATE_T=1 ;; esac case "$gl_cv_func_mbrtowc_sanitycheck" in *yes) ;; *) REPLACE_MBSTATE_T=1 ;; esac else REPLACE_MBSTATE_T=1 fi ]) dnl Test whether mbrtowc puts the state into non-initial state when parsing an dnl incomplete multibyte character. dnl Result is gl_cv_func_mbrtowc_incomplete_state. AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], [gl_cv_func_mbrtowc_incomplete_state], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on AIX and OSF/1. aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) { const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) return 1; } return 0; }]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) fi ]) ]) dnl Test whether mbrtowc works not worse than mbtowc. dnl Result is gl_cv_func_mbrtowc_sanitycheck. AC_DEFUN([gl_MBRTOWC_SANITYCHECK], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc], [gl_cv_func_mbrtowc_sanitycheck], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris 8. solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { /* This fails on Solaris 8: mbrtowc returns 2, and sets wc to 0x00F0. mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) return 1; } return 0; }]])], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], [:]) fi ]) ]) dnl Test whether mbrtowc supports a NULL pwc argument correctly. dnl Result is gl_cv_func_mbrtowc_null_arg1. AC_DEFUN([gl_MBRTOWC_NULL_ARG1], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], [gl_cv_func_mbrtowc_null_arg1], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris. solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { int result = 0; if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { char input[] = "\303\237er"; mbstate_t state; wchar_t wc; size_t ret; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input, 5, &state); if (ret != 2) result |= 1; if (!mbsinit (&state)) result |= 2; memset (&state, '\0', sizeof (mbstate_t)); ret = mbrtowc (NULL, input, 5, &state); if (ret != 2) /* Solaris 7 fails here: ret is -1. */ result |= 4; if (!mbsinit (&state)) result |= 8; } return result; }]])], [gl_cv_func_mbrtowc_null_arg1=yes], [gl_cv_func_mbrtowc_null_arg1=no], [:]) fi ]) ]) dnl Test whether mbrtowc supports a NULL string argument correctly. dnl Result is gl_cv_func_mbrtowc_null_arg2. AC_DEFUN([gl_MBRTOWC_NULL_ARG2], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], [gl_cv_func_mbrtowc_null_arg2], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on OSF/1. osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { mbstate_t state; wchar_t wc; int ret; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; mbrtowc (&wc, NULL, 5, &state); /* Check that wc was not modified. */ if (wc != (wchar_t) 0xBADFACE) return 1; } return 0; }]])], [gl_cv_func_mbrtowc_null_arg2=yes], [gl_cv_func_mbrtowc_null_arg2=no], [:]) fi ]) ]) dnl Test whether mbrtowc, when parsing the end of a multibyte character, dnl correctly returns the number of bytes that were needed to complete the dnl character (not the total number of bytes of the multibyte character). dnl Result is gl_cv_func_mbrtowc_retval. AC_DEFUN([gl_MBRTOWC_RETVAL], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether mbrtowc has a correct return value], [gl_cv_func_mbrtowc_retval], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on HP-UX, Solaris, native Windows. hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ || { case "$host_os" in mingw*) true;; *) false;; esac; }; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { int result = 0; int found_some_locale = 0; /* This fails on Solaris. */ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { char input[] = "B\303\274\303\237er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 1) result |= 1; } found_some_locale = 1; } /* This fails on HP-UX 11.11. */ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) { char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 2) result |= 2; } found_some_locale = 1; } /* This fails on native Windows. */ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) { char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 4; } found_some_locale = 1; } if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) { char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 8; } found_some_locale = 1; } if (setlocale (LC_ALL, "Chinese_China.936") != NULL) { char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 16; } found_some_locale = 1; } return (found_some_locale ? result : 77); }]])], [gl_cv_func_mbrtowc_retval=yes], [if test $? != 77; then gl_cv_func_mbrtowc_retval=no fi ], [:]) fi ]) ]) dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0. dnl Result is gl_cv_func_mbrtowc_nul_retval. AC_DEFUN([gl_MBRTOWC_NUL_RETVAL], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character], [gl_cv_func_mbrtowc_nul_retval], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris 8 and 9. solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { /* This fails on Solaris 8 and 9. */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) return 1; } return 0; }]])], [gl_cv_func_mbrtowc_nul_retval=yes], [gl_cv_func_mbrtowc_nul_retval=no], [:]) fi ]) ]) # Prerequisites of lib/mbrtowc.c. AC_DEFUN([gl_PREREQ_MBRTOWC], [ : ]) dnl From Paul Eggert dnl This is an override of an autoconf macro. AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[/* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], gl_cv_func_mbrtowc=yes, gl_cv_func_mbrtowc=no)]) if test $gl_cv_func_mbrtowc = yes; then AC_DEFINE([HAVE_MBRTOWC], [1], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) amanda-3.3.6/config/gnulib/fseek.m40000664000076400007640000000100512357250007020521 0ustar00martineamartinea00000000000000# fseek.m4 serial 4 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FSEEK], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_FSEEKO]) dnl When fseeko needs fixes, fseek needs them too. if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then REPLACE_FSEEK=1 fi ]) amanda-3.3.6/config/gnulib/size_max.m40000664000076400007640000000577012357250007021260 0ustar00martineamartinea00000000000000# size_max.m4 serial 10 dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS([stdint.h]) dnl First test whether the system already has SIZE_MAX. AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ gl_cv_size_max= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], [gl_cv_size_max=yes]) if test -z "$gl_cv_size_max"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], [#include #include ], [size_t_bits_minus_1=]) AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], [#include ], [fits_in_uint=]) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include extern size_t foo; extern unsigned long foo; ]], [[]])], [fits_in_uint=0]) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... gl_cv_size_max='((size_t)~(size_t)0)' fi fi ]) if test "$gl_cv_size_max" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after dnl . Remember that the #undef in AH_VERBATIM gets replaced with dnl #define by AC_DEFINE_UNQUOTED. AH_VERBATIM([SIZE_MAX], [/* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #ifndef SIZE_MAX # undef SIZE_MAX #endif]) ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) amanda-3.3.6/config/gnulib/file-list0000664000076400007640000000752112357750226021016 0ustar00martineamartinea00000000000000## this file is automatically generated by autogen EXTRA_DIST += gnulib/00gnulib.m4 EXTRA_DIST += gnulib/alloca.m4 EXTRA_DIST += gnulib/arpa_inet_h.m4 EXTRA_DIST += gnulib/base64.m4 EXTRA_DIST += gnulib/btowc.m4 EXTRA_DIST += gnulib/codeset.m4 EXTRA_DIST += gnulib/configmake.m4 EXTRA_DIST += gnulib/eealloc.m4 EXTRA_DIST += gnulib/environ.m4 EXTRA_DIST += gnulib/errno_h.m4 EXTRA_DIST += gnulib/euidaccess.m4 EXTRA_DIST += gnulib/exponentd.m4 EXTRA_DIST += gnulib/extensions.m4 EXTRA_DIST += gnulib/extern-inline.m4 EXTRA_DIST += gnulib/fcntl_h.m4 EXTRA_DIST += gnulib/fcntl-o.m4 EXTRA_DIST += gnulib/float_h.m4 EXTRA_DIST += gnulib/fseek.m4 EXTRA_DIST += gnulib/fseeko.m4 EXTRA_DIST += gnulib/fstat.m4 EXTRA_DIST += gnulib/fsusage.m4 EXTRA_DIST += gnulib/ftell.m4 EXTRA_DIST += gnulib/ftello.m4 EXTRA_DIST += gnulib/ftruncate.m4 EXTRA_DIST += gnulib/getaddrinfo.m4 EXTRA_DIST += gnulib/getgroups.m4 EXTRA_DIST += gnulib/getopt.m4 EXTRA_DIST += gnulib/gettimeofday.m4 EXTRA_DIST += gnulib/glibc21.m4 EXTRA_DIST += gnulib/gnulib-cache.m4 EXTRA_DIST += gnulib/gnulib-common.m4 EXTRA_DIST += gnulib/gnulib-comp.m4 EXTRA_DIST += gnulib/gnulib-tool.m4 EXTRA_DIST += gnulib/group-member.m4 EXTRA_DIST += gnulib/hostent.m4 EXTRA_DIST += gnulib/include_next.m4 EXTRA_DIST += gnulib/inet_ntop.m4 EXTRA_DIST += gnulib/inet_pton.m4 EXTRA_DIST += gnulib/intmax_t.m4 EXTRA_DIST += gnulib/inttypes_h.m4 EXTRA_DIST += gnulib/langinfo_h.m4 EXTRA_DIST += gnulib/largefile.m4 EXTRA_DIST += gnulib/lib-ld.m4 EXTRA_DIST += gnulib/lib-link.m4 EXTRA_DIST += gnulib/lib-prefix.m4 EXTRA_DIST += gnulib/localcharset.m4 EXTRA_DIST += gnulib/localeconv.m4 EXTRA_DIST += gnulib/locale-fr.m4 EXTRA_DIST += gnulib/locale_h.m4 EXTRA_DIST += gnulib/locale-ja.m4 EXTRA_DIST += gnulib/locale-zh.m4 EXTRA_DIST += gnulib/lock.m4 EXTRA_DIST += gnulib/longlong.m4 EXTRA_DIST += gnulib/lseek.m4 EXTRA_DIST += gnulib/lstat.m4 EXTRA_DIST += gnulib/malloc.m4 EXTRA_DIST += gnulib/math_h.m4 EXTRA_DIST += gnulib/mbrtowc.m4 EXTRA_DIST += gnulib/mbsinit.m4 EXTRA_DIST += gnulib/mbstate_t.m4 EXTRA_DIST += gnulib/mbtowc.m4 EXTRA_DIST += gnulib/memchr.m4 EXTRA_DIST += gnulib/mkdtemp.m4 EXTRA_DIST += gnulib/mmap-anon.m4 EXTRA_DIST += gnulib/msvc-inval.m4 EXTRA_DIST += gnulib/msvc-nothrow.m4 EXTRA_DIST += gnulib/multiarch.m4 EXTRA_DIST += gnulib/netdb_h.m4 EXTRA_DIST += gnulib/netinet_in_h.m4 EXTRA_DIST += gnulib/nl_langinfo.m4 EXTRA_DIST += gnulib/nocrash.m4 EXTRA_DIST += gnulib/off_t.m4 EXTRA_DIST += gnulib/pathmax.m4 EXTRA_DIST += gnulib/physmem.m4 EXTRA_DIST += gnulib/printf.m4 EXTRA_DIST += gnulib/raise.m4 EXTRA_DIST += gnulib/read.m4 EXTRA_DIST += gnulib/regex.m4 EXTRA_DIST += gnulib/safe-read.m4 EXTRA_DIST += gnulib/safe-write.m4 EXTRA_DIST += gnulib/secure_getenv.m4 EXTRA_DIST += gnulib/servent.m4 EXTRA_DIST += gnulib/signal_h.m4 EXTRA_DIST += gnulib/size_max.m4 EXTRA_DIST += gnulib/snprintf.m4 EXTRA_DIST += gnulib/socketlib.m4 EXTRA_DIST += gnulib/sockets.m4 EXTRA_DIST += gnulib/socklen.m4 EXTRA_DIST += gnulib/sockpfaf.m4 EXTRA_DIST += gnulib/ssize_t.m4 EXTRA_DIST += gnulib/stat.m4 EXTRA_DIST += gnulib/stdalign.m4 EXTRA_DIST += gnulib/stdbool.m4 EXTRA_DIST += gnulib/stddef_h.m4 EXTRA_DIST += gnulib/stdint_h.m4 EXTRA_DIST += gnulib/stdint.m4 EXTRA_DIST += gnulib/stdio_h.m4 EXTRA_DIST += gnulib/stdlib_h.m4 EXTRA_DIST += gnulib/string_h.m4 EXTRA_DIST += gnulib/sys_socket_h.m4 EXTRA_DIST += gnulib/sys_stat_h.m4 EXTRA_DIST += gnulib/sys_time_h.m4 EXTRA_DIST += gnulib/sys_types_h.m4 EXTRA_DIST += gnulib/sys_uio_h.m4 EXTRA_DIST += gnulib/tempname.m4 EXTRA_DIST += gnulib/threadlib.m4 EXTRA_DIST += gnulib/time_h.m4 EXTRA_DIST += gnulib/unistd_h.m4 EXTRA_DIST += gnulib/vasnprintf.m4 EXTRA_DIST += gnulib/warn-on-use.m4 EXTRA_DIST += gnulib/wchar_h.m4 EXTRA_DIST += gnulib/wchar_t.m4 EXTRA_DIST += gnulib/wcrtomb.m4 EXTRA_DIST += gnulib/wctype_h.m4 EXTRA_DIST += gnulib/wint_t.m4 EXTRA_DIST += gnulib/write.m4 EXTRA_DIST += gnulib/xsize.m4 amanda-3.3.6/config/gnulib/float_h.m40000664000076400007640000000466312357250007021055 0ustar00martineamartinea00000000000000# float_h.m4 serial 9 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FLOAT_H], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) FLOAT_H= REPLACE_FLOAT_LDBL=0 case "$host_os" in aix* | beos* | openbsd* | mirbsd* | irix*) FLOAT_H=float.h ;; freebsd*) case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl FLOAT_H=float.h ;; x86_64 ) # On x86_64 systems, the C compiler may still be generating # 32-bit code. AC_EGREP_CPP([yes], [#if defined __LP64__ || defined __x86_64__ || defined __amd64__ yes #endif], [], [FLOAT_H=float.h]) ;; esac ;; linux*) case "$host_cpu" in powerpc*) FLOAT_H=float.h ;; esac ;; esac case "$host_os" in aix* | freebsd* | linux*) if test -n "$FLOAT_H"; then REPLACE_FLOAT_LDBL=1 fi ;; esac dnl Test against glibc-2.7 Linux/SPARC64 bug. REPLACE_ITOLD=0 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], [gl_cv_func_itold_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ int i = -1; volatile long double ld; int main () { ld += i * 1.0L; if (ld > 0) return 1; return 0; }]])], [gl_cv_func_itold_works=yes], [gl_cv_func_itold_works=no], [case "$host" in sparc*-*-linux*) AC_EGREP_CPP([yes], [#if defined __LP64__ || defined __arch64__ yes #endif], [gl_cv_func_itold_works="guessing no"], [gl_cv_func_itold_works="guessing yes"]) ;; *) gl_cv_func_itold_works="guessing yes" ;; esac ]) ]) case "$gl_cv_func_itold_works" in *no) REPLACE_ITOLD=1 dnl We add the workaround to but also to , dnl to increase the chances that the fix function gets pulled in. FLOAT_H=float.h ;; esac if test -n "$FLOAT_H"; then gl_NEXT_HEADERS([float.h]) fi AC_SUBST([FLOAT_H]) AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) AC_SUBST([REPLACE_ITOLD]) ]) amanda-3.3.6/config/gnulib/sockets.m40000664000076400007640000000070712357250007021107 0ustar00martineamartinea00000000000000# sockets.m4 serial 7 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SOCKETS], [ AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([gl_SOCKETLIB]) gl_PREREQ_SOCKETS ]) # Prerequisites of lib/sockets.c. AC_DEFUN([gl_PREREQ_SOCKETS], [ : ]) amanda-3.3.6/config/gnulib/inet_ntop.m40000664000076400007640000000415212357250007021431 0ustar00martineamartinea00000000000000# inet_ntop.m4 serial 19 dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_INET_NTOP], [ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) dnl Persuade Solaris to declare inet_ntop. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_C_RESTRICT]) dnl Most platforms that provide inet_ntop define it in libc. dnl Solaris 8..10 provide inet_ntop in libnsl instead. dnl Solaris 2.6..7 provide inet_ntop in libresolv instead. dnl Native Windows provides it in -lws2_32 instead, with a declaration in dnl , and it uses stdcall calling convention, not cdecl dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). HAVE_INET_NTOP=1 INET_NTOP_LIB= gl_PREREQ_SYS_H_WINSOCK2 if test $HAVE_WINSOCK2_H = 1; then AC_CHECK_DECLS([inet_ntop],,, [[#include ]]) if test $ac_cv_have_decl_inet_ntop = yes; then dnl It needs to be overridden, because the stdcall calling convention dnl is not compliant with POSIX. REPLACE_INET_NTOP=1 INET_NTOP_LIB="-lws2_32" else HAVE_DECL_INET_NTOP=0 HAVE_INET_NTOP=0 fi else gl_save_LIBS=$LIBS AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [], [AC_CHECK_FUNCS([inet_ntop]) if test $ac_cv_func_inet_ntop = no; then HAVE_INET_NTOP=0 fi ]) LIBS=$gl_save_LIBS if test "$ac_cv_search_inet_ntop" != "no" \ && test "$ac_cv_search_inet_ntop" != "none required"; then INET_NTOP_LIB="$ac_cv_search_inet_ntop" fi AC_CHECK_HEADERS_ONCE([netdb.h]) AC_CHECK_DECLS([inet_ntop],,, [[#include #if HAVE_NETDB_H # include #endif ]]) if test $ac_cv_have_decl_inet_ntop = no; then HAVE_DECL_INET_NTOP=0 fi fi AC_SUBST([INET_NTOP_LIB]) ]) # Prerequisites of lib/inet_ntop.c. AC_DEFUN([gl_PREREQ_INET_NTOP], [ AC_REQUIRE([gl_SOCKET_FAMILIES]) ]) amanda-3.3.6/config/gnulib/threadlib.m40000664000076400007640000003414312357250007021373 0ustar00martineamartinea00000000000000# threadlib.m4 serial 10 (gettext-0.18.2) dnl Copyright (C) 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl gl_THREADLIB dnl ------------ dnl Tests for a multithreading library to be used. dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the dnl default is 'no', otherwise it is system dependent. In both cases, the user dnl can change the choice through the options --enable-threads=choice or dnl --disable-threads. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, dnl USE_PTH_THREADS, USE_WINDOWS_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. AC_DEFUN([gl_THREADLIB_EARLY], [ AC_REQUIRE([gl_THREADLIB_EARLY_BODY]) ]) dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once. AC_DEFUN([gl_THREADLIB_EARLY_BODY], [ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that dnl influences the result of the autoconf tests that test for *_unlocked dnl declarations, on AIX 5 at least. Therefore it must come early. AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems. dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes dnl AC_GNU_SOURCE. m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. m4_ifdef([gl_THREADLIB_DEFAULT_NO], [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])], [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) AC_ARG_ENABLE([threads], AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ AC_HELP_STRING([--disable-threads], [build without multithread safety])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" else changequote(,)dnl case "$host_os" in dnl Disable multithreading by default on OSF/1, because it interferes dnl with fork()/exec(): When msgexec is linked with -lpthread, its dnl child process gets an endless segmentation fault inside execvp(). dnl Disable multithreading by default on Cygwin 1.5.x, because it has dnl bugs that lead to endless loops or crashes. See dnl . osf*) gl_use_threads=no ;; cygwin*) case `uname -r` in 1.[0-5].*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac ;; *) gl_use_threads=yes ;; esac changequote([,])dnl fi ]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_LINK_IFELSE test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi ]) dnl The guts of gl_THREADLIB. Needs to be expanded only once. AC_DEFUN([gl_THREADLIB_BODY], [ AC_REQUIRE([gl_THREADLIB_EARLY_BODY]) gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then dnl Check whether the compiler and linker support weak declarations. AC_CACHE_CHECK([whether imported symbols can be declared weak], [gl_cv_have_weak], [gl_cv_have_weak=no dnl First, test whether the compiler accepts it syntactically. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[extern void xyzzy (); #pragma weak xyzzy]], [[xyzzy();]])], [gl_cv_have_weak=maybe]) if test $gl_cv_have_weak = maybe; then dnl Second, test whether it actually works. On Cygwin 1.7.2, with dnl gcc 4.3, symbols declared weak always evaluate to the address 0. AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #pragma weak fputs int main () { return (fputs == NULL); }]])], [gl_cv_have_weak=yes], [gl_cv_have_weak=no], [dnl When cross-compiling, assume that only ELF platforms support dnl weak symbols. AC_EGREP_CPP([Extensible Linking Format], [#ifdef __ELF__ Extensible Linking Format #endif ], [gl_cv_have_weak="guessing yes"], [gl_cv_have_weak="guessing no"]) ]) fi ]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_THREADLIB_EARLY_BODY. AC_CHECK_HEADER([pthread.h], [gl_have_pthread_h=yes], [gl_have_pthread_h=no]) if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0);]])], [gl_have_pthread=yes]) # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB([pthread], [pthread_kill], [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) esac ]) else # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB([pthread], [pthread_kill], [gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) if test -z "$gl_have_pthread"; then # For FreeBSD 4. AC_CHECK_LIB([c_r], [pthread_kill], [gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[thr_self();]])], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_SOLARIS_THREADS], [1], [Define if the old Solaris multithreading library can be used.]) if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1], [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" AC_LIB_LINKFLAGS([pth]) gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS $LIBPTH" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[pth_self();]])], [gl_have_pth=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_PTH_THREADS], [1], [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then AC_DEFINE([USE_PTH_THREADS_WEAK], [1], [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then case "$gl_use_threads" in yes | windows | win32) # The 'win32' is for backward compatibility. if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=windows AC_DEFINE([USE_WINDOWS_THREADS], [1], [Define if the native Windows multithreading API can be used.]) fi ;; esac fi fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) AC_SUBST([LIBTHREAD]) AC_SUBST([LTLIBTHREAD]) AC_SUBST([LIBMULTITHREAD]) AC_SUBST([LTLIBMULTITHREAD]) ]) AC_DEFUN([gl_THREADLIB], [ AC_REQUIRE([gl_THREADLIB_EARLY]) AC_REQUIRE([gl_THREADLIB_BODY]) ]) dnl gl_DISABLE_THREADS dnl ------------------ dnl Sets the gl_THREADLIB default so that threads are not used by default. dnl The user can still override it at installation time, by using the dnl configure option '--enable-threads'. AC_DEFUN([gl_DISABLE_THREADS], [ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no]) ]) dnl Survey of platforms: dnl dnl Platform Available Compiler Supports test-lock dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl dnl GNU Hurd/glibc posix dnl dnl FreeBSD 5.3 posix -lc_r Y dnl posix -lkse ? Y dnl posix -lpthread ? Y dnl posix -lthr Y dnl dnl FreeBSD 5.2 posix -lc_r Y dnl posix -lkse Y dnl posix -lthr Y dnl dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl dnl NetBSD 1.6 -- dnl dnl OpenBSD 3.4 posix -lpthread Y OK dnl dnl Mac OS X 10.[123] posix -lpthread Y OK dnl dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl dnl IRIX 6.5 posix -lpthread Y 0.5 dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl dnl Cygwin posix -lpthread Y OK dnl dnl Any of the above pth -lpth 0.0 dnl dnl Mingw windows N OK dnl dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: dnl OK if all three tests terminate OK, dnl 0.5 if the first test terminates OK but the second one loops endlessly, dnl 0.0 if the first test already loops endlessly. amanda-3.3.6/config/gnulib/mbsinit.m40000664000076400007640000000276312357250007021105 0ustar00martineamartinea00000000000000# mbsinit.m4 serial 8 dnl Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MBSINIT], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN AC_CHECK_FUNCS_ONCE([mbsinit]) if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 AC_CHECK_DECLS([mbsinit],,, [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include ]]) if test $ac_cv_have_decl_mbsinit = yes; then dnl On Minix 3.1.8, the system's declares mbsinit() although dnl it does not have the function. Avoid a collision with gnulib's dnl replacement. REPLACE_MBSINIT=1 fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSINIT=1 else dnl On mingw, mbsinit() always returns 1, which is inappropriate for dnl states produced by mbrtowc() for an incomplete multibyte character dnl in multibyte locales. case "$host_os" in mingw*) REPLACE_MBSINIT=1 ;; esac fi fi ]) # Prerequisites of lib/mbsinit.c. AC_DEFUN([gl_PREREQ_MBSINIT], [ : ]) amanda-3.3.6/config/gnulib/warn-on-use.m40000664000076400007640000000415412357250007021607 0ustar00martineamartinea00000000000000# warn-on-use.m4 serial 5 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES) # --------------------------------------- # For each whitespace-separated element in the list of NAMES, define # HAVE_RAW_DECL_name if the function has a declaration among INCLUDES # even after being undefined as a macro. # # See warn-on-use.h for some hints on how to poison function names, as # well as ideas on poisoning global variables and macros. NAMES may # include global variables, but remember that only functions work with # _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single # header, but if the replacement header pulls in other headers because # some systems declare functions in the wrong header, then INCLUDES # should do likewise. # # It is generally safe to assume declarations for functions declared # in the intersection of C89 and C11 (such as printf) without # needing gl_WARN_ON_USE_PREPARE. AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ m4_foreach_w([gl_decl], [$2], [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl dnl FIXME: gl_Symbol must be used unquoted until we can assume dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], gl_Symbol, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], [@%:@undef $gl_func (void) $gl_func;])], [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) AS_VAR_IF(gl_Symbol, [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts eval ac_cv_have_decl_$gl_func=yes]) AS_VAR_POPDEF([gl_Symbol])dnl done ]) amanda-3.3.6/config/gnulib/lib-ld.m40000664000076400007640000000714312357250007020600 0ustar00martineamartinea00000000000000# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_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 `"$acl_cv_path_LD" -v 2>&1 , for platforms that have issues. # stddef_h.m4 serial 4 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) STDDEF_H= if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h fi AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], [gl_cv_decl_null_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include int test[2 * (sizeof NULL == sizeof (void *)) -1]; ]])], [gl_cv_decl_null_works=yes], [gl_cv_decl_null_works=no])]) if test $gl_cv_decl_null_works = no; then REPLACE_NULL=1 STDDEF_H=stddef.h fi AC_SUBST([STDDEF_H]) AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) if test -n "$STDDEF_H"; then gl_NEXT_HEADERS([stddef.h]) fi ]) AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) ]) amanda-3.3.6/config/gnulib/fsusage.m40000664000076400007640000002630512357250007021073 0ustar00martineamartinea00000000000000# serial 30 # Obtaining file system usage information. # Copyright (C) 1997-1998, 2000-2001, 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Jim Meyering. AC_DEFUN([gl_FSUSAGE], [ AC_CHECK_HEADERS_ONCE([sys/param.h]) AC_CHECK_HEADERS_ONCE([sys/vfs.h sys/fs_types.h]) AC_CHECK_HEADERS([sys/mount.h], [], [], [AC_INCLUDES_DEFAULT [#if HAVE_SYS_PARAM_H #include #endif]]) gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) ]) # Try to determine how a program can obtain file system usage information. # If successful, define the appropriate symbol (see fsusage.c) and # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND. # # gl_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) AC_DEFUN([gl_FILE_SYSTEM_USAGE], [ dnl Enable large-file support. This has the effect of changing the size dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on dnl Mac OS X >= 10.5 (32-bit mode). AC_REQUIRE([AC_SYS_LARGEFILE]) AC_MSG_NOTICE([checking how to get file system space usage]) ac_fsusage_space=no # Perform only the link test since it seems there are no variants of the # statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs]) # because that got a false positive on SCO OSR5. Adding the declaration # of a 'struct statvfs' causes this test to fail (as it should) on such # systems. That system is reported to work fine with STAT_STATFS4 which # is what it gets when this test fails. if test $ac_fsusage_space = no; then # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS. AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #ifdef __osf__ "Do not use Tru64's statvfs implementation" #endif #include struct statvfs fsd; #if defined __APPLE__ && defined __MACH__ #include /* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity; that commonly limits file systems to 4 TiB. Whereas f_blocks in 'struct statfs' is a 64-bit type, thanks to the large-file support that was enabled above. In this case, don't use statvfs(); use statfs() instead. */ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; #endif ]], [[statvfs (0, &fsd);]])], [fu_cv_sys_stat_statvfs=yes], [fu_cv_sys_stat_statvfs=no])]) if test $fu_cv_sys_stat_statvfs = yes; then ac_fsusage_space=yes # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs. # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems # statvfs with large-file support is already equivalent to statvfs64. AC_CACHE_CHECK([whether to use statvfs64], [fu_cv_sys_stat_statvfs64], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #include struct statvfs64 fsd; int check_f_blocks_larger_in_statvfs64 [sizeof (((struct statvfs64 *) 0)->f_blocks) > sizeof (((struct statvfs *) 0)->f_blocks) ? 1 : -1]; ]], [[statvfs64 (0, &fsd);]])], [fu_cv_sys_stat_statvfs64=yes], [fu_cv_sys_stat_statvfs64=no]) ]) if test $fu_cv_sys_stat_statvfs64 = yes; then AC_DEFINE([STAT_STATVFS64], [1], [ Define if statvfs64 should be preferred over statvfs.]) else AC_DEFINE([STAT_STATVFS], [1], [ Define if there is a function named statvfs. (SVR4)]) fi fi fi # Check for this unconditionally so we have a # good fallback on glibc/Linux > 2.6 < 2.6.36 AC_MSG_CHECKING([for two-argument statfs with statfs.f_frsize member]) AC_CACHE_VAL([fu_cv_sys_stat_statfs2_frsize], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_VFS_H #include #endif int main () { struct statfs fsd; fsd.f_frsize = 0; return statfs (".", &fsd) != 0; }]])], [fu_cv_sys_stat_statfs2_frsize=yes], [fu_cv_sys_stat_statfs2_frsize=no], [fu_cv_sys_stat_statfs2_frsize=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_frsize]) if test $fu_cv_sys_stat_statfs2_frsize = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS2_FRSIZE], [1], [ Define if statfs takes 2 args and struct statfs has a field named f_frsize. (glibc/Linux > 2.6)]) fi if test $ac_fsusage_space = no; then # DEC Alpha running OSF/1 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include int main () { struct statfs fsd; fsd.f_fsize = 0; return statfs (".", &fsd, sizeof (struct statfs)) != 0; }]])], [fu_cv_sys_stat_statfs3_osf1=yes], [fu_cv_sys_stat_statfs3_osf1=no], [fu_cv_sys_stat_statfs3_osf1=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1]) if test $fu_cv_sys_stat_statfs3_osf1 = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS3_OSF1], [1], [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) fi fi if test $ac_fsusage_space = no; then # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.) # (On IRIX you need to include , not only and # .) # (On Solaris, statfs has 4 arguments.) AC_MSG_CHECKING([for two-argument statfs with statfs.f_bsize dnl member (AIX, 4.3BSD)]) AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_VFS_H #include #endif int main () { struct statfs fsd; fsd.f_bsize = 0; return statfs (".", &fsd) != 0; }]])], [fu_cv_sys_stat_statfs2_bsize=yes], [fu_cv_sys_stat_statfs2_bsize=no], [fu_cv_sys_stat_statfs2_bsize=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize]) if test $fu_cv_sys_stat_statfs2_bsize = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS2_BSIZE], [1], [ Define if statfs takes 2 args and struct statfs has a field named f_bsize. (4.3BSD, SunOS 4, HP-UX, AIX PS/2)]) fi fi if test $ac_fsusage_space = no; then # SVR3 # (Solaris already handled above.) AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) AC_CACHE_VAL([fu_cv_sys_stat_statfs4], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main () { struct statfs fsd; return statfs (".", &fsd, sizeof fsd, 0) != 0; }]])], [fu_cv_sys_stat_statfs4=yes], [fu_cv_sys_stat_statfs4=no], [fu_cv_sys_stat_statfs4=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_statfs4]) if test $fu_cv_sys_stat_statfs4 = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS4], [1], [ Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin)]) fi fi if test $ac_fsusage_space = no; then # 4.4BSD and older NetBSD # (OSF/1 already handled above.) # (On AIX, you need to include , not only .) # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in # .) AC_MSG_CHECKING([for two-argument statfs with statfs.f_fsize dnl member (4.4BSD and NetBSD)]) AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif int main () { struct statfs fsd; fsd.f_fsize = 0; return statfs (".", &fsd) != 0; }]])], [fu_cv_sys_stat_statfs2_fsize=yes], [fu_cv_sys_stat_statfs2_fsize=no], [fu_cv_sys_stat_statfs2_fsize=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize]) if test $fu_cv_sys_stat_statfs2_fsize = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS2_FSIZE], [1], [ Define if statfs takes 2 args and struct statfs has a field named f_fsize. (4.4BSD, NetBSD)]) fi fi if test $ac_fsusage_space = no; then # Ultrix AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) AC_CACHE_VAL([fu_cv_sys_stat_fs_data], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_FS_TYPES_H #include #endif int main () { struct fs_data fsd; /* Ultrix's statfs returns 1 for success, 0 for not mounted, -1 for failure. */ return statfs (".", &fsd) != 1; }]])], [fu_cv_sys_stat_fs_data=yes], [fu_cv_sys_stat_fs_data=no], [fu_cv_sys_stat_fs_data=no])]) AC_MSG_RESULT([$fu_cv_sys_stat_fs_data]) if test $fu_cv_sys_stat_fs_data = yes; then ac_fsusage_space=yes AC_DEFINE([STAT_STATFS2_FS_DATA], [1], [ Define if statfs takes 2 args and the second argument has type struct fs_data. (Ultrix)]) fi fi if test $ac_fsusage_space = no; then # SVR2 # (AIX, HP-UX, OSF/1 already handled above.) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])], [AC_DEFINE([STAT_READ_FILSYS], [1], [Define if there is no specific function for reading file systems usage information and you have the header file. (SVR2)]) ac_fsusage_space=yes]) fi AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) ]) # Check for SunOS statfs brokenness wrt partitions 2GB and larger. # If exists and struct statfs has a member named f_spare, # enable the work-around code in fsusage.c. AC_DEFUN([gl_STATFS_TRUNCATES], [ AC_MSG_CHECKING([for statfs that truncates block counts]) AC_CACHE_VAL([fu_cv_sys_truncating_statfs], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if !defined(sun) && !defined(__sun) choke -- this is a workaround for a Sun-specific problem #endif #include #include ]], [[struct statfs t; long c = *(t.f_spare); if (c) return 0;]])], [fu_cv_sys_truncating_statfs=yes], [fu_cv_sys_truncating_statfs=no])]) if test $fu_cv_sys_truncating_statfs = yes; then AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1], [Define if the block counts reported by statfs may be truncated to 2GB and the correct values may be stored in the f_spare array. (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be affected.)]) fi AC_MSG_RESULT([$fu_cv_sys_truncating_statfs]) ]) # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], [ AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h]) gl_STATFS_TRUNCATES ]) amanda-3.3.6/config/gnulib/mkdtemp.m40000664000076400007640000000102712357250007021071 0ustar00martineamartinea00000000000000# mkdtemp.m4 serial 8 dnl Copyright (C) 2001-2003, 2006-2007, 2009-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MKDTEMP], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_CHECK_FUNCS([mkdtemp]) if test $ac_cv_func_mkdtemp = no; then HAVE_MKDTEMP=0 fi ]) # Prerequisites of lib/mkdtemp.c AC_DEFUN([gl_PREREQ_MKDTEMP], [: ]) amanda-3.3.6/config/gnulib/msvc-inval.m40000664000076400007640000000133412357250007021510 0ustar00martineamartinea00000000000000# msvc-inval.m4 serial 1 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_MSVC_INVAL], [ AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler]) if test $ac_cv_func__set_invalid_parameter_handler = yes; then HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1], [Define to 1 on MSVC platforms that have the "invalid parameter handler" concept.]) else HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 fi AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) ]) amanda-3.3.6/config/gnulib/fcntl-o.m40000664000076400007640000001107412357250007020775 0ustar00martineamartinea00000000000000# fcntl-o.m4 serial 4 dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. # Test whether the flags O_NOATIME and O_NOFOLLOW actually work. # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. AC_DEFUN([gl_FCNTL_O_FLAGS], [ dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes dnl AC_GNU_SOURCE. m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_FUNCS_ONCE([symlink]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #if HAVE_UNISTD_H # include #else /* on Windows with MSVC */ # include # include # defined sleep(n) _sleep ((n) * 1000) #endif #include #ifndef O_NOATIME #define O_NOATIME 0 #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif static int const constants[] = { O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY }; ]], [[ int result = !constants; #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; if (symlink ("/dev/null", sym) != 0) result |= 2; else { int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); if (fd >= 0) { close (fd); result |= 4; } } if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else { int fd = open (sym, O_RDONLY | O_NOFOLLOW); if (fd >= 0) { close (fd); result |= 4; } } unlink (sym); } #endif { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); if (fd < 0) result |= 8; else { struct stat st0; if (fstat (fd, &st0) != 0) result |= 16; else { char c; sleep (1); if (read (fd, &c, 1) != 1) result |= 24; else { if (close (fd) != 0) result |= 32; else { struct stat st1; if (stat (file, &st1) != 0) result |= 40; else if (st0.st_atime != st1.st_atime) result |= 64; } } } } } return result;]])], [gl_cv_header_working_fcntl_h=yes], [case $? in #( 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( *) gl_cv_header_working_fcntl_h='no';; esac], [gl_cv_header_working_fcntl_h=cross-compiling])]) case $gl_cv_header_working_fcntl_h in #( *O_NOATIME* | no | cross-compiling) ac_val=0;; #( *) ac_val=1;; esac AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], [Define to 1 if O_NOATIME works.]) case $gl_cv_header_working_fcntl_h in #( *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( *) ac_val=1;; esac AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], [Define to 1 if O_NOFOLLOW works.]) ]) amanda-3.3.6/config/gnulib/inttypes_h.m40000664000076400007640000000177412357250007021627 0ustar00martineamartinea00000000000000# inttypes_h.m4 serial 10 dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[uintmax_t i = (uintmax_t) -1; return !i;]])], [gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) amanda-3.3.6/config/gnulib/msvc-nothrow.m40000664000076400007640000000053012357250007022074 0ustar00martineamartinea00000000000000# msvc-nothrow.m4 serial 1 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_MSVC_NOTHROW], [ AC_REQUIRE([gl_MSVC_INVAL]) ]) amanda-3.3.6/config/gnulib/sys_socket_h.m40000664000076400007640000001416312357250007022132 0ustar00martineamartinea00000000000000# sys_socket_h.m4 serial 23 dnl Copyright (C) 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Simon Josefsson. AC_DEFUN([gl_HEADER_SYS_SOCKET], [ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have dnl old-style declarations (with return type 'int' instead of 'ssize_t') dnl unless _POSIX_PII_SOCKET is defined. case "$host_os" in osf*) AC_DEFINE([_POSIX_PII_SOCKET], [1], [Define to 1 in order to get the POSIX compatible declarations of socket functions.]) ;; esac AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [gl_cv_header_sys_socket_h_selfcontained=yes], [gl_cv_header_sys_socket_h_selfcontained=no]) ]) if test $gl_cv_header_sys_socket_h_selfcontained = yes; then dnl If the shutdown function exists, should define dnl SHUT_RD, SHUT_WR, SHUT_RDWR. AC_CHECK_FUNCS([shutdown]) if test $ac_cv_func_shutdown = yes; then AC_CACHE_CHECK([whether defines the SHUT_* macros], [gl_cv_header_sys_socket_h_shut], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], [gl_cv_header_sys_socket_h_shut=yes], [gl_cv_header_sys_socket_h_shut=no]) ]) if test $gl_cv_header_sys_socket_h_shut = no; then SYS_SOCKET_H='sys/socket.h' fi fi fi # We need to check for ws2tcpip.h now. gl_PREREQ_SYS_H_SOCKET AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]) if test $ac_cv_type_struct_sockaddr_storage = no; then HAVE_STRUCT_SOCKADDR_STORAGE=0 fi if test $ac_cv_type_sa_family_t = no; then HAVE_SA_FAMILY_T=0 fi if test $ac_cv_type_struct_sockaddr_storage != no; then AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], [], [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], [#include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]) fi if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then SYS_SOCKET_H='sys/socket.h' fi gl_PREREQ_SYS_H_WINSOCK2 dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* Some systems require prerequisite headers. */ #include #include ]], [socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4]) ]) AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], [ dnl Check prerequisites of the replacement. AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) gl_CHECK_NEXT_HEADERS([sys/socket.h]) if test $ac_cv_header_sys_socket_h = yes; then HAVE_SYS_SOCKET_H=1 HAVE_WS2TCPIP_H=0 else HAVE_SYS_SOCKET_H=0 if test $ac_cv_header_ws2tcpip_h = yes; then HAVE_WS2TCPIP_H=1 else HAVE_WS2TCPIP_H=0 fi fi AC_SUBST([HAVE_SYS_SOCKET_H]) AC_SUBST([HAVE_WS2TCPIP_H]) ]) # Common prerequisites of the replacement and of the # replacement. # Sets and substitutes HAVE_WINSOCK2_H. AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2], [ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) AC_CHECK_HEADERS_ONCE([sys/socket.h]) if test $ac_cv_header_sys_socket_h != yes; then dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make dnl the check for those headers unconditional; yet cygwin reports dnl that the headers are present but cannot be compiled (since on dnl cygwin, all socket information should come from sys/socket.h). AC_CHECK_HEADERS([winsock2.h]) fi if test "$ac_cv_header_winsock2_h" = yes; then HAVE_WINSOCK2_H=1 UNISTD_H_HAVE_WINSOCK2_H=1 SYS_IOCTL_H_HAVE_WINSOCK2_H=1 else HAVE_WINSOCK2_H=0 fi AC_SUBST([HAVE_WINSOCK2_H]) ]) AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], [ GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) ]) amanda-3.3.6/config/gnulib/lstat.m40000664000076400007640000000511212357250007020556 0ustar00martineamartinea00000000000000# serial 26 # Copyright (C) 1997-2001, 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. AC_DEFUN([gl_FUNC_LSTAT], [ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) dnl If lstat does not exist, the replacement does dnl "#define lstat stat", and lstat.c is a no-op. AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) case "$gl_cv_func_lstat_dereferences_slashed_symlink" in *no) REPLACE_LSTAT=1 ;; esac else HAVE_LSTAT=0 fi ]) # Prerequisites of lib/lstat.c. AC_DEFUN([gl_PREREQ_LSTAT], [:]) AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. AC_CACHE_CHECK([whether lstat correctly handles trailing slash], [gl_cv_func_lstat_dereferences_slashed_symlink], [rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then AC_RUN_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ]])], [gl_cv_func_lstat_dereferences_slashed_symlink=yes], [gl_cv_func_lstat_dereferences_slashed_symlink=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; # If we don't know, assume the worst. *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; esac ]) else # If the 'ln -s' command failed, then we probably don't even # have an lstat function. gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" fi rm -f conftest.sym conftest.file ]) case "$gl_cv_func_lstat_dereferences_slashed_symlink" in *yes) AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], [Define to 1 if 'lstat' dereferences a symlink specified with a trailing slash.]) ;; esac ]) amanda-3.3.6/config/gnulib/base64.m40000664000076400007640000000066412357250007020522 0ustar00martineamartinea00000000000000# base64.m4 serial 4 dnl Copyright (C) 2004, 2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_BASE64], [ gl_PREREQ_BASE64 ]) # Prerequisites of lib/base64.c. AC_DEFUN([gl_PREREQ_BASE64], [ AC_REQUIRE([AC_C_RESTRICT]) ]) amanda-3.3.6/config/gnulib/eealloc.m40000664000076400007640000000166712357250007021046 0ustar00martineamartinea00000000000000# eealloc.m4 serial 3 dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EEALLOC], [ AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_EEREALLOC]) ]) AC_DEFUN([gl_EEMALLOC], [ _AC_FUNC_MALLOC_IF( [gl_cv_func_malloc_0_nonnull=1], [gl_cv_func_malloc_0_nonnull=0]) AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull], [If malloc(0) is != NULL, define this to 1. Otherwise define this to 0.]) ]) AC_DEFUN([gl_EEREALLOC], [ _AC_FUNC_REALLOC_IF( [gl_cv_func_realloc_0_nonnull=1], [gl_cv_func_realloc_0_nonnull=0]) AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull], [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this to 0.]) ]) amanda-3.3.6/config/gnulib/ssize_t.m40000664000076400007640000000146312357250007021114 0ustar00martineamartinea00000000000000# ssize_t.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2001-2003, 2006, 2010-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether ssize_t is defined. AC_DEFUN([gt_TYPE_SSIZE_T], [ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int x = sizeof (ssize_t *) + sizeof (ssize_t); return !x;]])], [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) if test $gt_cv_ssize_t = no; then AC_DEFINE([ssize_t], [int], [Define as a signed type of the same size as size_t.]) fi ]) amanda-3.3.6/config/gnulib/lseek.m40000664000076400007640000000436112357250007020537 0ustar00martineamartinea00000000000000# lseek.m4 serial 10 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_LSEEK], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe], [case "$host_os" in mingw*) dnl Native Windows. dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT) dnl for a pipe depends on the environment: In a Cygwin 1.5 dnl environment it succeeds (wrong); in a Cygwin 1.7 environment dnl it fails with a wrong errno value. gl_cv_func_lseek_pipe=no ;; *) if test $cross_compiling = no; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include /* for off_t */ #include /* for SEEK_CUR */ #if HAVE_UNISTD_H # include #else /* on Windows with MSVC */ # include #endif ]], [[ /* Exit with success only if stdin is seekable. */ return lseek (0, (off_t)0, SEEK_CUR) < 0; ]])], [if test -s conftest$ac_exeext \ && ./conftest$ac_exeext < conftest.$ac_ext \ && test 1 = "`echo hi \ | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then gl_cv_func_lseek_pipe=yes else gl_cv_func_lseek_pipe=no fi ], [gl_cv_func_lseek_pipe=no]) else AC_COMPILE_IFELSE( [AC_LANG_SOURCE([[ #if defined __BEOS__ /* BeOS mistakenly return 0 when trying to seek on pipes. */ Choke me. #endif]])], [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no]) fi ;; esac ]) if test $gl_cv_func_lseek_pipe = no; then REPLACE_LSEEK=1 AC_DEFINE([LSEEK_PIPE_BROKEN], [1], [Define to 1 if lseek does not detect pipes.]) fi AC_REQUIRE([gl_SYS_TYPES_H]) if test $WINDOWS_64_BIT_OFF_T = 1; then REPLACE_LSEEK=1 fi ]) amanda-3.3.6/config/gnulib/printf.m40000664000076400007640000016635012357250007020745 0ustar00martineamartinea00000000000000# printf.m4 serial 50 dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Test whether the *printf family of functions supports the 'j', 'z', 't', dnl 'L' size specifiers. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_sizes_c99. AC_DEFUN([gl_PRINTF_SIZES_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports size specifiers as in C99], [gl_cv_func_printf_sizes_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif static char buf[100]; int main () { int result = 0; #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX buf[0] = '\0'; if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 1; #endif buf[0] = '\0'; if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 || strcmp (buf, "12345672 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 || strcmp (buf, "12345673 33") != 0) result |= 4; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 || strcmp (buf, "1.5 33") != 0) result |= 8; return result; }]])], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_printf_sizes_c99="guessing no";; openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; solaris*) gl_cv_func_printf_sizes_c99="guessing no";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_printf_sizes_c99="guessing no";; netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_sizes_c99="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports 'long double' dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_long_double. AC_DEFUN([gl_PRINTF_LONG_DOUBLE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports 'long double' arguments], [gl_cv_func_printf_long_double], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[10000]; int main () { int result = 0; buf[0] = '\0'; if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000 33") != 0) result |= 1; buf[0] = '\0'; if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000e+00 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.75 33") != 0) result |= 4; return result; }]])], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no], [ changequote(,)dnl case "$host_os" in beos*) gl_cv_func_printf_long_double="guessing no";; mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; *) gl_cv_func_printf_long_double="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports infinite and NaN dnl 'double' arguments and negative zero arguments in the %f, %e, %g dnl directives. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_infinite. AC_DEFUN([gl_PRINTF_INFINITE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], [gl_cv_func_printf_infinite], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static int strisnan (const char *string, size_t start_index, size_t end_index) { if (start_index < end_index) { if (string[start_index] == '-') start_index++; if (start_index + 3 <= end_index && memcmp (string + start_index, "nan", 3) == 0) { start_index += 3; if (start_index == end_index || (string[start_index] == '(' && string[end_index - 1] == ')')) return 1; } } return 0; } static int have_minus_zero () { static double plus_zero = 0.0; double minus_zero = - plus_zero; return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; } static char buf[10000]; static double zero = 0.0; int main () { int result = 0; if (sprintf (buf, "%f", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%f", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%f", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%e", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 4; if (sprintf (buf, "%e", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 4; if (sprintf (buf, "%e", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 8; if (sprintf (buf, "%g", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 16; if (sprintf (buf, "%g", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 16; if (sprintf (buf, "%g", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 32; /* This test fails on HP-UX 10.20. */ if (have_minus_zero ()) if (sprintf (buf, "%g", - zero) < 0 || strcmp (buf, "-0") != 0) result |= 64; return result; }]])], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; darwin*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; hpux*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_printf_infinite="guessing no";; netbsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_infinite="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_infinite="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports infinite and NaN dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_infinite_long_double. AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi case "$gl_cv_func_printf_long_double" in *yes) AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], [gl_cv_func_printf_infinite_long_double], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ ]GL_NOCRASH[ #include #include #include static int strisnan (const char *string, size_t start_index, size_t end_index) { if (start_index < end_index) { if (string[start_index] == '-') start_index++; if (start_index + 3 <= end_index && memcmp (string + start_index, "nan", 3) == 0) { start_index += 3; if (start_index == end_index || (string[start_index] == '(' && string[end_index - 1] == ')')) return 1; } } return 0; } static char buf[10000]; static long double zeroL = 0.0L; int main () { int result = 0; nocrash_init(); if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Le", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else # define LDBL80_WORDS(exponent,manthi,mantlo) \ { mantlo, manthi, exponent } # endif { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; } { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; } { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 4; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 4; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 4; } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 8; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 8; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 8; } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 16; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 16; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 16; } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 32; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 32; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 32; } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 64; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 64; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 64; } #endif return result; }]])], [gl_cv_func_printf_infinite_long_double=yes], [gl_cv_func_printf_infinite_long_double=no], [ changequote(,)dnl case "$host_cpu" in # Guess no on ia64, x86_64, i386. ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; *) case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_infinite_long_double="guessing no";; esac ;; esac changequote([,])dnl ]) ]) ;; *) gl_cv_func_printf_infinite_long_double="irrelevant" ;; esac ]) dnl Test whether the *printf family of functions supports the 'a' and 'A' dnl conversion specifier for hexadecimal output of floating-point numbers. dnl (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_a. AC_DEFUN([gl_PRINTF_DIRECTIVE_A], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], [gl_cv_func_printf_directive_a], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { int result = 0; if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "0x1.922p+1 33") != 0 && strcmp (buf, "0x3.244p+0 33") != 0 && strcmp (buf, "0x6.488p-1 33") != 0 && strcmp (buf, "0xc.91p-2 33") != 0)) result |= 1; if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "-0X1.922P+1 33") != 0 && strcmp (buf, "-0X3.244P+0 33") != 0 && strcmp (buf, "-0X6.488P-1 33") != 0 && strcmp (buf, "-0XC.91P-2 33") != 0)) result |= 2; /* This catches a FreeBSD 6.1 bug: it doesn't round. */ if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 || (strcmp (buf, "0x1.83p+0 33") != 0 && strcmp (buf, "0x3.05p-1 33") != 0 && strcmp (buf, "0x6.0ap-2 33") != 0 && strcmp (buf, "0xc.14p-3 33") != 0)) result |= 4; /* This catches a FreeBSD 6.1 bug. See */ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 || buf[0] == '0') result |= 8; /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ if (sprintf (buf, "%.1a", 1.999) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) result |= 16; /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a glibc 2.4 bug . */ if (sprintf (buf, "%.1La", 1.999L) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) result |= 32; return result; }]])], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no], [ case "$host_os" in # Guess yes on glibc >= 2.5 systems. *-gnu*) AC_EGREP_CPP([BZ2908], [ #include #ifdef __GNU_LIBRARY__ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ BZ2908 #endif #endif ], [gl_cv_func_printf_directive_a="guessing yes"], [gl_cv_func_printf_directive_a="guessing no"]) ;; # If we don't know, assume the worst. *) gl_cv_func_printf_directive_a="guessing no";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the %F format dnl directive. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_f. AC_DEFUN([gl_PRINTF_DIRECTIVE_F], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'F' directive], [gl_cv_func_printf_directive_f], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { int result = 0; if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 || strcmp (buf, "1234567.000000 33") != 0) result |= 1; if (sprintf (buf, "%F", 1.0 / zero) < 0 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) result |= 2; /* This catches a Cygwin 1.5.x bug. */ if (sprintf (buf, "%.F", 1234.0) < 0 || strcmp (buf, "1234") != 0) result |= 4; return result; }]])], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; darwin*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; solaris*) gl_cv_func_printf_sizes_c99="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_printf_directive_f="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports the %n format dnl directive. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_n. AC_DEFUN([gl_PRINTF_DIRECTIVE_N], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'n' directive], [gl_cv_func_printf_directive_n], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #ifdef _MSC_VER /* See page about "Parameter Validation" on msdn.microsoft.com. */ static void cdecl invalid_parameter_handler (const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t dummy) { exit (1); } #endif static char fmtstring[10]; static char buf[100]; int main () { int count = -1; #ifdef _MSC_VER _set_invalid_parameter_handler (invalid_parameter_handler); #endif /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 || strcmp (buf, "123 ") != 0 || count != 4) return 1; return 0; }]])], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no], [ changequote(,)dnl case "$host_os" in mingw*) gl_cv_func_printf_directive_n="guessing no";; *) gl_cv_func_printf_directive_n="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports the %ls format dnl directive and in particular, when a precision is specified, whether dnl the functions stop converting the wide string argument when the number dnl of bytes that have been produced by this conversion equals or exceeds dnl the precision. dnl Result is gl_cv_func_printf_directive_ls. AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'ls' directive], [gl_cv_func_printf_directive_ls], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include #include int main () { int result = 0; char buf[100]; /* Test whether %ls works at all. This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on Cygwin 1.5. */ { static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "abc") != 0) result |= 1; } /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an assertion failure inside libc), but not on OpenBSD 4.0. */ { static const wchar_t wstring[] = { 'a', 0 }; buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "a") != 0) result |= 2; } /* Test whether precisions in %ls are supported as specified in ISO C 99 section 7.19.6.1: "If a precision is specified, no more than that many bytes are written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the multibyte character sequence length given by the precision, the function would need to access a wide character one past the end of the array." This test fails on Solaris 10. */ { static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; buf[0] = '\0'; if (sprintf (buf, "%.2ls", wstring) < 0 || strcmp (buf, "ab") != 0) result |= 8; } return result; }]])], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no], [ changequote(,)dnl case "$host_os" in openbsd*) gl_cv_func_printf_directive_ls="guessing no";; irix*) gl_cv_func_printf_directive_ls="guessing no";; solaris*) gl_cv_func_printf_directive_ls="guessing no";; cygwin*) gl_cv_func_printf_directive_ls="guessing no";; beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; *) gl_cv_func_printf_directive_ls="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with positions. (POSIX:2001) dnl Result is gl_cv_func_printf_positions. AC_DEFUN([gl_PRINTF_POSITIONS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], [gl_cv_func_printf_positions], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }]])], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no], [ changequote(,)dnl case "$host_os" in netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) gl_cv_func_printf_positions="guessing no";; beos*) gl_cv_func_printf_positions="guessing no";; mingw* | pw*) gl_cv_func_printf_positions="guessing no";; *) gl_cv_func_printf_positions="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001) dnl Result is gl_cv_func_printf_flag_grouping. AC_DEFUN([gl_PRINTF_FLAG_GROUPING], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the grouping flag], [gl_cv_func_printf_flag_grouping], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { if (sprintf (buf, "%'d %d", 1234567, 99) < 0 || buf[strlen (buf) - 1] != '9') return 1; return 0; }]])], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no], [ changequote(,)dnl case "$host_os" in cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; *) gl_cv_func_printf_flag_grouping="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports the - flag correctly. dnl (ISO C99.) See dnl dnl Result is gl_cv_func_printf_flag_leftadjust. AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], [gl_cv_func_printf_flag_leftadjust], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { /* Check that a '-' flag is not annihilated by a negative width. */ if (sprintf (buf, "a%-*sc", -3, "b") < 0 || strcmp (buf, "ab c") != 0) return 1; return 0; }]])], [gl_cv_func_printf_flag_leftadjust=yes], [gl_cv_func_printf_flag_leftadjust=no], [ changequote(,)dnl case "$host_os" in # Guess yes on HP-UX 11. hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess no on HP-UX 10 and older. hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; # Guess yes otherwise. *) gl_cv_func_printf_flag_leftadjust="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports padding of non-finite dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See dnl dnl Result is gl_cv_func_printf_flag_zero. AC_DEFUN([gl_PRINTF_FLAG_ZERO], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the zero flag correctly], [gl_cv_func_printf_flag_zero], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 || (strcmp (buf, " inf") != 0 && strcmp (buf, " infinity") != 0)) return 1; return 0; }]])], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_flag_zero="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_flag_zero="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports large precisions. dnl On mingw, precisions larger than 512 are treated like 512, in integer, dnl floating-point or pointer output. On Solaris 10/x86, precisions larger dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC, dnl precisions larger than 510 in floating-point output yield wrong results. dnl On AIX 7.1, precisions larger than 998 in floating-point output yield dnl wrong results. On BeOS, precisions larger than 1044 crash the program. dnl Result is gl_cv_func_printf_precision. AC_DEFUN([gl_PRINTF_PRECISION], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports large precisions], [gl_cv_func_printf_precision], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[5000]; int main () { int result = 0; #ifdef __BEOS__ /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ return 1; #endif if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) result |= 1; if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) result |= 2; if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 || buf[0] != '1') result |= 4; if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 || buf[0] != '1') result |= 4; return result; }]])], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no], [ changequote(,)dnl case "$host_os" in # Guess no only on Solaris, native Windows, and BeOS systems. solaris*) gl_cv_func_printf_precision="guessing no" ;; mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; beos*) gl_cv_func_printf_precision="guessing no" ;; *) gl_cv_func_printf_precision="guessing yes" ;; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions recovers gracefully in case dnl of an out-of-memory condition, or whether it crashes the entire program. dnl Result is gl_cv_func_printf_enomem. AC_DEFUN([gl_PRINTF_ENOMEM], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_MULTIARCH]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf survives out-of-memory conditions], [gl_cv_func_printf_enomem], [ gl_cv_func_printf_enomem="guessing no" if test "$cross_compiling" = no; then if test $APPLE_UNIVERSAL_BUILD = 0; then AC_LANG_CONFTEST([AC_LANG_SOURCE([ ]GL_NOCRASH[ changequote(,)dnl #include #include #include #include #include int main() { struct rlimit limit; int ret; nocrash_init (); /* Some printf implementations allocate temporary space with malloc. */ /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ #ifdef RLIMIT_DATA if (getrlimit (RLIMIT_DATA, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_DATA, &limit) < 0) return 77; #endif /* On Linux systems, malloc() is limited by RLIMIT_AS. */ #ifdef RLIMIT_AS if (getrlimit (RLIMIT_AS, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_AS, &limit) < 0) return 77; #endif /* Some printf implementations allocate temporary space on the stack. */ #ifdef RLIMIT_STACK if (getrlimit (RLIMIT_STACK, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_STACK, &limit) < 0) return 77; #endif ret = printf ("%.5000000f", 1.0); return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then (./conftest 2>&AS_MESSAGE_LOG_FD result=$? _AS_ECHO_LOG([\$? = $result]) if test $result != 0 && test $result != 77; then result=1; fi exit $result ) >/dev/null 2>/dev/null case $? in 0) gl_cv_func_printf_enomem="yes" ;; 77) gl_cv_func_printf_enomem="guessing no" ;; *) gl_cv_func_printf_enomem="no" ;; esac else gl_cv_func_printf_enomem="guessing no" fi rm -fr conftest* else dnl A universal build on Apple Mac OS X platforms. dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. dnl But we need a configuration result that is valid in both modes. gl_cv_func_printf_enomem="guessing no" fi fi if test "$gl_cv_func_printf_enomem" = "guessing no"; then changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on Solaris. solaris*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on AIX. aix*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on HP-UX/hppa. hpux*) case "$host_cpu" in hppa*) gl_cv_func_printf_enomem="guessing yes";; *) gl_cv_func_printf_enomem="guessing no";; esac ;; # Guess yes on IRIX. irix*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on OSF/1. osf*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on Haiku. haiku*) gl_cv_func_printf_enomem="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_enomem="guessing no";; esac changequote([,])dnl fi ]) ]) dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001) dnl Result is ac_cv_func_snprintf. AC_DEFUN([gl_SNPRINTF_PRESENCE], [ AC_CHECK_FUNCS_ONCE([snprintf]) ]) dnl Test whether the string produced by the snprintf function is always NUL dnl terminated. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_snprintf_truncation_c99. AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf truncates the result as in C99], [gl_cv_func_snprintf_truncation_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); my_snprintf (buf, 3, "%d %d", 4567, 89); if (memcmp (buf, "45\0DEF", 6) != 0) return 1; return 0; }]])], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_snprintf_truncation_c99="guessing no";; openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_snprintf_truncation_c99="guessing no";; solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on IRIX >= 6.5. irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on OSF/1 >= 5. osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_truncation_c99="guessing no";; netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_truncation_c99="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the return value of the snprintf function is the number dnl of bytes (excluding the terminating NUL) that would have been produced dnl if the buffer had been large enough. (ISO C99, POSIX:2001) dnl For example, this test program fails on IRIX 6.5: dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { dnl static char buf[8]; dnl int retval = snprintf (buf, 3, "%d", 12345); dnl return retval >= 0 && retval < 3; dnl } dnl --------------------------------------------------------------------- dnl Result is gl_cv_func_snprintf_retval_c99. AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], [gl_cv_func_snprintf_retval_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) return 1; if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) return 2; if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) return 3; return 0; }]])], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_snprintf_retval_c99="guessing no";; openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; solaris*) gl_cv_func_printf_sizes_c99="guessing no";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_retval_c99="guessing no";; netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_retval_c99="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the snprintf function supports the %n format directive dnl also in truncated portions of the format string. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_snprintf_directive_n. AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], [gl_cv_func_snprintf_directive_n], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static char fmtstring[10]; static char buf[100]; int main () { int count = -1; /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); if (count != 6) return 1; return 0; }]])], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_snprintf_directive_n="guessing no";; solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; aix*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on IRIX >= 6.5. irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on OSF/1 >= 5. osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; osf*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_directive_n="guessing no";; netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_directive_n="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_directive_n="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the snprintf function, when passed a size = 1, writes any dnl output without bounds in this case, behaving like sprintf. This is the dnl case on Linux libc5. dnl Result is gl_cv_func_snprintf_size1. AC_DEFUN([gl_SNPRINTF_SIZE1], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf respects a size of 1], [gl_cv_func_snprintf_size1], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif int main() { static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }]])], [gl_cv_func_snprintf_size1=yes], [gl_cv_func_snprintf_size1=no], [gl_cv_func_snprintf_size1="guessing yes"]) ]) ]) dnl Test whether the vsnprintf function, when passed a zero size, produces no dnl output. (ISO C99, POSIX:2001) dnl For example, snprintf nevertheless writes a NUL byte in this case dnl on OSF/1 5.1: dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } dnl --------------------------------------------------------------------- dnl And vsnprintf writes any output without bounds in this case, behaving like dnl vsprintf, on HP-UX 11 and OSF/1 5.1: dnl --------------------------------------------------------------------- dnl #include dnl #include dnl static int my_snprintf (char *buf, int size, const char *format, ...) dnl { dnl va_list args; dnl int ret; dnl va_start (args, format); dnl ret = vsnprintf (buf, size, format, args); dnl va_end (args); dnl return ret; dnl } dnl int main() dnl { dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } dnl --------------------------------------------------------------------- dnl Result is gl_cv_func_vsnprintf_zerosize_c99. AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], [gl_cv_func_vsnprintf_zerosize_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } int main() { static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }]])], [gl_cv_func_vsnprintf_zerosize_c99=yes], [gl_cv_func_vsnprintf_zerosize_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Cygwin. cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on IRIX >= 6.5. irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on mingw. mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; esac changequote([,])dnl ]) ]) ]) dnl The results of these tests on various platforms are: dnl dnl 1 = gl_PRINTF_SIZES_C99 dnl 2 = gl_PRINTF_LONG_DOUBLE dnl 3 = gl_PRINTF_INFINITE dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE dnl 5 = gl_PRINTF_DIRECTIVE_A dnl 6 = gl_PRINTF_DIRECTIVE_F dnl 7 = gl_PRINTF_DIRECTIVE_N dnl 8 = gl_PRINTF_DIRECTIVE_LS dnl 9 = gl_PRINTF_POSITIONS dnl 10 = gl_PRINTF_FLAG_GROUPING dnl 11 = gl_PRINTF_FLAG_LEFTADJUST dnl 12 = gl_PRINTF_FLAG_ZERO dnl 13 = gl_PRINTF_PRECISION dnl 14 = gl_PRINTF_ENOMEM dnl 15 = gl_SNPRINTF_PRESENCE dnl 16 = gl_SNPRINTF_TRUNCATION_C99 dnl 17 = gl_SNPRINTF_RETVAL_C99 dnl 18 = gl_SNPRINTF_DIRECTIVE_N dnl 19 = gl_SNPRINTF_SIZE1 dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports 'long double' arguments... dnl 3 = checking whether printf supports infinite 'double' arguments... dnl 4 = checking whether printf supports infinite 'long double' arguments... dnl 5 = checking whether printf supports the 'a' and 'A' directives... dnl 6 = checking whether printf supports the 'F' directive... dnl 7 = checking whether printf supports the 'n' directive... dnl 8 = checking whether printf supports the 'ls' directive... dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... dnl 10 = checking whether printf supports the grouping flag... dnl 11 = checking whether printf supports the left-adjust flag correctly... dnl 12 = checking whether printf supports the zero flag correctly... dnl 13 = checking whether printf supports large precisions... dnl 14 = checking whether printf survives out-of-memory conditions... dnl 15 = checking for snprintf... dnl 16 = checking whether snprintf truncates the result as in C99... dnl 17 = checking whether snprintf returns a byte count as in C99... dnl 18 = checking whether snprintf fully supports the 'n' directive... dnl 19 = checking whether snprintf respects a size of 1... dnl 20 = checking whether vsnprintf respects a zero size as in C99... dnl dnl . = yes, # = no. dnl dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . . dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . dnl Haiku . . . # # # . # . . . . . ? . . ? . . . dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . amanda-3.3.6/config/gnulib/gnulib-common.m40000664000076400007640000003332112357250007022200 0ustar00martineamartinea00000000000000# gnulib-common.m4 serial 33 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # gl_COMMON # is expanded unconditionally through gnulib-tool magic. AC_DEFUN([gl_COMMON], [ dnl Use AC_REQUIRE here, so that the code is expanded once only. AC_REQUIRE([gl_00GNULIB]) AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ AH_VERBATIM([_Noreturn], [/* The _Noreturn keyword of C11. */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif ]) AH_VERBATIM([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) AH_VERBATIM([unused_parameter], [/* Define as a marker that can be attached to declarations that might not be used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _GL_UNUSED __attribute__ ((__unused__)) #else # define _GL_UNUSED #endif /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else # define _GL_ATTRIBUTE_PURE /* empty */ #endif /* The __const__ attribute was added in gcc 2.95. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else # define _GL_ATTRIBUTE_CONST /* empty */ #endif ]) dnl Preparation for running test programs: dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not dnl to /dev/tty, so they can be redirected to log files. Such diagnostics dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N. LIBC_FATAL_STDERR_=1 export LIBC_FATAL_STDERR_ ]) # gl_MODULE_INDICATOR_CONDITION # expands to a C preprocessor expression that evaluates to 1 or 0, depending # whether a gnulib module that has been requested shall be considered present # or not. m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) # sets the shell variable that indicates the presence of the given module to # a C preprocessor expression that will evaluate to 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ gl_MODULE_INDICATOR_SET_VARIABLE_AUX( [GNULIB_[]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) ]) # gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) # modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. # The shell variable's value is a C preprocessor expression that evaluates # to 0 or 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], [ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], [ dnl Simplify the expression VALUE || 1 to 1. $1=1 ], [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], [gl_MODULE_INDICATOR_CONDITION])]) ]) # gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) # modifies the shell variable to include the given condition. The shell # variable's value is a C preprocessor expression that evaluates to 0 or 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], [ dnl Simplify the expression 1 || CONDITION to 1. if test "$[]$1" != 1; then dnl Simplify the expression 0 || CONDITION to CONDITION. if test "$[]$1" = 0; then $1=$2 else $1="($[]$1 || $2)" fi fi ]) # gl_MODULE_INDICATOR([modulename]) # defines a C macro indicating the presence of the given module # in a location where it can be used. # | Value | Value | # | in lib/ | in tests/ | # --------------------------------------------+---------+-----------+ # Module present among main modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module present among tests-related modules: | 0 | 1 | # --------------------------------------------+---------+-----------+ # Module not present at all: | 0 | 0 | # --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR], [ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [gl_MODULE_INDICATOR_CONDITION], [Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module $1 shall be considered present.]) ]) # gl_MODULE_INDICATOR_FOR_TESTS([modulename]) # defines a C macro indicating the presence of the given module # in lib or tests. This is useful to determine whether the module # should be tested. # | Value | Value | # | in lib/ | in tests/ | # --------------------------------------------+---------+-----------+ # Module present among main modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module present among tests-related modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module not present at all: | 0 | 0 | # --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], [Define to 1 when the gnulib module $1 should be tested.]) ]) # gl_ASSERT_NO_GNULIB_POSIXCHECK # asserts that there will never be a need to #define GNULIB_POSIXCHECK. # and thereby enables an optimization of configure and config.h. # Used by Emacs. AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], [ dnl Override gl_WARN_ON_USE_PREPARE. dnl But hide this definition from 'aclocal'. AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) ]) # gl_ASSERT_NO_GNULIB_TESTS # asserts that there will be no gnulib tests in the scope of the configure.ac # and thereby enables an optimization of config.h. # Used by Emacs. AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], [ dnl Override gl_MODULE_INDICATOR_FOR_TESTS. AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) ]) # Test whether exists. # Set HAVE_FEATURES_H. AC_DEFUN([gl_FEATURES_H], [ AC_CHECK_HEADERS_ONCE([features.h]) if test $ac_cv_header_features_h = yes; then HAVE_FEATURES_H=1 else HAVE_FEATURES_H=0 fi AC_SUBST([HAVE_FEATURES_H]) ]) # m4_foreach_w # is a backport of autoconf-2.59c's m4_foreach_w. # Remove this macro when we can assume autoconf >= 2.60. m4_ifndef([m4_foreach_w], [m4_define([m4_foreach_w], [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) # AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) # ---------------------------------------------------- # Backport of autoconf-2.63b's macro. # Remove this macro when we can assume autoconf >= 2.64. m4_ifndef([AS_VAR_IF], [m4_define([AS_VAR_IF], [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) # gl_PROG_CC_C99 # Modifies the value of the shell variable CC in an attempt to make $CC # understand ISO C99 source code. # This is like AC_PROG_CC_C99, except that # - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC # , # but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 # . # Remaining problems: # - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options # to CC twice # . # - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. AC_DEFUN([gl_PROG_CC_C99], [ dnl Change that version number to the minimum Autoconf version that supports dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. m4_version_prereq([9.0], [AC_REQUIRE([AC_PROG_CC_C99])], [AC_REQUIRE([AC_PROG_CC_STDC])]) ]) # gl_PROG_AR_RANLIB # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override # the values. AC_DEFUN([gl_PROG_AR_RANLIB], [ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler dnl as "cc", and GCC as "gcc". They have different object file formats and dnl library formats. In particular, the GNU binutils programs ar, ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], [ #ifdef __ACK__ Amsterdam #endif ], [gl_cv_c_amsterdam_compiler=yes], [gl_cv_c_amsterdam_compiler=no]) ]) if test -z "$AR"; then if test $gl_cv_c_amsterdam_compiler = yes; then AR='cc -c.a' if test -z "$ARFLAGS"; then ARFLAGS='-o' fi else dnl Use the Automake-documented default values for AR and ARFLAGS, dnl but prefer ${host}-ar over ar (useful for cross-compiling). AC_CHECK_TOOL([AR], [ar], [ar]) if test -z "$ARFLAGS"; then ARFLAGS='cru' fi fi else if test -z "$ARFLAGS"; then ARFLAGS='cru' fi fi AC_SUBST([AR]) AC_SUBST([ARFLAGS]) if test -z "$RANLIB"; then if test $gl_cv_c_amsterdam_compiler = yes; then RANLIB=':' else dnl Use the ranlib program if it is available. AC_PROG_RANLIB fi fi AC_SUBST([RANLIB]) ]) # AC_PROG_MKDIR_P # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix # for interoperability with automake-1.9.6 from autoconf-2.62. # Remove this macro when we can assume autoconf >= 2.62 or # autoconf >= 2.60 && automake >= 1.10. # AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. m4_ifndef([AC_AUTOCONF_VERSION],[ m4_ifdef([AC_PROG_MKDIR_P], [ dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed. m4_define([AC_PROG_MKDIR_P], m4_defn([AC_PROG_MKDIR_P])[ AC_SUBST([MKDIR_P])])], [ dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P. AC_DEFUN_ONCE([AC_PROG_MKDIR_P], [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake MKDIR_P='$(mkdir_p)' AC_SUBST([MKDIR_P])])]) ]) # AC_C_RESTRICT # This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. # AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. m4_ifndef([AC_AUTOCONF_VERSION],[ AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[typedef int * int_ptr; int foo (int_ptr $ac_kw ip) { return ip[0]; }]], [[int s[1]; int * $ac_kw t = s; t[0] = 0; return foo(t)]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done ]) AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Work around a bug in Sun C++: it does not support _Restrict, even though the corresponding Sun C compiler does, which causes "#define restrict _Restrict" in the previous line. Perhaps some future version of Sun C++ will work with _Restrict; if so, it'll probably define __RESTRICT, just as Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict #endif]) case $ac_cv_c_restrict in restrict) ;; no) AC_DEFINE([restrict], []) ;; *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) ]) # gl_BIGENDIAN # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. # Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some # macros invoke AC_C_BIGENDIAN with arguments. AC_DEFUN([gl_BIGENDIAN], [ AC_C_BIGENDIAN ]) # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not # output a spurious "(cached)" mark in the midst of other configure output. # This macro should be used instead of AC_CACHE_VAL when it is not surrounded # by an AC_MSG_CHECKING/AC_MSG_RESULT pair. AC_DEFUN([gl_CACHE_VAL_SILENT], [ saved_as_echo_n="$as_echo_n" as_echo_n=':' AC_CACHE_VAL([$1], [$2]) as_echo_n="$saved_as_echo_n" ]) amanda-3.3.6/config/gnulib/arpa_inet_h.m40000664000076400007640000000357112357250007021707 0ustar00martineamartinea00000000000000# arpa_inet_h.m4 serial 13 dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson and Bruno Haible AC_DEFUN([gl_HEADER_ARPA_INET], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) AC_CHECK_HEADERS_ONCE([arpa/inet.h]) if test $ac_cv_header_arpa_inet_h = yes; then HAVE_ARPA_INET_H=1 else HAVE_ARPA_INET_H=0 fi AC_SUBST([HAVE_ARPA_INET_H]) dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([arpa/inet.h]) AC_REQUIRE([gl_FEATURES_H]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* On some systems, this header is not self-consistent. */ #if !(defined __GLIBC__ || defined __UCLIBC__) # include #endif #ifdef __TANDEM # include #endif #include ]], [inet_ntop inet_pton]) ]) AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], [ GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP]) REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON]) ]) amanda-3.3.6/config/gnulib/string_h.m40000664000076400007640000001271412357250007021252 0ustar00martineamartinea00000000000000# Configure a GNU-like replacement for . # Copyright (C) 2007-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 21 # Written by Paul Eggert. AC_DEFUN([gl_HEADER_STRING_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_HEADER_STRING_H_BODY]) ]) AC_DEFUN([gl_HEADER_STRING_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_NEXT_HEADERS([string.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include ]], [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp]) ]) AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) amanda-3.3.6/config/gnulib/safe-write.m40000664000076400007640000000061112357250007021474 0ustar00martineamartinea00000000000000# safe-write.m4 serial 4 dnl Copyright (C) 2002, 2005-2006, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prerequisites of lib/safe-write.c. AC_DEFUN([gl_PREREQ_SAFE_WRITE], [ gl_PREREQ_SAFE_READ ]) amanda-3.3.6/config/gnulib/extern-inline.m40000664000076400007640000000571112357250007022215 0ustar00martineamartinea00000000000000dnl 'extern inline' a la ISO C99. dnl Copyright 2012-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EXTERN_INLINE], [ AH_VERBATIM([extern_inline], [/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. _GL_INLINE_HEADER_BEGIN contains useful stuff to put in an include file, before uses of _GL_INLINE. It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, when FOO is an inline function in the header; see . _GL_INLINE_HEADER_END contains useful stuff to put in the same include file, after uses of _GL_INLINE. Suppress extern inline with HP-UX cc, as it appears to be broken; see . Suppress extern inline with Sun C in standards-conformance mode, as it mishandles inline functions that call each other. E.g., for 'inline void f (void) { } inline void g (void) { f (); }', c99 incorrectly complains 'reference to static identifier "f" in extern inline function'. This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. Suppress the use of extern inline on Apple's platforms, as Libc at least through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g., . Perhaps Apple will fix this some day. */ #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined __APPLE__) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__ # if __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) # else # define _GL_INLINE extern inline # endif # define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static _GL_UNUSED # define _GL_EXTERN_INLINE static _GL_UNUSED #endif #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ _GL_INLINE_HEADER_CONST_PRAGMA # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") #else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif]) ]) amanda-3.3.6/config/gnulib/lock.m40000664000076400007640000000266712357250007020373 0ustar00martineamartinea00000000000000# lock.m4 serial 13 (gettext-0.18.2) dnl Copyright (C) 2005-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_LOCK], [ AC_REQUIRE([gl_THREADLIB]) if test "$gl_threads_api" = posix; then # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], [Define if the POSIX multithreading library has read/write locks.])], [], [#include ]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. AC_COMPILE_IFELSE([ AC_LANG_PROGRAM( [[#include ]], [[ #if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif ]])], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) fi gl_PREREQ_LOCK ]) # Prerequisites of lib/glthread/lock.c. AC_DEFUN([gl_PREREQ_LOCK], [:]) amanda-3.3.6/config/gnulib/nl_langinfo.m40000664000076400007640000000352412357250007021722 0ustar00martineamartinea00000000000000# nl_langinfo.m4 serial 5 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_NL_LANGINFO], [ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) AC_REQUIRE([gl_LANGINFO_H]) AC_CHECK_FUNCS_ONCE([nl_langinfo]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $ac_cv_func_nl_langinfo = yes; then # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. AC_CACHE_CHECK([whether YESEXPR works], [gl_cv_func_nl_langinfo_yesexpr_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[return !*nl_langinfo(YESEXPR); ]])], [gl_cv_func_nl_langinfo_yesexpr_works=yes], [gl_cv_func_nl_langinfo_yesexpr_works=no], [ case "$host_os" in # Guess no on irix systems. irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; # Guess yes elsewhere. *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; esac ]) ]) case $gl_cv_func_nl_langinfo_yesexpr_works in *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; esac AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], [$FUNC_NL_LANGINFO_YESEXPR_WORKS], [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then : else REPLACE_NL_LANGINFO=1 AC_DEFINE([REPLACE_NL_LANGINFO], [1], [Define if nl_langinfo exists but is overridden by gnulib.]) fi else HAVE_NL_LANGINFO=0 fi ]) amanda-3.3.6/config/gnulib/getaddrinfo.m40000664000076400007640000001345312357250007021724 0ustar00martineamartinea00000000000000# getaddrinfo.m4 serial 30 dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_GETADDRINFO], [ AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) GETADDRINFO_LIB= gai_saved_LIBS="$LIBS" dnl Where is getaddrinfo()? dnl - On Solaris, it is in libsocket. dnl - On Haiku, it is in libnetwork. dnl - On BeOS, it is in libnet. dnl - On native Windows, it is in ws2_32.dll. dnl - Otherwise it is in libc. AC_SEARCH_LIBS([getaddrinfo], [socket network net], [if test "$ac_cv_search_getaddrinfo" != "none required"; then GETADDRINFO_LIB="$ac_cv_search_getaddrinfo" fi]) LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" HAVE_GETADDRINFO=1 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #include ]], [[getaddrinfo("", "", NULL, NULL);]])], [gl_cv_func_getaddrinfo=yes], [gl_cv_func_getaddrinfo=no])]) if test $gl_cv_func_getaddrinfo = no; then AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_WS2TCPIP_H #include #endif #include ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes]) LIBS="$am_save_LIBS" ]) if test "$gl_cv_w32_getaddrinfo" = "yes"; then GETADDRINFO_LIB="-lws2_32" LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else HAVE_GETADDRINFO=0 fi fi # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an # inline function declared in ws2tcpip.h, so we need to get that # header included somehow. AC_CHECK_DECLS([gai_strerror], [], [], [[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #include ]]) if test $ac_cv_have_decl_gai_strerror = yes; then AC_CHECK_DECLS([gai_strerrorA], [], [], [[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #include ]]) dnl check for correct signature AC_CACHE_CHECK([for gai_strerror with POSIX signature], [gl_cv_func_gai_strerror_posix_signature], [ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #include extern #ifdef __cplusplus "C" #endif const char *gai_strerror(int);]])], [gl_cv_func_gai_strerror_posix_signature=yes], [gl_cv_func_gai_strerror_posix_signature=no])]) if test $gl_cv_func_gai_strerror_posix_signature = no; then REPLACE_GAI_STRERROR=1 fi fi LIBS="$gai_saved_LIBS" gl_PREREQ_GETADDRINFO AC_SUBST([GETADDRINFO_LIB]) ]) # Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c. AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_REQUIRE([gl_NETDB_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB AC_REQUIRE([gl_FUNC_INET_NTOP]) dnl for INET_NTOP_LIB AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl Including sys/socket.h is wrong for Windows, but Windows does not dnl have sa_len so the result is correct anyway. AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [ #include #include ]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]]) if test $ac_cv_have_decl_getaddrinfo = no; then HAVE_DECL_GETADDRINFO=0 fi if test $ac_cv_have_decl_freeaddrinfo = no; then HAVE_DECL_FREEADDRINFO=0 fi if test $ac_cv_have_decl_gai_strerror = no; then HAVE_DECL_GAI_STRERROR=0 fi if test $ac_cv_have_decl_getnameinfo = no; then HAVE_DECL_GETNAMEINFO=0 fi AC_CHECK_TYPES([struct addrinfo],,,[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]) if test $ac_cv_type_struct_addrinfo = no; then HAVE_STRUCT_ADDRINFO=0 fi dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. case " $GETADDRINFO_LIB " in *" $HOSTENT_LIB "*) ;; *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;; esac dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. case " $GETADDRINFO_LIB " in *" $SERVENT_LIB "*) ;; *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;; esac dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. case " $GETADDRINFO_LIB " in *" $INET_NTOP_LIB "*) ;; *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;; esac ]) amanda-3.3.6/config/gnulib/ftruncate.m40000664000076400007640000000233312357250007021424 0ustar00martineamartinea00000000000000# serial 20 # See if we need to emulate a missing ftruncate function using chsize. # Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FTRUNCATE], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([ftruncate]) if test $ac_cv_func_ftruncate = yes; then m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw*) dnl Native Windows, and Large File Support is requested. dnl The MSVCRT _chsize() function only accepts a 32-bit file size, dnl and the mingw64 ftruncate64() function is unreliable (it may dnl delete the file, see dnl ). dnl Use gnulib's ftruncate() implementation instead. REPLACE_FTRUNCATE=1 ;; esac ], [ : ]) else HAVE_FTRUNCATE=0 fi ]) # Prerequisites of lib/ftruncate.c. AC_DEFUN([gl_PREREQ_FTRUNCATE], [ AC_CHECK_FUNCS([chsize]) ]) amanda-3.3.6/config/gnulib/glibc21.m40000664000076400007640000000161312357250007020654 0ustar00martineamartinea00000000000000# glibc21.m4 serial 5 dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer, or uClibc. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], [ac_cv_gnu_library_2_1], [AC_EGREP_CPP([Lucky], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif #ifdef __UCLIBC__ Lucky user #endif ], [ac_cv_gnu_library_2_1=yes], [ac_cv_gnu_library_2_1=no]) ] ) AC_SUBST([GLIBC21]) GLIBC21="$ac_cv_gnu_library_2_1" ] ) amanda-3.3.6/config/gnulib/regex.m40000664000076400007640000002603512357250007020550 0ustar00martineamartinea00000000000000# serial 64 # Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl Initially derived from code in GNU grep. dnl Mostly written by Jim Meyering. AC_PREREQ([2.50]) AC_DEFUN([gl_REGEX], [ AC_ARG_WITH([included-regex], [AS_HELP_STRING([--without-included-regex], [don't compile regex; this is the default on systems with recent-enough versions of the GNU C Library (use with caution on other systems).])]) case $with_included_regex in #( yes|no) ac_use_included_regex=$with_included_regex ;; '') # If the system regex support is good enough that it passes the # following run test, then default to *not* using the included regex.c. # If cross compiling, assume the test would fail and use the included # regex.c. AC_CHECK_DECLS_ONCE([alarm]) AC_CACHE_CHECK([for working re_compile_pattern], [gl_cv_func_re_compile_pattern_working], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #include #include #if HAVE_DECL_ALARM # include # include #endif ]], [[int result = 0; static struct re_pattern_buffer regex; unsigned char folded_chars[UCHAR_MAX + 1]; int i; const char *s; struct re_registers regs; #if HAVE_DECL_ALARM /* Some builds of glibc go into an infinite loop on this test. */ signal (SIGALRM, SIG_DFL); alarm (2); #endif if (setlocale (LC_ALL, "en_US.UTF-8")) { { /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html This test needs valgrind to catch the bug on Debian GNU/Linux 3.1 x86, but it might catch the bug better on other platforms and it shouldn't hurt to try the test here. */ static char const pat[] = "insert into"; static char const data[] = "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | RE_ICASE); memset (®ex, 0, sizeof regex); s = re_compile_pattern (pat, sizeof pat - 1, ®ex); if (s) result |= 1; else if (re_search (®ex, data, sizeof data - 1, 0, sizeof data - 1, ®s) != -1) result |= 1; } { /* This test is from glibc bug 15078. The test case is from Andreas Schwab in . */ static char const pat[] = "[^x]x"; static char const data[] = /* */ "\xe1\x80\x80" "\xe1\x80\xbb" "\xe1\x80\xbd" "\xe1\x80\x94" "\xe1\x80\xba" "\xe1\x80\xaf" "\xe1\x80\x95" "\xe1\x80\xba" "x"; re_set_syntax (0); memset (®ex, 0, sizeof regex); s = re_compile_pattern (pat, sizeof pat - 1, ®ex); if (s) result |= 1; else { i = re_search (®ex, data, sizeof data - 1, 0, sizeof data - 1, 0); if (i != 0 && i != 21) result |= 1; } } if (! setlocale (LC_ALL, "C")) return 1; } /* This test is from glibc bug 3957, reported by Andrew Mackey. */ re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); memset (®ex, 0, sizeof regex); s = re_compile_pattern ("a[^x]b", 6, ®ex); if (s) result |= 2; /* This should fail, but succeeds for glibc-2.5. */ else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) result |= 2; /* This regular expression is from Spencer ere test number 75 in grep-2.3. */ re_set_syntax (RE_SYNTAX_POSIX_EGREP); memset (®ex, 0, sizeof regex); for (i = 0; i <= UCHAR_MAX; i++) folded_chars[i] = i; regex.translate = folded_chars; s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); /* This should fail with _Invalid character class name_ error. */ if (!s) result |= 4; /* Ensure that [b-a] is diagnosed as invalid, when using RE_NO_EMPTY_RANGES. */ re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); memset (®ex, 0, sizeof regex); s = re_compile_pattern ("a[b-a]", 6, ®ex); if (s == 0) result |= 8; /* This should succeed, but does not for glibc-2.1.3. */ memset (®ex, 0, sizeof regex); s = re_compile_pattern ("{1", 2, ®ex); if (s) result |= 8; /* The following example is derived from a problem report against gawk from Jorge Stolfi . */ memset (®ex, 0, sizeof regex); s = re_compile_pattern ("[an\371]*n", 7, ®ex); if (s) result |= 8; /* This should match, but does not for glibc-2.2.1. */ else if (re_match (®ex, "an", 2, 0, ®s) != 2) result |= 8; memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) result |= 8; /* glibc-2.2.93 does not work with a negative RANGE argument. */ else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) result |= 8; /* The version of regex.c in older versions of gnulib ignored RE_ICASE. Detect that problem too. */ re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) result |= 16; else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) result |= 16; /* Catch a bug reported by Vin Shelton in http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html */ re_set_syntax (RE_SYNTAX_POSIX_BASIC & ~RE_CONTEXT_INVALID_DUP & ~RE_NO_EMPTY_RANGES); memset (®ex, 0, sizeof regex); s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); if (s) result |= 32; /* REG_STARTEND was added to glibc on 2004-01-15. Reject older versions. */ if (! REG_STARTEND) result |= 64; #if 0 /* It would be nice to reject hosts whose regoff_t values are too narrow (including glibc on hosts with 64-bit ptrdiff_t and 32-bit int), but we should wait until glibc implements this feature. Otherwise, support for equivalence classes and multibyte collation symbols would always be broken except when compiling --without-included-regex. */ if (sizeof (regoff_t) < sizeof (ptrdiff_t) || sizeof (regoff_t) < sizeof (ssize_t)) result |= 64; #endif return result; ]])], [gl_cv_func_re_compile_pattern_working=yes], [gl_cv_func_re_compile_pattern_working=no], dnl When crosscompiling, assume it is not working. [gl_cv_func_re_compile_pattern_working=no])]) case $gl_cv_func_re_compile_pattern_working in #( yes) ac_use_included_regex=no;; #( no) ac_use_included_regex=yes;; esac ;; *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex]) ;; esac if test $ac_use_included_regex = yes; then AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], [Define if you want to include , so that it consistently overrides 's RE_DUP_MAX.]) AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], [Define if you want regoff_t to be at least as wide POSIX requires.]) AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], [Define to rpl_re_syntax_options if the replacement should be used.]) AC_DEFINE([re_set_syntax], [rpl_re_set_syntax], [Define to rpl_re_set_syntax if the replacement should be used.]) AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern], [Define to rpl_re_compile_pattern if the replacement should be used.]) AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap], [Define to rpl_re_compile_fastmap if the replacement should be used.]) AC_DEFINE([re_search], [rpl_re_search], [Define to rpl_re_search if the replacement should be used.]) AC_DEFINE([re_search_2], [rpl_re_search_2], [Define to rpl_re_search_2 if the replacement should be used.]) AC_DEFINE([re_match], [rpl_re_match], [Define to rpl_re_match if the replacement should be used.]) AC_DEFINE([re_match_2], [rpl_re_match_2], [Define to rpl_re_match_2 if the replacement should be used.]) AC_DEFINE([re_set_registers], [rpl_re_set_registers], [Define to rpl_re_set_registers if the replacement should be used.]) AC_DEFINE([re_comp], [rpl_re_comp], [Define to rpl_re_comp if the replacement should be used.]) AC_DEFINE([re_exec], [rpl_re_exec], [Define to rpl_re_exec if the replacement should be used.]) AC_DEFINE([regcomp], [rpl_regcomp], [Define to rpl_regcomp if the replacement should be used.]) AC_DEFINE([regexec], [rpl_regexec], [Define to rpl_regexec if the replacement should be used.]) AC_DEFINE([regerror], [rpl_regerror], [Define to rpl_regerror if the replacement should be used.]) AC_DEFINE([regfree], [rpl_regfree], [Define to rpl_regfree if the replacement should be used.]) fi ]) # Prerequisites of lib/regex.c and lib/regex_internal.c. AC_DEFUN([gl_PREREQ_REGEX], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_REQUIRE([gl_EEMALLOC]) AC_CHECK_HEADERS([libintl.h]) AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll]) AC_CHECK_DECLS([isblank], [], [], [[#include ]]) ]) amanda-3.3.6/config/gnulib/btowc.m40000664000076400007640000000613312357250007020551 0ustar00martineamartinea00000000000000# btowc.m4 serial 10 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_BTOWC], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) dnl Check whether is usable at all, first. Otherwise the test dnl program below may lead to an endless loop. See dnl . AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) AC_CHECK_FUNCS_ONCE([btowc]) if test $ac_cv_func_btowc = no; then HAVE_BTOWC=0 else AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0. AC_CACHE_CHECK([whether btowc(0) is correct], [gl_cv_func_btowc_nul], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { if (btowc ('\0') != 0) return 1; return 0; }]])], [gl_cv_func_btowc_nul=yes], [gl_cv_func_btowc_nul=no], [ changequote(,)dnl case "$host_os" in # Guess no on Cygwin. cygwin*) gl_cv_func_btowc_nul="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_btowc_nul="guessing yes" ;; esac changequote([,])dnl ]) ]) dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. AC_CACHE_CHECK([whether btowc(EOF) is correct], [gl_cv_func_btowc_eof], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on IRIX. irix*) gl_cv_func_btowc_eof="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_btowc_eof="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) { if (btowc (EOF) != WEOF) return 1; } return 0; }]])], [gl_cv_func_btowc_eof=yes], [gl_cv_func_btowc_eof=no], [:]) fi ]) case "$gl_cv_func_btowc_nul" in *yes) ;; *) REPLACE_BTOWC=1 ;; esac case "$gl_cv_func_btowc_eof" in *yes) ;; *) REPLACE_BTOWC=1 ;; esac fi ]) # Prerequisites of lib/btowc.c. AC_DEFUN([gl_PREREQ_BTOWC], [ : ]) amanda-3.3.6/config/gnulib/mbtowc.m40000664000076400007640000000071412357250007020725 0ustar00martineamartinea00000000000000# mbtowc.m4 serial 2 dnl Copyright (C) 2011-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MBTOWC], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) if false; then REPLACE_MBTOWC=1 fi ]) # Prerequisites of lib/mbtowc.c. AC_DEFUN([gl_PREREQ_MBTOWC], [ : ]) amanda-3.3.6/config/gnulib/mmap-anon.m40000664000076400007640000000373312357250007021321 0ustar00martineamartinea00000000000000# mmap-anon.m4 serial 10 dnl Copyright (C) 2005, 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Detect how mmap can be used to create anonymous (not file-backed) memory # mappings. # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS # and MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. # - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. AC_DEFUN([gl_FUNC_MMAP_ANON], [ dnl Persuade glibc to define MAP_ANONYMOUS. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is # irrelevant for anonymous mappings. AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) # Try to allow MAP_ANONYMOUS. gl_have_mmap_anonymous=no if test $gl_have_mmap = yes; then AC_MSG_CHECKING([for MAP_ANONYMOUS]) AC_EGREP_CPP([I cannot identify this map], [ #include #ifdef MAP_ANONYMOUS I cannot identify this map #endif ], [gl_have_mmap_anonymous=yes]) if test $gl_have_mmap_anonymous != yes; then AC_EGREP_CPP([I cannot identify this map], [ #include #ifdef MAP_ANON I cannot identify this map #endif ], [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.]) gl_have_mmap_anonymous=yes]) fi AC_MSG_RESULT([$gl_have_mmap_anonymous]) if test $gl_have_mmap_anonymous = yes; then AC_DEFINE([HAVE_MAP_ANONYMOUS], [1], [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including config.h and .]) fi fi ]) amanda-3.3.6/config/gnulib/longlong.m40000664000076400007640000001120312357250007021244 0ustar00martineamartinea00000000000000# longlong.m4 serial 17 dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.61, and can be faster # than what's in Autoconf 2.62 through 2.68. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [ac_cv_type_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_long_long_int = yes; then dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug is not important, since dnl nobody cross compiles for this platform as far as we know. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include @%:@ifndef LLONG_MAX @%:@ define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) @%:@ define LLONG_MAX (HALF - 1 + HALF) @%:@endif]], [[long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0;]])], [], [ac_cv_type_long_long_int=no], [:]) fi fi]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type 'long long int'.]) fi ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.61, and can be faster # than what's in Autoconf 2.62 through 2.68. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [ac_cv_type_unsigned_long_long_int=yes if test "x${ac_cv_prog_cc_c99-no}" = xno; then AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [], [ac_cv_type_unsigned_long_long_int=no]) fi]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type 'unsigned long long int'.]) fi ]) # Expands to a C program that can be used to test for simultaneous support # of 'long long' and 'unsigned long long'. We don't want to say that # 'long long' is available if 'unsigned long long' is not, or vice versa, # because too many programs rely on the symmetry between signed and unsigned # integer types (excluding 'bool'). AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ AC_LANG_PROGRAM( [[/* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[/* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull));]]) ]) amanda-3.3.6/config/gnulib/nocrash.m40000664000076400007640000001055512357250007021073 0ustar00martineamartinea00000000000000# nocrash.m4 serial 4 dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini. AC_PREREQ([2.13]) dnl Expands to some code for use in .c programs that will cause the configure dnl test to exit instead of crashing. This is useful to avoid triggering dnl action from a background debugger and to avoid core dumps. dnl Usage: ... dnl ]GL_NOCRASH[ dnl ... dnl int main() { nocrash_init(); ... } AC_DEFUN([GL_NOCRASH],[[ #include #if defined __MACH__ && defined __APPLE__ /* Avoid a crash on Mac OS X. */ #include #include #include #include #include #include /* The exception port on which our thread listens. */ static mach_port_t our_exception_port; /* The main function of the thread listening for exceptions of type EXC_BAD_ACCESS. */ static void * mach_exception_thread (void *arg) { /* Buffer for a message to be received. */ struct { mach_msg_header_t head; mach_msg_body_t msgh_body; char data[1024]; } msg; mach_msg_return_t retval; /* Wait for a message on the exception port. */ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); if (retval != MACH_MSG_SUCCESS) abort (); exit (1); } static void nocrash_init (void) { mach_port_t self = mach_task_self (); /* Allocate a port on which the thread shall listen for exceptions. */ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) == KERN_SUCCESS) { /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ if (mach_port_insert_right (self, our_exception_port, our_exception_port, MACH_MSG_TYPE_MAKE_SEND) == KERN_SUCCESS) { /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting for us. */ exception_mask_t mask = EXC_MASK_BAD_ACCESS; /* Create the thread listening on the exception port. */ pthread_attr_t attr; pthread_t thread; if (pthread_attr_init (&attr) == 0 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { pthread_attr_destroy (&attr); /* Replace the exception port info for these exceptions with our own. Note that we replace the exception port for the entire task, not only for a particular thread. This has the effect that when our exception port gets the message, the thread specific exception port has already been asked, and we don't need to bother about it. See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ task_set_exception_ports (self, mask, our_exception_port, EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); } } } } #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include #include static LONG WINAPI exception_filter (EXCEPTION_POINTERS *ExceptionInfo) { switch (ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_IN_PAGE_ERROR: case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_GUARD_PAGE: case EXCEPTION_PRIV_INSTRUCTION: case EXCEPTION_ILLEGAL_INSTRUCTION: case EXCEPTION_DATATYPE_MISALIGNMENT: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: case EXCEPTION_NONCONTINUABLE_EXCEPTION: exit (1); } return EXCEPTION_CONTINUE_SEARCH; } static void nocrash_init (void) { SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); } #else /* Avoid a crash on POSIX systems. */ #include /* A POSIX signal handler. */ static void exception_handler (int sig) { exit (1); } static void nocrash_init (void) { #ifdef SIGSEGV signal (SIGSEGV, exception_handler); #endif #ifdef SIGBUS signal (SIGBUS, exception_handler); #endif } #endif ]]) amanda-3.3.6/config/gnulib/write.m40000664000076400007640000000175512357250007020572 0ustar00martineamartinea00000000000000# write.m4 serial 5 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WRITE], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then REPLACE_WRITE=1 fi dnl This ifdef is just an optimization, to avoid performing a configure dnl check whose result is not used. It does not make the test of dnl GNULIB_UNISTD_H_SIGPIPE or GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_WRITE=1 fi ]) m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_WRITE=1 fi ]) ]) # Prerequisites of lib/write.c. AC_DEFUN([gl_PREREQ_WRITE], [:]) amanda-3.3.6/config/gnulib/intmax_t.m40000664000076400007640000000416612357250007021262 0ustar00martineamartinea00000000000000# intmax_t.m4 serial 8 dnl Copyright (C) 1997-2004, 2006-2007, 2009-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ([2.53]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ dnl For simplicity, we assume that a header file defines 'intmax_t' if and dnl only if it defines 'uintmax_t'. AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) else AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) fi ]) dnl An alternative would be to explicitly test for 'intmax_t'. AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ]], [[intmax_t x = -1; return !x;]])], [gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) fi ]) amanda-3.3.6/config/gnulib/extensions.m40000664000076400007640000001223712357250007021634 0ustar00martineamartinea00000000000000# serial 13 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git # Autoconf. Perhaps we can remove this once we can assume Autoconf # 2.70 or later everywhere, but since Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. # If autoconf reports a warning # warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS # or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS # the fix is # 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked # but always AC_REQUIREd, # 2) to ensure that for each occurrence of # AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) # or # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # the corresponding gnulib module description has 'extensions' among # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS # invocation occurs in gl_EARLY, not in gl_INIT. # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. # # Remember that #undef in AH_VERBATIM gets replaced with #define by # AC_DEFINE. The goal here is to define all known feature-enabling # macros, then, if reports of conflicts are made, disable macros that # cause problems on some platforms (such as __EXTENSIONS__). AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) if test "$MINIX" = yes; then AC_DEFINE([_POSIX_SOURCE], [1], [Define to 1 if you need to in order for 'stat' and other things to work.]) AC_DEFINE([_POSIX_1_SOURCE], [2], [Define to 2 if the system does not provide POSIX.1 features except with this defined.]) AC_DEFINE([_MINIX], [1], [Define to 1 if on MINIX.]) AC_DEFINE([_NETBSD_SOURCE], [1], [Define to 1 to make NetBSD features available. MINIX 3 needs this.]) fi dnl Use a different key than __EXTENSIONS__, as that name broke existing dnl configure.ac when using autoheader 2.62. AH_VERBATIM([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on OS X. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions if necessary. HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif ]) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ # define __EXTENSIONS__ 1 ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], [ac_cv_should_define__xopen_source], [ac_cv_should_define__xopen_source=no AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #include mbstate_t x;]])], [], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #define _XOPEN_SOURCE 500 #include mbstate_t x;]])], [ac_cv_should_define__xopen_source=yes])])]) test $ac_cv_should_define__xopen_source = yes && AC_DEFINE([_XOPEN_SOURCE], [500]) ])# AC_USE_SYSTEM_EXTENSIONS # gl_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. dnl gnulib does not need it. But if it gets required by third-party macros dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) ]) amanda-3.3.6/config/gnulib/langinfo_h.m40000664000076400007640000000672112357250007021542 0ustar00martineamartinea00000000000000# langinfo_h.m4 serial 7 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LANGINFO_H], [ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) dnl Persuade glibc-2.0.6 to define CODESET. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([langinfo.h]) dnl Determine whether exists. It is missing on mingw and BeOS. HAVE_LANGINFO_CODESET=0 HAVE_LANGINFO_T_FMT_AMPM=0 HAVE_LANGINFO_ERA=0 HAVE_LANGINFO_YESEXPR=0 AC_CHECK_HEADERS_ONCE([langinfo.h]) if test $ac_cv_header_langinfo_h = yes; then HAVE_LANGINFO_H=1 dnl Determine what defines. CODESET and ERA etc. are missing dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. AC_CACHE_CHECK([whether langinfo.h defines CODESET], [gl_cv_header_langinfo_codeset], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include int a = CODESET; ]])], [gl_cv_header_langinfo_codeset=yes], [gl_cv_header_langinfo_codeset=no]) ]) if test $gl_cv_header_langinfo_codeset = yes; then HAVE_LANGINFO_CODESET=1 fi AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], [gl_cv_header_langinfo_t_fmt_ampm], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include int a = T_FMT_AMPM; ]])], [gl_cv_header_langinfo_t_fmt_ampm=yes], [gl_cv_header_langinfo_t_fmt_ampm=no]) ]) if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then HAVE_LANGINFO_T_FMT_AMPM=1 fi AC_CACHE_CHECK([whether langinfo.h defines ERA], [gl_cv_header_langinfo_era], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include int a = ERA; ]])], [gl_cv_header_langinfo_era=yes], [gl_cv_header_langinfo_era=no]) ]) if test $gl_cv_header_langinfo_era = yes; then HAVE_LANGINFO_ERA=1 fi AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], [gl_cv_header_langinfo_yesexpr], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include int a = YESEXPR; ]])], [gl_cv_header_langinfo_yesexpr=yes], [gl_cv_header_langinfo_yesexpr=no]) ]) if test $gl_cv_header_langinfo_yesexpr = yes; then HAVE_LANGINFO_YESEXPR=1 fi else HAVE_LANGINFO_H=0 fi AC_SUBST([HAVE_LANGINFO_H]) AC_SUBST([HAVE_LANGINFO_CODESET]) AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) AC_SUBST([HAVE_LANGINFO_ERA]) AC_SUBST([HAVE_LANGINFO_YESEXPR]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [nl_langinfo]) ]) AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_LANGINFO_H_DEFAULTS], [ GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) ]) amanda-3.3.6/config/gnulib/multiarch.m40000664000076400007640000000367412357250007021432 0ustar00martineamartinea00000000000000# multiarch.m4 serial 7 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Determine whether the compiler is or may be producing universal binaries. # # On Mac OS X 10.5 and later systems, the user can create libraries and # executables that work on multiple system types--known as "fat" or # "universal" binaries--by specifying multiple '-arch' options to the # compiler but only a single '-arch' option to the preprocessor. Like # this: # # ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ # CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ # CPP="gcc -E" CXXCPP="g++ -E" # # Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly. AC_DEFUN_ONCE([gl_MULTIARCH], [ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. gl_cv_c_multiarch=no AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; ]])], [ dnl Check for potential -arch flags. It is not universal unless dnl there are at least two -arch flags with different values. arch= prev= for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do if test -n "$prev"; then case $word in i?86 | x86_64 | ppc | ppc64) if test -z "$arch" || test "$arch" = "$word"; then arch="$word" else gl_cv_c_multiarch=yes fi ;; esac prev= else if test "x$word" = "x-arch"; then prev=arch fi fi done ]) if test $gl_cv_c_multiarch = yes; then APPLE_UNIVERSAL_BUILD=1 else APPLE_UNIVERSAL_BUILD=0 fi AC_SUBST([APPLE_UNIVERSAL_BUILD]) ]) amanda-3.3.6/config/gnulib/ftell.m40000664000076400007640000000100512357250007020532 0ustar00martineamartinea00000000000000# ftell.m4 serial 3 dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FTELL], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_FTELLO]) dnl When ftello needs fixes, ftell needs them too. if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then REPLACE_FTELL=1 fi ]) amanda-3.3.6/config/gnulib/wctype_h.m40000664000076400007640000001543512357250007021262 0ustar00martineamartinea00000000000000# wctype_h.m4 serial 18 dnl A placeholder for ISO C99 , for platforms that lack it. dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. AC_DEFUN([gl_WCTYPE_H], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([iswcntrl]) if test $ac_cv_func_iswcntrl = yes; then HAVE_ISWCNTRL=1 else HAVE_ISWCNTRL=0 fi AC_SUBST([HAVE_ISWCNTRL]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) gl_CHECK_NEXT_HEADERS([wctype.h]) if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then dnl Linux libc5 has an iswprint function that returns 0 for all arguments. dnl The other functions are likely broken in the same way. AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include #include int main () { return iswprint ('x') == 0; } ]])], [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], [gl_cv_func_iswcntrl_works="guessing yes"], [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi HAVE_WCTYPE_H=1 else HAVE_WCTYPE_H=0 fi AC_SUBST([HAVE_WCTYPE_H]) case "$gl_cv_func_iswcntrl_works" in *yes) REPLACE_ISWCNTRL=0 ;; *) REPLACE_ISWCNTRL=1 ;; esac AC_SUBST([REPLACE_ISWCNTRL]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl Redefine all of iswcntrl, ..., iswxdigit in . : fi if test $REPLACE_ISWCNTRL = 1; then REPLACE_TOWLOWER=1 else AC_CHECK_FUNCS([towlower]) if test $ac_cv_func_towlower = yes; then REPLACE_TOWLOWER=0 else AC_CHECK_DECLS([towlower],,, [[/* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include #if HAVE_WCTYPE_H # include #endif ]]) if test $ac_cv_have_decl_towlower = yes; then dnl On Minix 3.1.8, the system's declares towlower() and dnl towupper() although it does not have the functions. Avoid a dnl collision with gnulib's replacement. REPLACE_TOWLOWER=1 else REPLACE_TOWLOWER=0 fi fi fi AC_SUBST([REPLACE_TOWLOWER]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then dnl Redefine towlower, towupper in . : fi dnl We assume that the wctype() and iswctype() functions exist if and only dnl if the type wctype_t is defined in or in if that dnl exists. dnl HP-UX 11.00 declares all these in and lacks . AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include #if HAVE_WCTYPE_H # include #endif wctype_t a; ]], [[]])], [gl_cv_type_wctype_t=yes], [gl_cv_type_wctype_t=no]) ]) if test $gl_cv_type_wctype_t = no; then HAVE_WCTYPE_T=0 fi dnl We assume that the wctrans() and towctrans() functions exist if and only dnl if the type wctrans_t is defined in . AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include #include wctrans_t a; ]], [[]])], [gl_cv_type_wctrans_t=yes], [gl_cv_type_wctrans_t=no]) ]) if test $gl_cv_type_wctrans_t = no; then HAVE_WCTRANS_T=0 fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include # include # include # include #endif #include ]], [wctype iswctype wctrans towctrans ]) ]) AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_WCTYPE_H_DEFAULTS], [ GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) ]) amanda-3.3.6/config/ltversion.m40000664000076400007640000000125612357250007020201 0ustar00martineamartinea00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3293 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4]) m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) amanda-3.3.6/config/ltsugar.m40000664000076400007640000001042412357250007017632 0ustar00martineamartinea00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) amanda-3.3.6/config/ltmain.sh0000775000076400007640000105021512357250007017535 0ustar00martineamartinea00000000000000 # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4 TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 amanda-3.3.6/config/libtool.m40000664000076400007640000104515512357250007017627 0ustar00martineamartinea00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [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 # _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([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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux 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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # 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\ 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,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) _LT_TAGVAR(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_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS amanda-3.3.6/config/amanda/0000775000076400007640000000000012357750426017141 5ustar00martineamartinea00000000000000amanda-3.3.6/config/amanda/rsh-security.m40000664000076400007640000000157412357250007022041 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_RSH_SECURITY # # OVERVIEW # # Handle configuration for RSH security, implementing the --with-rsh-security # option and checking for the relevant programs and options. # AC_DEFUN([AMANDA_RSH_SECURITY], [ RSH_SECURITY=no AC_ARG_WITH(rsh-security, AS_HELP_STRING([--with-rsh-security], [include RSH authentication]), [ case "$withval" in n | no) : ;; y | ye | yes) RSH_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-rsh-security.]) ;; esac ], ) if test "x$RSH_SECURITY" = "xyes"; then AC_DEFINE(RSH_SECURITY,1, [Define if RSH transport should be enabled. ]) fi AM_CONDITIONAL(WANT_RSH_SECURITY, test x"$RSH_SECURITY" = x"yes") AC_SUBST(RSH_SECURITY) ]) amanda-3.3.6/config/amanda/readdir.m40000664000076400007640000000132612357250007021005 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_READDIR # # OVERVIEW # # Check for one of the readdir variants, as well as the dirent headers. # See common-src/util.c and amanda.h for the use of these symbols. # AC_DEFUN([AMANDA_CHECK_READDIR], [ AC_HEADER_DIRENT # include the dirent headers as described in the autoconf documentation. AC_CHECK_DECLS([readdir, readdir_r, readdir64, readdir64_r],,,[ #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif ]) ]) amanda-3.3.6/config/amanda/dumpers.m40000664000076400007640000004001112357250007021044 0ustar00martineamartinea00000000000000# OVERVIEW # # SYNOPSIS # # AMANDA_PROG_GNUTAR # # OVERVIEW # # Search for a GNU 'tar' binary, placing the result in the precious # variable GNUTAR. The discovered binary is tested to ensure it's really # GNU tar. # # Also handle --with-gnutar # AC_DEFUN([AMANDA_PROG_GNUTAR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) # call with AC_ARG_WITH(gnutar, AS_HELP_STRING([--with-gnutar=PROG], [use PROG as GNU 'tar']), [ # check withval case "$withval" in /*) GNUTAR="$withval";; y|ye|yes) :;; n|no) GNUTAR=no ;; *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);; esac # done ] ) if test "x$GNUTAR" = "xno"; then GNUTAR= else OLD_GNUTAR=$GNUTAR for gnutar_name in gtar gnutar tar; do AC_PATH_PROGS(GNUTAR, $gnutar_name, , $LOCSYSPATH) if test -n "$GNUTAR"; then case `"$GNUTAR" --version 2>&1` in *GNU*tar* | *Free*paxutils* ) # OK, it is GNU tar break ;; *) if test -n "$OLD_GNUTAR"; then AMANDA_MSG_WARN([$GNUTAR is not GNU tar, it will be used.]) else # warning.. AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.]) # reset the cache for GNUTAR so AC_PATH_PROGS will search again GNUTAR='' unset ac_cv_path_GNUTAR fi ;; esac fi done fi if test "x$GNUTAR" != "x"; then # define unquoted AC_DEFINE_UNQUOTED(GNUTAR, "$GNUTAR", [Location of the GNU 'tar' binary]) fi AC_ARG_VAR(GNUTAR, [Location of the GNU 'tar' binary]) AC_SUBST(GNUTAR) ]) # SYNOPSIS # # AMANDA_PROG_STAR # # OVERVIEW # # Search for a 'star' binary, placing the result in the precious # variable STAR. The discovered binary is tested to ensure it's really # star. # # Also handle --with-star # AC_DEFUN([AMANDA_PROG_STAR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) # call with AC_ARG_WITH(star, AS_HELP_STRING([--with-star=PROG], [use PROG as 'star']), [ # check withval case "$withval" in /*) STAR="$withval";; y|ye|yes) :;; n|no) STAR=no ;; *) AC_MSG_ERROR([*** You must supply a full pathname to --with-star]);; esac # done ] ) if test "x$STAR" = "xno"; then STAR= else OLD_STAR=$STAR AC_PATH_PROGS(STAR, star, , $LOCSYSPATH) if test -n "$STAR"; then case `"$STAR" --version 2>/dev/null` in *star*) # OK, it is star break ;; *) if test -n "$OLD_STAR"; then AMANDA_MSG_WARN([$STAR is not star, it will be used.]) else # warning.. AMANDA_MSG_WARN([$STAR is not star, so it will not be used.]) # reset the cache for STAR so AC_PATH_PROGS will search again STAR='' unset ac_cv_path_STAR fi ;; esac fi fi if test "x$STAR" != "x"; then # define unquoted AC_DEFINE_UNQUOTED(STAR, "$STAR", [Location of the 'star' binary]) fi AC_ARG_VAR(STAR, [Location of the 'star' binary]) AC_SUBST(STAR) ]) # SYNOPSIS # # AMANDA_PROG_BSDTAR # # OVERVIEW # # Search for a 'bsdtar' or 'tar' binary, placing the result in the precious # variable BSDTAR. The discovered binary is tested to ensure it's really # bsdtar. # # Also handle --with-bsdtar # AC_DEFUN([AMANDA_PROG_BSDTAR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) # call with AC_ARG_WITH(bsdtar, AS_HELP_STRING([--with-bsdtar=PROG], [use PROG as 'bsdtar']), [ # check withval case "$withval" in /*) BSDTAR="$withval";; y|ye|yes) :;; n|no) BSDTAR=no ;; *) AC_MSG_ERROR([*** You must supply a full pathname to --with-bsdtar]);; esac # done ] ) if test "x$BSDTAR" = "xno"; then BSDTAR= else OLD_BSDTAR=$BSDTAR AC_PATH_PROGS(BSDTAR, bsdtar, , $LOCSYSPATH) if test -n "$BSDTAR"; then case `"$BSDTAR" --version 2>/dev/null` in *bsdtar*) # OK, it is bsdtar break ;; *) BSDTAR='' ;; esac fi if test "x$BSDTAR" = "x"; then AC_PATH_PROGS(BSDTAR, tar, , $LOCSYSPATH) if test -n "$BSDTAR"; then case `"$BSDTAR" --version 2>/dev/null` in *bsdtar*) # OK, it is bsdtar break; ;; *) if test -n "$OLD_BSDTAR"; then AMANDA_MSG_WARN([$BSDTAR is not bsdtar, it will be used.]) else # warning.. AMANDA_MSG_WARN([$BSDTAR is not bsdtar, so it will not be used.]) # reset the cache for BSDTAR so AC_PATH_PROGS will search again BSDTAR='' unset ac_cv_path_BSDTAR fi ;; esac fi fi fi if test "x$BSDTAR" != "x"; then # define unquoted AC_DEFINE_UNQUOTED(BSDTAR, "$BSDTAR", [Location of the 'bsdtar' binary]) fi AC_ARG_VAR(BSDTAR, [Location of the 'bsdtar' binary]) AC_SUBST(BSDTAR) ]) # SYNOPSIS # # AMANDA_PROG_SUNTAR # # OVERVIEW # # Use the value given with the option --with-suntar= or the value of the # precious variable SUNTAR to define the location of Sun's version of tar. # Otherwise set the value to /usr/sbin/tar. Value is not checked. # # Also handle --with-suntar # AC_DEFUN([AMANDA_PROG_SUNTAR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) # call with AC_ARG_WITH(suntar, AS_HELP_STRING([--with-suntar=PROG], [use PROG as 'suntar']), [ # check withval case "$withval" in /*) SUNTAR="$withval";; y|ye|yes) :;; n|no) SUNTAR=no ;; *) AC_MSG_ERROR([*** You must supply a full pathname to --with-suntar]);; esac # done ], [ if test "x$SUNTAR" == "x"; then SUNTAR="/usr/sbin/tar" fi ] ) if test "x$SUNTAR" = "xno"; then SUNTAR= fi if test "x$SUNTAR" != "x"; then # define unquoted AC_DEFINE_UNQUOTED(SUNTAR, "$SUNTAR", [Location of the 'suntar' binary]) fi AC_ARG_VAR(SUNTAR, [Location of the 'suntar' binary]) AC_SUBST(SUNTAR) ]) # SYNOPSIS # # AMANDA_PROG_SAMBA_CLIENT # # OVERVIEW # # Search for a samba client (smbclient) binary, placing the result in # the variable SAMBA_CLIENT. The discovered binary is tested to determine an # internally significant version number, stored in SAMBA_VERSION. The version # serves only to differentiate versions of Samba which Amanada must treat # differently, and has no relation to the actual Samba version number. # # Automake conditional 'WANT_SAMBA' is set if a samba client is discovered. # # Also handles --with-smbclient and (deprecated) --with-samba-user # AC_DEFUN([AMANDA_PROG_SAMBA_CLIENT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_ARG_WITH(smbclient, AS_HELP_STRING([--with-smbclient=PROG], [use PROG as 'smbclient']), [ case "$withval" in /*) SAMBA_CLIENT="$withval";; y|ye|yes) :;; n|no) SAMBA_CLIENT=no ;; *) AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);; esac ] ) AC_ARG_WITH(samba-user, AS_HELP_STRING([--with-samba-user], [deprecated; place username in 'amandapass']), [ AC_MSG_ERROR([--with-samba-user is no longer supported; place username in 'amandapass']) ] ) if test "x$SAMBA_CLIENT" != "xno"; then AC_PATH_PROG(SAMBA_CLIENT,smbclient,,$LOCSYSPATH) smbversion=0 if test ! -z "$SAMBA_CLIENT"; then case `"$SAMBA_CLIENT" '\\\\nosuchhost.amanda.org\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1` in *"Unknown host"*) smbversion=1 ;; *"Connection to nosuchhost.amanda.org failed"*) smbversion=2 ;; *) AMANDA_MSG_WARN([$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.]) SAMBA_CLIENT= ;; esac if test -n "$SAMBA_CLIENT"; then AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT", [Define the location of smbclient for backing up Samba PC clients. ]) AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion, [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ]) fi fi fi AM_CONDITIONAL(WANT_SAMBA, test -n "$SAMBA_CLIENT") ]) # SYNOPSIS # # AMANDA_PROG_VDUMP_VRESTORE # # DESCRIPTION # # Search for 'vdump' and 'vrestore', setting and AC_DEFINE-ing VDUMP and # VRESTORE if they are found. # AC_DEFUN([AMANDA_PROG_VDUMP_VRESTORE], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(VDUMP,vdump,,$SYSLOCPATH) AC_PATH_PROG(VRESTORE,vrestore,,$SYSLOCPATH) if test "$VDUMP" -a "$VRESTORE"; then AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ]) AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ]) fi ]) # SYNOPSIS # # AMANDA_PROG_VXDUMP_VXRESTORE # # DESCRIPTION # # Search for 'vxdump' and 'vxrestore', setting and AC_DEFINE-ing VXDUMP # and VXRESTORE if they are found. # # In addition to the standard paths, this macro will search in # /usr/lib/fs/vxfs. # AC_DEFUN([AMANDA_PROG_VXDUMP_VXRESTORE], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(VXDUMP,vxdump,,$SYSLOCPATH:/usr/lib/fs/vxfs) AC_PATH_PROG(VXRESTORE,vxrestore,,$SYSLOCPATH:/usr/lib/fs/vxfs) if test "$VXDUMP" -a "$VXRESTORE"; then AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP", [Define the location of the vxdump program on HPUX and SINIX hosts or on * other hosts where the Veritas filesystem (vxfs) has been installed. ]) AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE", [Define the location of the vxrestore program on HPUX and SINIX hosts or on * other hosts where the Veritas filesystem (vxfs) has been installed. ]) fi ]) # SYNOPSIS # # AMANDA_PROG_XFSDUMP_XFSRESTORE # # DESCRIPTION # # Search for 'xfsdump' and 'xfsrestore', setting and AC_DEFINE-ing XFSDUMP # and XFSRESTORE if they are found. # AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH) AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH) if test "$XFSDUMP" -a "$XFSRESTORE"; then AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP", [Define the location of the xfsdump program on Irix hosts. ]) AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE", [Define the location of the xfsrestore program on Irix hosts. ]) AMANDA_MSG_WARN([[xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h]]) fi ]) # SYNOPSIS # # AMANDA_PROG_DUMP_RESTORE # # DESCRIPTION # # Search for compatible dump and restore binaries. The exact name of # the binaries we search for depends on the target system. If working # binaries are found, DUMP and RESTORE are defined to their full paths. # # DUMP_RETURNS_1 is defined and substituted if the system's 'dump' # returns 1 on success. # # HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates. # # The --with-honor-nodump flag is processed, and the result of the test is # positive, then HAVE_HONOR_NODUMP is defined. # AC_DEFUN([AMANDA_PROG_DUMP_RESTORE], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_REQUIRE([AMANDA_PROG_GREP]) # Set the order of dump programs to look for. Finding the proper file # system dumping program is problematic. Some systems, notably HP-UX # and AIX, have both the backup and dump programs. HP-UX can't use the # the backup program while AIX systems can't use the dump program. So # a variable is set up here to specify the order of dump programs to # search for on the system. DUMP_PROGRAMS="ufsdump dump backup" DUMP_RETURNS_1= AIX_BACKUP= case "$host" in *-dg-*) DUMP_PROGRAMS="dump "$DUMP_PROGRAMS DUMP_RETURNS_1=1 ;; *-ibm-aix*) DUMP_PROGRAMS="backup "$DUMP_PROGRAMS AIX_BACKUP=1 AC_DEFINE(AIX_BACKUP,1, [Is DUMP the AIX program 'backup'?]) ;; *-ultrix*) DUMP_RETURNS_1=1 ;; esac if test -n "$DUMP_RETURNS_1"; then AC_DEFINE(DUMP_RETURNS_1,1, [Define this if this system's dump exits with 1 as a success code. ]) fi AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH) AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH) # newer versions of GNU tar include a program named 'backup' which # does *not* implement the expected 'dump' interface. Detect that here # and pretend we never saw it. if test -n "$DUMP"; then if test "`basename $DUMP`" = "backup"; then backup_gnutar=`$DUMP --version | $GREP "GNU tar"` if test $? -eq 0; then DUMP= fi fi fi if test "$DUMP" -a "$RESTORE"; then AC_DEFINE_UNQUOTED(DUMP,"$DUMP", [Define the location of the ufsdump, backup, or dump program. ]) AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE", [Define the location of the ufsrestore or restore program. ]) # check for an estimate flag if test -x $DUMP; then AC_CACHE_CHECK( [whether $DUMP supports -E or -S for estimates], amanda_cv_dump_estimate, [ case "$DUMP" in *dump) AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1 | $GREP -v Dumping | $GREP -v Date | $GREP -v Label >conftest.d-E 2>&1) cat conftest.d-E >&AS_MESSAGE_LOG_FD() AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1 | $GREP -v Dumping | $GREP -v Date | $GREP -v Label >conftest.d-S 2>&1) cat conftest.d-S >&AS_MESSAGE_LOG_FD() AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 | $GREP -v Dumping | $GREP -v Date | $GREP -v Label >conftest.d 2>&1) cat conftest.d >&AS_MESSAGE_LOG_FD() if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then amanda_cv_dump_estimate=E elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then amanda_cv_dump_estimate=S else amanda_cv_dump_estimate=no fi rm -f conftest.d conftest.d-E conftest.d-S ;; *) amanda_cv_dump_estimate=no ;; esac ]) else AMANDA_MSG_WARN([$DUMP is not executable, cannot run -E/-S test]) amanda_cv_dump_estimate=no fi if test "x$amanda_cv_dump_estimate" != xno; then AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate", [Define to the string that enables dump estimates. ]) fi AC_ARG_WITH(dump-honor-nodump, AS_HELP_STRING([--with-dump-honor-nodump], [if dump supports -h, use it for level0s too]), [ if test -x $DUMP; then AC_CACHE_CHECK( [whether $DUMP supports -h (honor nodump flag)], amanda_cv_honor_nodump, [ case "$DUMP" in *dump) AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1 | $GREP -v Dumping | $GREP -v Date | $GREP -v Label >conftest.d-h 2>&1) cat conftest.d-h >&AS_MESSAGE_LOG_FD() AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 | $GREP -v Dumping | $GREP -v Date | $GREP -v Label >conftest.d 2>&1) cat conftest.d >&AS_MESSAGE_LOG_FD() if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then amanda_cv_honor_nodump=yes else amanda_cv_honor_nodump=no fi rm -f conftest.d conftest.d-h ;; *) amanda_cv_honor_nodump=no ;; esac ]) else AMANDA_MSG_WARN([$DUMP is not executable, cannot run -h test]) amanda_cv_honor_nodump=no fi if test "x$amanda_cv_honor_nodump" = xyes; then AC_DEFINE(HAVE_HONOR_NODUMP,1, [Define this if dump accepts -h for honoring nodump. ]) fi ]) fi AC_SUBST(AIX_BACKUP) AC_SUBST(DUMP_RETURNS_1) ]) # SYNOPSIS # # AMANDA_CHECK_USE_RUNDUMP # # DESCRIPTION # # Decide if the 'rundump' setuid-root wrapper should be used to invoke # dump. If so, USE_RUNDUMP is defined and substituted. # AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [ USE_RUNDUMP=no # some systems require rundump unconditionally case "$host" in *-ultrix*) USE_RUNDUMP=yes ;; *-dg-*) USE_RUNDUMP=yes ;; esac AC_ARG_WITH(rundump, AS_HELP_STRING([--with-rundump], [use rundump, a setuid-root wrapper, to invoke dump]), [ case "$withval" in n | no) USE_RUNDUMP=no ;; y | ye | yes) USE_RUNDUMP=yes ;; *) AC_MSG_ERROR([You must not supply an argument to --with-rundump option.]);; esac ]) if test x"$USE_RUNDUMP" = x"yes"; then USE_RUNDUMP=1 AC_DEFINE(USE_RUNDUMP,1, [Define to invoke rundump (setuid-root) instead of DUMP program directly. ]) else USE_RUNDUMP= fi AC_SUBST(USE_RUNDUMP) ]) amanda-3.3.6/config/amanda/net.m40000664000076400007640000001353012357250007020161 0ustar00martineamartinea00000000000000# OVERVIEW # # Networking-related macros # SYNOPSIS # # AMANDA_WITH_FQDN # # OVERVIEW # # Check for --with-fqdn, and DEFINE USE_FQDN if given. # AC_DEFUN([AMANDA_WITH_FQDN], [ AC_ARG_WITH(fqdn, AS_HELP_STRING([--with-fqdn], [use FQDN's to backup multiple networks]), [ USE_FQDN=$withval ], [ USE_FQDN=no ]) case "$USE_FQDN" in n | no) : ;; y | ye | yes) AC_DEFINE(USE_FQDN,1, [Define for backups being done on a multiple networks and FQDNs are used. ]) ;; *) AC_MSG_ERROR([You must not supply an argument to --with-fqdn option.]) ;; esac ]) # SYNOPSIS # # AMANDA_WITH_REUSEPORTS # # OVERVIEW # # Check for --with-reuseports, and DEFINE USE_REUSEADDR if given. # AC_DEFUN([AMANDA_WITH_REUSEPORTS], [ AC_ARG_WITH(reuseports, AS_HELP_STRING([--without-reuseaddr], [Don't reuse network connections until full timeout period]), [ case "$withval" in y | ye | yes) USE_REUSEADDR=no;; n | no) USE_REUSEADDR=yes;; *) AC_MSG_ERROR([You must not supply an argument to --without-reuseports]);; esac ], [ USE_REUSEADDR=yes; ]) if test x"$USE_REUSEADDR" = x"yes"; then AC_DEFINE(USE_REUSEADDR,1, [Define to set SO_REUSEADDR on network connections.]) fi ]) # SYNOPSIS # # AMANDA_WITH_PORTRANGES # # OVERVIEW # # Implement --with-low-tcpportrange, --with-tcpportrange, and --with-udpportrange. # Results are DEFINED and substituted in LOW_TCPPORTRANGE, TCPPORTRANGE, and # UDPPORTRANGE, respectively. # AC_DEFUN([AMANDA_WITH_PORTRANGES], [ AC_ARG_WITH(low-tcpportrange, [ --with-low-tcpportrange=low,high bind reserved TCP server sockets to ports within], [ LOW_TCPPORTRANGE="$withval" ], [ LOW_TCPPORTRANGE=unlimited ]) if test x"$LOW_TCPPORTRANGE" != x"unlimited"; then if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then AC_MSG_ERROR([--with-low-tcpportrange requires two comma-separated positive numbers]) fi min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'` max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'` if test $min_low_tcp_port -gt $max_low_tcp_port; then AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-low-tcpportrange]) fi if test $min_low_tcp_port -lt 512; then AMANDA_MSG_WARN([the low TCP port range should be 512 or greater in --with-low-tcpportrange]) fi if test $max_low_tcp_port -ge 1024; then AMANDA_MSG_WARN([the low TCP port range should be less than 1024 in --with-low-tcpportrange]) fi AC_DEFINE_UNQUOTED(LOW_TCPPORTRANGE,$LOW_TCPPORTRANGE, [A comma-separated list of two integers, determining the minimum and maximum * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) ]) fi dnl note that AS_HELP_STRING cannot handle commas in its argument.. AC_ARG_WITH(tcpportrange, [ --with-tcpportrange=low,high bind unreserved TCP server sockets to ports within], [ TCPPORTRANGE="$withval" ], [ TCPPORTRANGE="unlimited" ]) if test x"$TCPPORTRANGE" != x"unlimited"; then if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then AC_MSG_ERROR([--with-tcpportrange requires two comma-separated positive numbers]) fi min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'` max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'` if test $min_tcp_port -gt $max_tcp_port; then AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-tcpportrange]) fi if test $min_tcp_port -lt 1024; then AMANDA_MSG_WARN([the TCP port range should be 1024 or greater in --with-tcpportrange]) fi if test $max_tcp_port -ge 65536; then AMANDA_MSG_WARN([the TCP port range should be less than 65536 in --with-tcpportrange]) fi AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE, [A comma-separated list of two integers, determining the minimum and * maximum unreserved TCP port numbers sockets should be bound to. ]) fi AC_ARG_WITH(udpportrange, [ --with-udpportrange=low,high bind reserved UDP server sockets to ports within], [ UDPPORTRANGE="$withval" ], [ UDPPORTRANGE="unlimited" ]) if test x"$UDPPORTRANGE" != x"unlimited"; then if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then AC_MSG_ERROR([--with-udpportrange requires two comma-separated positive numbers]) fi min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'` max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'` if test $min_udp_port -gt $max_udp_port; then AC_MSG_ERROR([the second UDP port number must be greater than the first in --with-udpportrange]) fi if test $max_udp_port -ge 1024; then AMANDA_MSG_WARN([the UDP port range should be less than 1025 in --with-udpportrange]) fi if test $min_udp_port -le 0; then AMANDA_MSG_WARN([the UDP port range should be greater than 0 in --with-udpportrange]) fi AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE, [A comma-separated list of two integers, determining the minimum and * maximum reserved UDP port numbers sockets should be bound to. ]) fi AC_SUBST(UDPPORTRANGE) AC_SUBST(TCPPORTRANGE) AC_SUBST(LOW_TCPPORTRANGE) ]) # SYNOPSIS # # AMANDA_WITH_BUFFERED_DUMP # # OVERVIEW # # Implement --with-buffered-dump, and DEFINEs DUMPER_SOCKET_BUFFERING if the option # is given. # AC_DEFUN([AMANDA_WITH_BUFFERED_DUMP], [ AC_ARG_WITH(buffered-dump, AS_HELP_STRING([--with-buffered-dump], [buffer the dumping sockets on the server for speed]), [ DUMPER_SOCKET_BUFFERING=$withval ], [ DUMPER_SOCKET_BUFFERING=no ]) case "$DUMPER_SOCKET_BUFFERING" in n | no) ;; y | ye | yes) AC_DEFINE(DUMPER_SOCKET_BUFFERING,1, [Define if dumper should buffer the sockets for faster throughput. ]) ;; *) AC_MSG_ERROR([You must not supply an argument to --with-buffered-dump.]) ;; esac ]) amanda-3.3.6/config/amanda/lfs.m40000664000076400007640000000430712357250007020161 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SETUP_LFS # # OVERVIEW # # Set up for large file suport on this system. Besides adding compiler flags, # defines NEED_RESETOFS if the tape device's offset must be reset before it reaches # 2GB (a Linux kernel bug in systems without LFS support). # AC_DEFUN([AMANDA_SETUP_LFS], [ AC_REQUIRE([AMANDA_PROG_GETCONF]) AC_REQUIRE([AC_SYS_LARGEFILE]) # we use 'getconf', if it exists, to get the relevant # compiler flags. GETCONF_LFS="LFS" case "$host" in *-hp-*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;; *-ibm-aix*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;; esac # Checks for compilers, typedefs, structures, and compiler characteristics. # Check for large file compilation environment. NEED_RESETOFS=yes AC_CACHE_CHECK([for large file compilation CFLAGS], amanda_cv_LFS_CFLAGS, [ amanda_cv_LFS_CFLAGS= if test "$GETCONF"; then if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null` NEED_RESETOFS=no fi fi ] ) AMANDA_ADD_CFLAGS([$amanda_cv_LFS_CFLAGS]) AC_CACHE_CHECK( [for large file compilation LDFLAGS], amanda_cv_LFS_LDFLAGS, [ amanda_cv_LFS_LDFLAGS= if test "$GETCONF"; then if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null` NEED_RESETOFS=no fi fi ] ) AMANDA_ADD_LDFLAGS([$amanda_cv_LFS_LDFLAGS]) AC_CACHE_CHECK( [for large file compilation LIBS], amanda_cv_LFS_LIBS, [ amanda_cv_LFS_LIBS= if test "$GETCONF"; then if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null` NEED_RESETOFS=no fi fi ] ) AMANDA_ADD_LIBS([$amanda_cv_LFS_LIBS]) if test x"$NEED_RESETOFS" = x"yes"; then AC_DEFINE(NEED_RESETOFS,1, [Define if we have to reset tape offsets when reaching 2GB. ]) fi ]) amanda-3.3.6/config/amanda/bsd-security.m40000664000076400007640000000373312357250007022014 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_BSD_SECURITY # # OVERVIEW # # Handle configuration for BSD security, implementing the # --without-bsd-security option. Also supplies the --without-amandahosts # option to use .rhosts instead of .amandahosts # # Note that the defaults for *both* of these options are "yes", unlike # the remainder of the security implementations. # # Defines and substitues BSD_SECURITY, and sets AM_CONDITIONAL # WANT_BSD_SECURITY, if the user has selected this mechanism. # Also defines and substitutes USE_AMANDAHOSTS unless the user has # specified --without-amandahosts. # AC_DEFUN([AMANDA_BSD_SECURITY], [ BSD_SECURITY="yes" AC_ARG_WITH(bsd-security, AS_HELP_STRING([--without-bsd-security], [do not include BSD authentication]), [ case "$withval" in n | no) BSD_SECURITY=no ;; y | ye | yes) BSD_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.]) ;; esac ], ) USE_AMANDAHOSTS=yes AC_ARG_WITH(amandahosts, AS_HELP_STRING([ --without-amandahosts], [use ".rhosts" instead of ".amandahosts"]), [ case "$withval" in n | no ) USE_AMANDAHOSTS=no ;; y | ye | yes) USE_AMANDAHOSTS=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.]) ;; esac ] ) if test "x$BSD_SECURITY" = "xyes"; then AC_DEFINE(BSD_SECURITY,1, [Define to use BSD .rhosts/.amandahosts security. ]) if test "x$USE_AMANDAHOSTS" = "xyes"; then AC_DEFINE(USE_AMANDAHOSTS,1, [Define if you want to use the ".amandahosts" for BSD security. ]) fi fi AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes") AC_SUBST(BSD_SECURITY) AC_SUBST(USE_AMANDAHOSTS) ]) amanda-3.3.6/config/amanda/swig.m40000664000076400007640000000720512357250007020346 0ustar00martineamartinea00000000000000# OVERVIEW # # Set up for building SWIG bindings. Note that shipped tarballs contain pre-built # SWIG bindings, so there should be no need for SWIG on non-developer machines. # SYNOPSIS # # Find perl and SWIG, and substitute PERL_INC, the -I command that will lead the compiler # to perl.h and friends. # # Supports --with-perlextlibs, for adding extra LIBS declarations to perl extensions. # AC_DEFUN([AMANDA_SETUP_SWIG], [ AC_REQUIRE([AMANDA_PROG_SWIG]) AC_REQUIRE([AMANDA_PROG_PERL]) WANT_CYGWIN_COPY_PERL_DLL=false WANT_MANDATORY_THREAD_CHECK=false # test for ExtUtils::Embed AC_PERL_MODULE_VERSION([ExtUtils::Embed 0.0], [], [ AC_MSG_ERROR([*** Amanda requires the perl package ExtUtils::Embed to build its perl modules]) ]) # get the include path for building perl extensions PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc` AC_SUBST(PERL_INC) if test x"$enable_shared" = x"no"; then AC_MSG_ERROR([*** Amanda cannot be compiled without shared-library support (do not use --disable-shared)]) fi case "$host" in *freebsd@<:@123456@:>@.*) # up to and including FreeBSD 6.* # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in # libgthread to automatically pull in the desired threading library. # Instead, they assume that any application linking against # libgthread will pull in the threading library. This is fine for # Amanda C applications, but for Perl applications this assumption # means that the perl binary would pull in the threading library. # But perl is compiled without threading by default. # # Specifically, this occurs on any FreeBSD using gcc-3.*: the linking # decision is made in gcc's spec files, which were changed in # gcc-4.0. For a more in-depth discussion, see # http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_FreeBSD # # The easiest solution for the "default" case is to link all perl # extension libraries against the threading library, so it is loaded # when perl loads the extension library. The default threading # library in FreeBSD is libpthread. The below default will work on # such a FreeBSD system, but ports maintainers and those with # different configurations may need to override this value with # --with-perlextlibs. # # We can't use -pthread because gcc on FreeBSD ignores -pthread in # combination with -shared. See # http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html PERLEXTLIBS="-lpthread" WANT_MANDATORY_THREAD_CHECK=true ;; *freebsd*) # all FreeBSD not matched above # for all FreeBSD (including 1.0-6.0, above), we want to run the # thread-check rule in perl/Makefile.am to double-check that a Perl # script can call a C extension that uses threads. WANT_MANDATORY_THREAD_CHECK=true ;; *-pc-cygwin) # When need -lperl and the '-L' where it is located, # we don't want the DynaLoader.a PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'` # we want cygwin to copy ddl to modules directory. WANT_CYGWIN_COPY_PERL_DLL="true"; ;; esac AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL,$WANT_CYGWIN_COPY_PERL_DLL) AM_CONDITIONAL(WANT_MANDATORY_THREAD_CHECK,$WANT_MANDATORY_THREAD_CHECK) AC_ARG_WITH(perlextlibs, AC_HELP_STRING([--with-perlextlibs=libs],[extra LIBS for Perl extensions]), [ case "$withval" in y|ye|yes) AC_MSG_ERROR([*** You must specify a value for --with-perlextlibs]);; n|no) PERLEXTLIBS='';; *) PERLEXTLIBS="$withval" ;; esac ]) AC_SUBST(PERLEXTLIBS) ]) amanda-3.3.6/config/amanda/dirs.m40000664000076400007640000001752212357250007020341 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_WITH_APPLICATIONDIR # # OVERVIEW # # Define and substitute APPLICATION_DIR with the result. # AC_DEFUN([AMANDA_WITH_APPLICATIONDIR], [ AC_ARG_WITH(dumperdir, AS_HELP_STRING([--with-dumperdir=DIR], [where we install the dumpers (deprecated)]), [ AMANDA_MSG_WARN([--with-dumperdir is no longer used.]) ] ) ]) # SYNOPSIS # # AMANDA_WITH_CONFIGDIR # # OVERVIEW # # Allow user to specify the dumperdir, defaulting to ${exec_prefix}/dumper. # Define and substitute APPLICATION_DIR with the result. # AC_DEFUN([AMANDA_WITH_CONFIGDIR], [ AC_ARG_WITH(configdir, AS_HELP_STRING([--with-configdir=DIR], [runtime config files in DIR @<:@sysconfdir/amanda@:>@]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-configdir option.]) ;; *) CONFIG_DIR="$withval" ;; esac ], [ : ${CONFIG_DIR='${sysconfdir}/amanda'} # (variable will be evaluated below) ] ) AC_DEFINE_DIR([CONFIG_DIR], [CONFIG_DIR], [The directory in which configuration directories should be created. ]) ]) ## deprecated --with-*dir options AC_DEFUN([AMANDA_WITH_INDEXDIR], [ AC_ARG_WITH(indexdir, AS_HELP_STRING([--with-indexdir], [deprecated: use indexdir in amanda.conf]), [ AC_MSG_ERROR([*** --with-indexdir is deprecated; use indexdir in amanda.conf instead.]) ],) ]) AC_DEFUN([AMANDA_WITH_DBDIR], [ AC_ARG_WITH(dbdir, AS_HELP_STRING([--with-dbdir], [deprecated: use infofile in amanda.conf]), [ AC_MSG_ERROR([*** --with-dbdir is deprecated; use infofile in amanda.conf instead.]) ],) ]) AC_DEFUN([AMANDA_WITH_LOGDIR], [ AC_ARG_WITH(logdir, AS_HELP_STRING([--with-logdir], [deprecated: use logfile in amanda.conf]), [ AC_MSG_ERROR([*** --with-logdir is deprecated; use logfile in amanda.conf instead.]) ],) ]) # SYNOPSIS # # AMANDA_WITH_GNUTAR_LISTDIR # # OVERVIEW # # Implements --with-gnutar-listdir. Defines GNUTAR_LISTED_INCREMENTAL_DIR to the # value given or $localstatedir/amanda/gnutar-lists by default. Any $xxxdir variables # are fully evaluated in the value. # AC_DEFUN([AMANDA_WITH_GNUTAR_LISTDIR], [ AC_ARG_WITH(gnutar-listdir, AS_HELP_STRING([--with-gnutar-listdir=DIR], [put gnutar directory lists in DIR (default: localstatedir/amanda/gnutar-lists)]), [ case "$withval" in n | no) GNUTAR_LISTDIR= ;; y | ye | yes) GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' ;; *) GNUTAR_LISTDIR="$withval" ;; esac ], [ GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' ] ) # substitute $prefix, etc. if necessary AC_DEFINE_DIR([GNUTAR_LISTED_INCREMENTAL_DIR], [GNUTAR_LISTDIR], [The directory in which GNU tar should store directory lists for incrementals. ]) # handle deprecated option AC_ARG_WITH(gnutar-listed-incremental, AS_HELP_STRING([--with-gnutar-listed-incremental], [deprecated; use --with-gnutar-listdir]), [ AC_MSG_ERROR([*** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead]) ] ) ]) # SYNOPSIS # # AMANDA_WITH_TMPDIR # # OVERVIEW # # Implement --with-tmpdir. Defines and substitutes AMANDA_TMPDIR. # AC_DEFUN([AMANDA_WITH_TMPDIR], [ AC_ARG_WITH(tmpdir, AS_HELP_STRING([--with-tmpdir], [directory for temporary and debugging files (default: /tmp/amanda)]), [ tmpdir="$withval" ], [ tmpdir=yes ] ) case "$tmpdir" in n | no) AC_MSG_ERROR([*** --without-tmpdir is not allowed.]);; y | ye | yes) AMANDA_TMPDIR="/tmp/amanda";; *) AMANDA_TMPDIR="$tmpdir";; esac AC_DEFINE_DIR([AMANDA_TMPDIR], [AMANDA_TMPDIR], [The directory in which Amanda should create temporary files. ]) ]) # SYNOPSIS # # AMANDA_EXPAND_DIRS # # OVERVIEW # # Expand any variable references in the following variables, then define them: # - bindir # - sbindir # - libexecdir # - mandir # # Also defines the following directories and expands any variable references: # - amdatadir = --with-amdatadir or ${datadir}/amanda # - amlibdir = --with-amlibdir or ${libdir}/amanda # - amlibexecdir = --with-amlibexecdir or ${libexecdir}/amanda # - amincludedir = ${includedir}/amanda # - amperldir = --with-amperldir or `perl -V:installsitearch` # - APPLICATION_DIR = ${amlibexecdir}/application # AC_DEFUN([AMANDA_EXPAND_DIRS], [ AC_REQUIRE([AMANDA_PROG_PERL]) AC_DEFINE_DIR([bindir], [bindir], [Directory in which user binaries should be installed. ]) AC_DEFINE_DIR([sbindir], [sbindir], [Directory in which administrator binaries should be installed. ]) AC_DEFINE_DIR([libexecdir], [libexecdir], [Directory in which internal binaries should be installed. ]) AC_DEFINE_DIR([mandir], [mandir], [Directory in which man-pages should be installed]) # amanda-specific directories AMLIBDIR=$libdir/amanda AC_ARG_WITH(amlibdir, AS_HELP_STRING([--with-amlibdir[[[[[=PATH]]]]]], [Where library are installed, default: $libdir/amanda]) AS_HELP_STRING([--without-amlibdir], [Library are installed in $libdir]), [ case "$withval" in n | no) AMLIBDIR=$libdir ;; y | ye | yes) AMLIBDIR=$libdir/amanda ;; *) AMLIBDIR=$withval ;; esac ] ) AC_DEFINE_DIR([amlibdir], [AMLIBDIR], [Directory in which Amanda libraries should be installed]) AMLIBEXECDIR=$libexecdir/amanda AC_ARG_WITH(amlibexecdir, AS_HELP_STRING([--with-amlibexecdir[[[[[=PATH]]]]]], [Where amanda own programs are installed, default: $libexecdir/amanda]) AS_HELP_STRING([--without-amlibexecdir], [Amanda own programs are installed in $libexecdir]), [ case "$withval" in n | no) AMLIBEXECDIR=$libexecdir ;; y | ye | yes) AMLIBEXECDIR=$libexecdir/amanda ;; *) AMLIBEXECDIR=$withval ;; esac ] ) AC_DEFINE_DIR([amlibexecdir], [AMLIBEXECDIR], [Directory in which Amanda own programs should be installed]) amincludedir="${includedir}/amanda" AC_DEFINE_DIR([amincludedir], [amincludedir], [Directory in which Amanda header files should be installed]) AC_ARG_WITH(amperldir, AS_HELP_STRING([--with-amperldir[[[[[=PATH]]]]]], [Where amanda's perl modules are installed; default: installsitelib]) AS_HELP_STRING([--without-amperldir], [Install amanda's perl modules in $amlibdir/perl]), [ case "$withval" in y | ye | yes) AMPERLLIB=DEFAULT ;; n | no) AMPERLLIB=$amlibdir/perl ;; *) AMPERLLIB=$withval ;; esac ], [ AMPERLLIB=DEFAULT ] ) # apply the default if no value was given. if test x"$AMPERLLIB" = x"DEFAULT"; then eval `$PERL -V:installsitelib` AMPERLLIB=$installsitelib fi AC_DEFINE_DIR([amperldir], [AMPERLLIB], [Directory in which perl modules should be installed]) APPLICATION_DIR='${amlibexecdir}/application' AC_DEFINE_DIR([APPLICATION_DIR],[APPLICATION_DIR], [Directory in which dumper interfaces should be installed and searched. ]) AC_ARG_WITH(amdatadir, AS_HELP_STRING([--with-amdatadir[[[[[=PATH]]]]]], [Where amanda's templates and examples are installed; default: $datadir/amanda]), [ AMDATADIR=$withval ], [ AMDATADIR=$datadir/amanda ] ) AC_DEFINE_DIR([amdatadir], [AMDATADIR], [Directory in which amanda's templates and examples are installed. ]) ]) # SYNOPSIS # # AMANDA_SHOW_DIRS_SUMMARY # # OVERVIEW # # Show a summary of the settings from this file. # AC_DEFUN([AMANDA_SHOW_DIRS_SUMMARY], [ echo "Directories:" echo " Application: $APPLICATION_DIR" echo " Configuration: $CONFIG_DIR" echo " GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR" echo " Perl modules (amperldir): $amperldir" echo " Template and example data files (amdatadir): $amdatadir" echo " Temporary: $AMANDA_TMPDIR" ]) amanda-3.3.6/config/amanda/devprefix.m40000664000076400007640000000547712357250007021402 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_DEVICE_PREFIXES # # DESCRIPTION # # Check for the prefixes used for particular devices. # # Defines DEV_PREFIX and RDEV_PREFIX to the appropriate prefixes. # AC_DEFUN([AMANDA_CHECK_DEVICE_PREFIXES], [ # disk device prefixes AC_MSG_CHECKING(disk device prefixes) # Use df to find the mount point for the root filesystem. Use # the positional parameters to find the particular line from df # that contains the root paritition. We put it in a subshell so # that the original positional parameters are not messed with. dfline=`( df / | while read line; do set -- $line dnl @S|@ means $ to m4 while test @S|@# -gt 0; do if test "x@S|@1" = "x/"; then echo $line break 2 fi shift done done ) | sed 's/(//' | sed 's/)//' ` # Search for the mount point by using expr to find the parameter # with dev in it. mount=`( set -- $dfline dnl @S|@ means $ to m4 while test @S|@# -gt 0; do if expr "@S|@1" : '.*dev' >/dev/null 2>&1; then echo @S|@1 break fi shift done )` # get any system-specific configuration information case "$host" in *-hp-*) CLIENT_SCRIPTS_OPT=amhpfixdevs case $mount in /dev/vg*) AMANDA_MSG_WARN([Run amhpfixdevs on HP-UX systems using /dev/vg??.]) ;; esac ;; *-sni-sysv4) DEV_PREFIX=/dev/dsk/ RDEV_PREFIX=/dev/rdsk/ CLIENT_SCRIPTS_OPT=amsinixfixdevs if ! test -d /dev/dsk; then AMANDA_MSG_WARN([Run amsinixfixdevs on Sinix systems using VxFS.]) fi ;; *-sco3.2v4*) DEV_PREFIX=/dev/ RDEV_PREFIX=/dev/ ;; *) CLIENT_SCRIPTS_OPT= ;; esac if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then AC_MSG_RESULT((predefined) $DEV_PREFIX - $RDEV_PREFIX) else if test -d /dev/dsk; then DEV_PREFIX=/dev/dsk/ if test -d /dev/rdsk; then RDEV_PREFIX=/dev/rdsk/ else RDEV_PREFIX=/dev/dsk/ fi elif test -d /dev; then DEV_PREFIX=/dev/ # Some systems, notably Linux, do not have raw disk devices # names. Check this by trying to see if a raw disk device name # exists using the normal raw device path prepended to the # mount point of the root filesystem. if test "$mount"; then dev_name="/dev/r`basename $mount`" if test -b $dev_name -o -c $dev_name; then RDEV_PREFIX=/dev/r else RDEV_PREFIX=/dev/ fi else RDEV_PREFIX=/dev/r fi else # just fake it.. DEV_PREFIX=/ RDEV_PREFIX=/ fi AC_MSG_RESULT($DEV_PREFIX - $RDEV_PREFIX) fi AC_DEFINE_UNQUOTED(DEV_PREFIX,"${DEV_PREFIX}", [Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ ]) AC_DEFINE_UNQUOTED(RDEV_PREFIX,"${RDEV_PREFIX}", [Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ ]) AC_SUBST(CLIENT_SCRIPTS_OPT) ]) amanda-3.3.6/config/amanda/compress.m40000664000076400007640000000455212357250007021232 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_COMPRESSION # # OVERVIEW # # Find a suitable compression program and substitute and define the following: # # - COMPRESS_PATH # - COMPRESS_SUFFIX # - COMPRESS_FAST_OPT # - COMPRESS_BEST_OPT # - UNCOMPRESS_PATH # - UNCOMPRESS_OPT # - HAVE_GZIP # AC_DEFUN([AMANDA_CHECK_COMPRESSION], [ AC_REQUIRE([AMANDA_PROG_CAT]) AC_REQUIRE([AMANDA_PROG_COMPRESS]) AC_REQUIRE([AMANDA_PROG_GZIP]) HAVE_GZIP= if test "$GZIP"; then AC_DEFINE(HAVE_GZIP,1, [Define if Amanda is using the gzip program. ]) HAVE_GZIP=1 COMPRESS_PATH="$GZIP" COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast" COMPRESS_BEST_OPT="--best" UNCOMPRESS_PATH="$GZIP" UNCOMPRESS_OPT="-dc" else if test "$COMPRESS"; then COMPRESS_PATH="$COMPRESS" COMPRESS_SUFFIX=".Z" COMPRESS_FAST_OPT="-f" COMPRESS_BEST_OPT="-f" UNCOMPRESS_PATH="$COMPRESS" UNCOMPRESS_OPT="-dc" else # If we have to use cat, we don't define COMPRESS_FAST_OPT, # COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look # look for a file by the name of "". # XXX is the above true? --dustin AMANDA_MSG_WARN([Cannot find either gzip or compress. Using cat.]) COMPRESS_PATH="$CAT" COMPRESS_SUFFIX="" COMPRESS_FAST_OPT="" COMPRESS_BEST_OPT="" UNCOMPRESS_PATH="$CAT" UNCOMPRESS_OPT="" fi fi AC_DEFINE_UNQUOTED(COMPRESS_PATH,"$COMPRESS_PATH", [Define to the exact path to the gzip or the compress program. ]) AC_DEFINE_UNQUOTED(COMPRESS_SUFFIX,"$COMPRESS_SUFFIX", [Define to the suffix for the COMPRESS_PATH compression program. ]) AC_DEFINE_UNQUOTED(COMPRESS_FAST_OPT,"$COMPRESS_FAST_OPT", [Define as the command line option for fast compression. ]) AC_DEFINE_UNQUOTED(COMPRESS_BEST_OPT,"$COMPRESS_BEST_OPT", [Define as the command line option for best compression. ]) AC_DEFINE_UNQUOTED(UNCOMPRESS_PATH,"$UNCOMPRESS_PATH", [Define as the exact path to the gzip or compress command. ]) AC_DEFINE_UNQUOTED(UNCOMPRESS_OPT,"$UNCOMPRESS_OPT", [Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. ]) AC_SUBST(COMPRESS_PATH) AC_SUBST(COMPRESS_SUFFIX) AC_SUBST(COMPRESS_FAST_OPT) AC_SUBST(COMPRESS_BEST_OPT) AC_SUBST(UNCOMPRESS_PATH) AC_SUBST(UNCOMPRESS_OPT) AC_SUBST(HAVE_GZIP) # Empty GZIP so that make dist works. GZIP= ]) amanda-3.3.6/config/amanda/bsdtcp-security.m40000664000076400007640000000202312357250007022512 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_BSDTCP_SECURITY # # OVERVIEW # # Handle configuration for BSDTCP security, implementing the # --with-bsdtcp-security option. # # Defines and substitutes BSDTCP_SECURITY, and sets AM_CONDITIONAL # WANT_BSDTCP_SECURITY, if the user has selected this mechanism. # AC_DEFUN([AMANDA_BSDTCP_SECURITY], [ BSDTCP_SECURITY="yes" AC_ARG_WITH(bsdtcp-security, AS_HELP_STRING([--with-bsdtcp-security], [include BSDTCP authentication]), [ case "$withval" in n | no) BSDTCP_SECURITY=no ;; y | ye | yes) BSDTCP_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsdtcp-security.]) ;; esac ], ) if test "x$BSDTCP_SECURITY" = "xyes"; then AC_DEFINE(BSDTCP_SECURITY,1, [Define if BSDTCP transport should be enabled.]) fi AM_CONDITIONAL(WANT_BSDTCP_SECURITY, test x"$BSDTCP_SECURITY" = x"yes") AC_SUBST(BSDTCP_SECURITY) ]) amanda-3.3.6/config/amanda/as_needed.m40000664000076400007640000000130412357250007021276 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_AS_NEEDED # # OVERVIEW # Add --as-needed ld flag to LD_FLAGS except when using readline. On # some platforms, readline does not correctly advertise it's requirements, # causing ld errors. In Amanda, readline is used by amrecover/amoldrecover. # AC_DEFUN([AMANDA_AS_NEEDED], [ AC_ARG_ENABLE([as-needed], AS_HELP_STRING([--enable-as-needed], [enable use od --as-needed linker flag]), [ WANT_AS_NEEDED=$enableval ], [ WANT_AS_NEEDED=no ]) AM_CONDITIONAL([WANT_AS_NEEDED], [test x"$WANT_AS_NEEDED" = x"yes"]) if test x"$WANT_AS_NEEDED" = x"yes"; then AS_NEEDED_FLAGS="-Wl,--as-needed" else AS_NEEDED_FLAGS="" fi AC_SUBST(AS_NEEDED_FLAGS) ]) amanda-3.3.6/config/amanda/components.m40000664000076400007640000001305112357250007021556 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_COMPONENTS # # OVERVIEW # # Defines --without-client, --without-server, --without-restore, and # --without-amrecover, and checks the results. # # Sets the AM_CONDITIONALs WANT_CLIENT, WANT_SERVER, WANT_RESTORE, # and WANT_RECOVER. # # AM_CONDITIONAL WANT_TAPE is set if either server or restore support is # being built. # AC_DEFUN([AMANDA_CHECK_COMPONENTS], [ AC_REQUIRE([AMANDA_WITHOUT_SERVER]) AC_REQUIRE([AMANDA_WITHOUT_CLIENT]) AC_REQUIRE([AMANDA_WITHOUT_RESTORE]) AC_REQUIRE([AMANDA_WITHOUT_AMRECOVER]) AC_REQUIRE([AMANDA_WITH_CLIENT_ONLY]) dnl deprecated AC_REQUIRE([AMANDA_WITH_SERVER_ONLY]) dnl deprecated AC_REQUIRE([AMANDA_WITHOUT_NDMP]) # detect invalid combinations of components if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then AC_MSG_ERROR([--without-server requires --without-restore]) fi if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then AC_MSG_ERROR([--without-client requires --without-amrecover]) fi AM_CONDITIONAL(WANT_CLIENT, $WANT_CLIENT) AM_CONDITIONAL(WANT_RESTORE, $WANT_RESTORE) AM_CONDITIONAL(WANT_SERVER, $WANT_SERVER) AM_CONDITIONAL(WANT_RECOVER, $WANT_RECOVER) AM_CONDITIONAL(WANT_NDMP, $WANT_NDMP) AM_CONDITIONAL(WANT_TAPE, $WANT_SERVER || $WANT_RESTORE) # AMANDA_COMPONENTS goes to Amanda::Constants; missing_components is just for the # summary, below AMANDA_COMPONENTS='' missing_components='' if $WANT_SERVER; then AMANDA_COMPONENTS="$AMANDA_COMPONENTS server"; else missing_components="$missing_components (no server)"; fi if $WANT_RESTORE; then AMANDA_COMPONENTS="$AMANDA_COMPONENTS restore"; else missing_components="$missing_components (no restore)"; fi if $WANT_CLIENT; then AMANDA_COMPONENTS="$AMANDA_COMPONENTS client"; else missing_components="$missing_components (no client)"; fi if $WANT_RECOVER; then AMANDA_COMPONENTS="$AMANDA_COMPONENTS amrecover"; else missing_components="$missing_components (no amrecover)"; fi if $WANT_NDMP; then AMANDA_COMPONENTS="$AMANDA_COMPONENTS ndmp"; else missing_components="$missing_components (no ndmp)"; fi AC_SUBST(AMANDA_COMPONENTS) ]) # SYNOPSIS # # AMANDA_WITHOUT_SERVER # # OVERVIEW # # Add option --without-server, and set WANT_SERVER to true or false, # accordingly. # AC_DEFUN([AMANDA_WITHOUT_SERVER], [ WANT_SERVER=true AC_ARG_WITH(server, AS_HELP_STRING([--without-server], [do not build server stuff (set --without-restore)]), [ case "$withval" in y | ye | yes) WANT_SERVER=true;; n | no) WANT_SERVER=false;; *) AC_MSG_ERROR([You must not supply an argument to the --without-server option.]) ;; esac ]) ]) # SYNOPSIS # # AMANDA_WITHOUT_CLIENT # # OVERVIEW # # Add option --without-client, and set WANT_CLIENT to true or false, # accordingly. # AC_DEFUN([AMANDA_WITHOUT_CLIENT], [ WANT_CLIENT=true AC_ARG_WITH(client, AS_HELP_STRING([--without-client], [do not build client stuff]), [ case "$withval" in y | ye | yes) WANT_CLIENT=true;; n | no) WANT_CLIENT=false;; *) AC_MSG_ERROR([You must not supply an argument to the --without-client option.]) ;; esac ]) ]) # SYNOPSIS # # AMANDA_WITHOUT_RESTORE # # OVERVIEW # # Add option --without-restore, and set WANT_RESTORE to true or false, # accordingly. # AC_DEFUN([AMANDA_WITHOUT_RESTORE], [ AC_REQUIRE([AMANDA_WITHOUT_SERVER]) WANT_RESTORE=${WANT_SERVER-true} AC_ARG_WITH(restore, AS_HELP_STRING([--without-restore], [do not build amrestore nor amidxtaped]), [ case "$withval" in y | ye | yes) WANT_RESTORE=true;; n | no) WANT_RESTORE=false;; *) AC_MSG_ERROR([You must not supply an argument to --with-restore option.]) ;; esac ]) ]) # SYNOPSIS # # AMANDA_WITHOUT_AMRECOVER # # OVERVIEW # # Add option --without-amrecover, and set WANT_RECOVER (not WANT_AMRECOVER) to # true or false, accordingly. # AC_DEFUN([AMANDA_WITHOUT_AMRECOVER], [ AC_REQUIRE([AMANDA_WITHOUT_CLIENT]) WANT_RECOVER=${WANT_CLIENT-true} AC_ARG_WITH(amrecover, AS_HELP_STRING([--without-amrecover], [do not build amrecover]), [ case "$withval" in y | ye | yes) WANT_RECOVER=true;; n | no) WANT_RECOVER=false;; *) AC_MSG_ERROR([You must not supply an argument to --with-amrecover option.]) ;; esac ]) ]) # SYNOPSIS # # AMANDA_WITHOUT_NDMP # # OVERVIEW # # Add option --without-ndmp, and set WANT_NDMP to # true or false, accordingly. # AC_DEFUN([AMANDA_WITHOUT_NDMP], [ WANT_NDMP=${WANT_NDMP-true} AC_ARG_WITH(ndmp, AS_HELP_STRING([--without-ndmp], [do not build ndmp]), [ case "$withval" in y | ye | yes) WANT_NDMP=true;; n | no) WANT_NDMP=false;; *) AC_MSG_ERROR([You must not supply an argument to --with-ndmp option.]) ;; esac ]) ]) ## deprecated --with-* options AC_DEFUN([AMANDA_WITH_CLIENT_ONLY], [ AC_ARG_WITH(client-only, AS_HELP_STRING([--with-client-only], [deprecated: use --without-server]), [ AC_MSG_ERROR([--with-client-only is deprecated, use --without-server instead.]) ]) ],) AC_DEFUN([AMANDA_WITH_SERVER_ONLY], [ AC_ARG_WITH(server-only, AS_HELP_STRING([--with-server-only], [deprecated: use --without-client]), [ AC_MSG_ERROR([--with-server-only is deprecated, use --without-client instead.]) ],) ]) # SYNOPSIS # # AMANDA_SHOW_COMPONENTS_SUMMARY # # OVERVIEW # # Show a summary of the settings from this file. # AC_DEFUN([AMANDA_SHOW_COMPONENTS_SUMMARY], [ echo "Amanda Components:$AMANDA_COMPONENTS$missing_components" ]) amanda-3.3.6/config/amanda/flags.m40000664000076400007640000001764212357250007020477 0ustar00martineamartinea00000000000000# OVERVIEW/BACKGROUND # # This file manages flags in CFLAGS, CPPFLAGS, LDFLAGS, and LIBS. # # Flags can come from two several sources: # - entry to ./configure or on the configure command line (they are # `precious' variables) # - added by autoconf tests during the execution of configure # # Although Automake supports overriding variables when invoking 'make', # we don't support it (mostly because autoconf doesn't). Instead, users # should specify such variables when invoking ./configure. # # CFLAGS are a little bit more complicated: Amanda has two categories, # mandatory CFLAGS, which should be used everywhere, and warning CFLAGS, # which are only used on Amanda code (not gnulib or yacc-generated code). # To accomplish this, mandatory CFLAGS go directl into CFLAGS, while # warwnings go in AMANDA_WARNING_CFLAGS; these are then added to # AM_CFLAGS by the Makefiles. # SYNOPSIS # # AMANDA_INIT_FLAGS() # # DESCRIPTION # # Process variables given by the user on the command line, # either as environment variables: # CPPFLAGS=-Dfoo ./configure ... # as assignments in the configure command line: # ./configure LIBS=-lfoo ... # or with the deprecated flags --with-cflags, --with-includes, and # --with-libraries # AC_DEFUN([AMANDA_INIT_FLAGS], [ # support deprecated ./configure flags to set various compiler flags AC_ARG_WITH(cflags, AS_HELP_STRING([--with-cflags=FLAGS], [deprecated; use ./configure CFLAGS=... ]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-cflags option.]) ;; esac CFLAGS="$withval" ]) AC_ARG_WITH(includes, AS_HELP_STRING([--with-includes=INCLUDE-DIRS], [deprecated; use ./configure CPPFLAGS='-I.. -I..']), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.]) ;; esac for dir in $withval; do if test -d "$dir"; then CPPFLAGS="$CPPFLAGS -I$dir" else AMANDA_MSG_WARN([Include directory $dir does not exist.]) fi done ]) AC_ARG_WITH(libraries, AS_HELP_STRING([--with-libraries=LIBRARY-DIRS], [deprecated; use ./configure LDFLAGS='-L.. -L..' (add -R on Solaris, NetBSD)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.]) ;; esac for dir in $withval; do if test -d "$dir"; then case "$host" in *-solaris2*,*-netbsd*) LDFLAGS="$LDFLAGS -R$dir" ;; esac LDFLAGS="$LDFLAGS -L$dir" else AMANDA_MSG_WARN([Library directory $dir does not exist.]) fi done ]) # Disable strict-aliasing optimizations AMANDA_DISABLE_GCC_FEATURE(strict-aliasing) # Warn for just about everything AMANDA_ENABLE_GCC_WARNING(all) # And add any extra warnings too AMANDA_TEST_GCC_FLAG(-Wextra, [ AMANDA_ADD_WARNING_CFLAG(-Wextra) ], [ AMANDA_TEST_GCC_FLAG(-W, [ AMANDA_ADD_WARNING_CFLAG(-W) ]) ]) AC_SUBST([AMANDA_WARNING_CFLAGS]) ]) # SYNOPSIS # # AMANDA_STATIC_FLAGS(new_flags) # # DESCRIPTION # # Set AMANDA_STATIC_LDFLAGS to -static if --enable-static-binary # AC_DEFUN([AMANDA_STATIC_FLAGS], [ AC_ARG_ENABLE(static-binary, AS_HELP_STRING([--enable-static-binary], [To build statically linked binaries]), [ case "$enableval" in "" | y | ye | yes) AMANDA_STATIC_LDFLAGS=-static if test x"$enable_static" = x"no"; then AC_MSG_ERROR([*** --enable-static-binary is incompatible with --disable-static]) fi ;; *n | no) AMANDA_STATIC_LDFLAGS= ;; esac ]) AC_SUBST([AMANDA_STATIC_LDFLAGS]) ]) # SYNOPSIS # # AMANDA_WERROR_FLAGS # # DESCRIPTION # # Set AMANDA_WERROR_FLAGS # AC_DEFUN([AMANDA_WERROR_FLAGS], [ AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], [To compile with -Werror compiler flag]), [ case "$enableval" in "" | y | ye | yes) AMANDA_ENABLE_GCC_WARNING(error) ;; esac ]) ]) # SYNOPSIS # # AMANDA_SWIG_ERROR # # DESCRIPTION # # Set AMANDA_SWIG_ERROR # AC_DEFUN([AMANDA_SWIG_ERROR], [ AC_ARG_ENABLE(swig-error, AS_HELP_STRING([--enable-swig-error], [To compile swiged C file with -Werror compiler flag]), [ case "$enableval" in "" | y | ye | yes) AMANDA_SWIG_PERL_CFLAGS=-Werror -Wno-deprecated-declarations ;; *n | no) AMANDA_SWIG_PERL_CFLAGS= ;; esac ]) AC_SUBST([AMANDA_SWIG_PERL_CFLAGS]) ]) # SYNOPSIS # # AMANDA_ADD_CFLAGS(new_flags) # # DESCRIPTION # # Add 'new_flags' to CFLAGS. # # 'new_flags' will be enclosed in double quotes in the resulting # shell assignment. # AC_DEFUN([AMANDA_ADD_CFLAGS], [CFLAGS="$CFLAGS $1"] ) # SYNOPSIS # # AMANDA_ADD_CPPFLAGS(new_flags) # # DESCRIPTION # # Add 'new_flags' to CPPFLAGS. # # 'new_flags' will be enclosed in double quotes in the resulting # shell assignment. # AC_DEFUN([AMANDA_ADD_CPPFLAGS], [CPPFLAGS="$CPPFLAGS $1"] ) # SYNOPSIS # # AMANDA_ADD_LDFLAGS(new_flags) # # DESCRIPTION # # Add 'new_flags' to LDFLAGS. # # 'new_flags' will be enclosed in double quotes in the resulting # shell assignment. # AC_DEFUN([AMANDA_ADD_LDFLAGS], [LDFLAGS="$LDFLAGS $1"] ) # SYNOPSIS # # AMANDA_ADD_LIBS(new_flags) # # DESCRIPTION # # Add 'new_flags' to LIBS. # # 'new_flags' will be enclosed in double quotes in the resulting # shell assignment. # AC_DEFUN([AMANDA_ADD_LIBS], [LIBS="$1 $LIBS"] ) # SYNOPSIS # # AMANDA_DISABLE_GCC_FEATURE(feature) # # OVERVIEW # # Disable feature 'feature' by adding flag -Wno-'feature' to # AMANDA_FEATURE_CFLAGS. # AC_DEFUN([AMANDA_DISABLE_GCC_FEATURE], [ # test for -W'feature', then add the 'no-' version. AMANDA_TEST_GCC_FLAG(-f$1, [ AMANDA_ADD_CFLAGS(-fno-$1) AMANDA_ADD_CPPFLAGS(-fno-$1) ]) ]) # SYNOPSIS # # AMANDA_ADD_WARNING_CFLAG(flag) # # DESCRIPTION # # Add 'flag' to AMANDA_WARNING_CFLAGS # AC_DEFUN([AMANDA_ADD_WARNING_CFLAG], [AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS $1"] ) # SYNOPSIS # # AMANDA_ENABLE_GCC_WARNING(warning) # # OVERVIEW # # Enable warning 'warning' by adding flag -W'warning' to # AMANDA_WARNING_CFLAGS. # AC_DEFUN([AMANDA_ENABLE_GCC_WARNING], [ AMANDA_TEST_GCC_FLAG(-W$1, [ AMANDA_ADD_WARNING_CFLAG(-W$1) ]) ]) # SYNOPSIS # # AMANDA_DISABLE_GCC_WARNING(warning) # # OVERVIEW # # Disable warning 'warning' by adding flag -Wno-'warning' to # AMANDA_WARNING_CFLAGS. # AC_DEFUN([AMANDA_DISABLE_GCC_WARNING], [ # test for -W'warning', then add the 'no-' version. AMANDA_TEST_GCC_FLAG(-W$1, [ AMANDA_ADD_WARNING_CFLAG(-Wno-$1) ]) ]) # SYNOPSIS # # AMANDA_TEST_GCC_FLAG(flag, action-if-found, action-if-not-found) # # OVERVIEW # # See if CC is gcc, and if gcc -v --help contains the given flag. If so, # run action-if-found; otherwise, run action-if-not-found. # # Intended for internal use in this file. # AC_DEFUN([AMANDA_TEST_GCC_FLAG], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_EGREP]) AC_MSG_CHECKING(for gcc flag $1) if test "x$GCC" = "xyes"; then changequote(,)dnl (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || $CC -v --help 2>&1) | $EGREP -- '[^[:alnum:]]$1[^[:alnum:]-]' 2>&1 > /dev/null changequote([,])dnl if test $? -eq 0; then found_warning=yes AC_MSG_RESULT(yes) else found_warning=no AC_MSG_RESULT(no) fi else found_warning=no AC_MSG_RESULT(no (not using gcc)) fi if test x"$found_warning" = x"yes"; then ifelse($2, [], [:], $2) else ifelse($3, [], [:], $3) fi ]) # SYNOPSIS # # AMANDA_SHOW_FLAGS_SUMMARY # # OVERVIEW # # Show a summary of the flags with which Amanda was configured # AC_DEFUN([AMANDA_SHOW_FLAGS_SUMMARY], [ echo "Compiler Flags:" echo " CFLAGS: ${CFLAGS-(none)}" echo " CPPFLAGS: ${CPPFLAGS-(none)}" echo " LDFLAGS: ${LDFLAGS-(none)}" echo " LIBS: ${LIBS-(none)}" ]) amanda-3.3.6/config/amanda/documentation.m40000664000076400007640000000357212357250007022251 0ustar00martineamartinea00000000000000# OVERVIEW # # Configuration for the docbook-based manpages. # # We require XSLTPROC, as well as specific versions of Docbook and the # Docbook DTD. AC_DEFUN([AMANDA_SETUP_DOCUMENTATION], [ AC_ARG_ENABLE(manpage-build, AS_HELP_STRING([--enable-manpage-build], [Build the manpages from their XML source (shipped manpages are usually sufficient)]), [ ENABLE_MANPAGE_BUILD=$enableval ], [ ENABLE_MANPAGE_BUILD=no ]) # and ensure that everything docbook-related is OK if we'll be using it if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then DOC_BUILD_DATE=`date '+%d-%m-%Y'` AC_PROG_XSLTPROC([--nonet]) AC_CHECK_DOCBOOK_XSLT([1.72.0]) AC_CHECK_DOCBOOK_XSLT_MIN([1.72.0]) AC_CHECK_DOCBOOK_DTD([4.1.2]) AC_CHECK_DOCBOOK_DTD([4.2]) if test -z "$XSLTPROC"; then AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.]) fi # if the 'current' Docbook revision is good enough, use that; otherwise, # if 1.72.0 is available, use that. XSLREL=current if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 or higher required.]) else XSLREL=1.72.0 fi fi # disable validation if the correct DTDs are not available if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then AMANDA_MSG_WARN([Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation]) XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid" fi fi AM_CONDITIONAL(ENABLE_MANPAGE_BUILD, test "x$ENABLE_MANPAGE_BUILD" = "xyes") AC_SUBST(XSLREL) AC_SUBST(DOC_BUILD_DATE) ]) # SYNOPSIS # # AMANDA_SHOW_DOCUMENTATION_SUMMARY # # OVERVIEW # # Show a summary of the settings from this file. # AC_DEFUN([AMANDA_SHOW_DOCUMENTATION_SUMMARY], [ echo "Build documentation:" $ENABLE_MANPAGE_BUILD ]) amanda-3.3.6/config/amanda/funcs.m40000664000076400007640000001361612357250007020516 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_FUNC_SELECT_ARG_TYPE # # OVERVIEW # # Figure out the select() argument type. DEFINEs SELECT_ARG_TYPE. # AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE], [ AC_REQUIRE([AC_HEADER_TIME]) AC_CHECK_HEADERS( sys/time.h \ sys/types.h \ sys/select.h \ sys/socket.h \ unistd.h \ ) AC_CACHE_CHECK( [for select() argument type], amanda_cv_select_arg_type, [ rm -f conftest.c cat <conftest.$ac_ext #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_UNISTD_H # include #endif int main() { #ifdef FD_SET_POINTER (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0); #else (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0); #endif return 0; } EOF # Figure out the select argument type by first trying to # compile with the fd_set argument. If the compile fails, # then we know to use the int. If it suceeds, then try to # use the int. If the int fails, then use fd_set. If # both suceeed, then do a line count on the number of # lines that the compiler spit out, assuming that the # compile outputing more lines had more errors. amanda_cv_select_arg_type=no select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS" $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1 if test $? -ne 0; then amanda_cv_select_arg_type=int fi if test "$amanda_cv_select_arg_type" = no; then $select_compile conftest.$ac_ext 1>conftest.int 2>&1 if test $? -ne 0; then amanda_cv_select_arg_type=fd_set fi fi if test "$amanda_cv_select_arg_type" = no; then wc_fdset=`wc -l #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif main() { #ifdef SO_SNDTIMEO int sock = socket(AF_INET, SOCK_STREAM, 0); struct timeval timeout; timeout.tv_sec = 1; timeout.tv_usec = 0; return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (void *)&timeout, sizeof(timeout))); #else return -1; #endif } ], amanda_cv_setsockopt_SO_SNDTIMEO=yes, amanda_cv_setsockopt_SO_SNDTIMEO=no, amanda_cv_setsockopt_SO_SNDTIMEO=no ) ] ) if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ]) fi ] ) # SYNOPSIS # # AMANDA_FUNC_GETTIMEOFDAY_ARGS # # OVERVIEW # # Check for the one or two argument version of gettimeofday. DEFINEs # HAVE_TWO_ARG_GETTIMEOFDAY if the two argument version is present. # AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS], [ AC_REQUIRE([AC_HEADER_TIME]) AC_CHECK_HEADERS( time.h sys/time.h ) AC_CACHE_CHECK( [for gettimeofday number of arguments], amanda_cv_gettimeofday_args, [ AC_TRY_COMPILE( [ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif ], [ struct timeval val; struct timezone zone; gettimeofday(&val, &zone); ], amanda_cv_gettimeofday_args=2, amanda_cv_gettimeofday_args=1 ) ] ) if test "$amanda_cv_gettimeofday_args" = 2; then AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ]) fi ] ) # SYNOPSIS # # ICE_CHECK_DECL (FUNCTION, HEADER-FILE...) # # OVERVIEW # # If FUNCTION is available, define `HAVE_FUNCTION'. If it is declared # in one of the headers named in the whitespace-separated list # HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals). # AC_DEFUN([ICE_CHECK_DECL], [ ice_have_$1=no AC_CHECK_FUNCS($1, ice_have_$1=yes) if test "${ice_have_$1}" = yes; then AC_MSG_CHECKING(for $1 declaration in $2) AC_CACHE_VAL(ice_cv_have_$1_decl, [ ice_cv_have_$1_decl=no changequote(,)dnl ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' changequote([,])dnl for header in $2; do # Check for ordinary declaration AC_EGREP_HEADER([${ice_re_word}$1[ ]*\(], $header, ice_cv_have_$1_decl=yes) if test "$ice_cv_have_$1_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" AC_EGREP_HEADER([${ice_re_word}$1[ ]*$ice_re_params\(\(], $header, ice_cv_have_$1_decl=yes) if test "$ice_cv_have_$1_decl" = yes; then break fi done ]) AC_MSG_RESULT($ice_cv_have_$1_decl) if test "$ice_cv_have_$1_decl" = yes; then AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ]) fi fi ])dnl # SYNOPSIS # # AMANDA_FUNC_SETPGID # # OVERVIEW # # Search for the function HAVE_SETPGID, and run an ICE_CHECK_DECL on it if so. # AC_DEFUN([AMANDA_FUNC_SETPGID], [ AC_CHECK_FUNC(setpgid, [ AC_DEFINE(HAVE_SETPGID,1,[Define if setpgid() is available. ]) ICE_CHECK_DECL(setpgid,sys/types.h unistd.h) ]) ]) amanda-3.3.6/config/amanda/ndmp-device.m40000664000076400007640000000155012357250007021565 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_NDMP_DEVICE # # OVERVIEW # # Set up for the 'ndmp' device. WANT_NDMP_DEVICE is # defined and AM_CONDITIONAL'd if the ndmp device should be supported, # and a check is made that NDMP is being built # AC_DEFUN([AMANDA_NDMP_DEVICE], [ AC_REQUIRE([AMANDA_CHECK_COMPONENTS]) AC_ARG_ENABLE([ndmp-device], AS_HELP_STRING([--disable-ndmp-device], [disable the NDMP device]), [ WANT_NDMP_DEVICE=$enableval ], [ WANT_NDMP_DEVICE=$WANT_NDMP ]) if test x"$WANT_NDMP" != x"true" -a x"$WANT_NDMP_DEVICE" = x"true"; then AC_MSG_ERROR([NDMP support is required to build the ndmp device (--with-ndmp)]) fi if test x"$WANT_NDMP_DEVICE" = x"true"; then AC_DEFINE(WANT_NDMP_DEVICE, 1, [Compile NDMP device]) fi AM_CONDITIONAL([WANT_NDMP_DEVICE], [test x"$WANT_NDMP_DEVICE" = x"true"]) ]) amanda-3.3.6/config/amanda/ipv6.m40000664000076400007640000000532512357250007020262 0ustar00martineamartinea00000000000000# # Checks to see if there's a sockaddr_storage structure # # usage: # # AMANDA_SOCKADDR_STORAGE # # results: # # HAVE_SOCKADDR_STORAGE (defined) # AC_DEFUN([AMANDA_SOCKADDR_STORAGE], [ AC_CACHE_CHECK([if sockaddr_storage struct exists], ac_cv_has_sockaddr_storage, [ AC_TRY_COMPILE([ # include # include ], [u_int i = sizeof (struct sockaddr_storage)], ac_cv_has_sockaddr_storage=yes, ac_cv_has_sockaddr_storage=no) ]) if test $ac_cv_has_sockaddr_storage = yes ; then AC_DEFINE(HAVE_SOCKADDR_STORAGE,1, [struct sockaddr_storage exists]) fi ]) # SYNOPSIS # # AMANDA_CHECK_IPV6 # # DESCRIPTION # # Determine if this system has basic IPv6 support. This # addresse general availability (defining WORKING_IPV6 if # there's some amount of compatibility there), as well as # searching for specific functionality by requiring the other # macros in this file. # AC_DEFUN([AMANDA_CHECK_IPV6], [ AC_REQUIRE([AMANDA_SOCKADDR_STORAGE]) WORKING_IPV6=no AC_ARG_WITH(ipv6, AS_HELP_STRING([--with-ipv6], [enable IPv6 support (default if IPv6 is found)]) AS_HELP_STRING([--without-ipv6], [disable IPv6]), [ case "$withval" in y | ye | yes) amanda_with_ipv6=yes;; n | no) amanda_with_ipv6=no;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-ipv6 option.]) ;; esac ], [ amanda_with_ipv6=maybe ] ) if test x"$amanda_with_ipv6" = x"yes" || test x"$amanda_with_ipv6" = x"maybe" ; then AC_CACHE_CHECK([for working IPv6], amanda_cv_working_ipv6, [ case "$host" in *-pc-cygwin) amanda_cv_working_ipv6=no;; *) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif #include #include main() { int aa; aa = socket(AF_INET6, SOCK_STREAM, 0); if (aa > 0) return 0; return aa; }]])], [ amanda_cv_working_ipv6=yes ], [ amanda_cv_working_ipv6=no ], [ amanda_cv_working_ipv6=yes ] ) esac ]) if test "$amanda_cv_working_ipv6" = yes; then WORKING_IPV6=yes AC_DEFINE(WORKING_IPV6,1, [This system has functional IPv6 support (kernel and compiler)]) else # error out only if the user specifically requested support if test x"$amanda_with_ipv6" = x"yes"; then AC_MSG_ERROR([IPv6 support was requested, but opening an IPv6 socket failed]) fi fi fi ]) # SYNOPSIS # # AMANDA_SHOW_IPV6_SUMMARY # # OVERVIEW # # Show a summary of the settings from this file. # AC_DEFUN([AMANDA_SHOW_IPV6_SUMMARY], [ echo "Working IPv6:" $WORKING_IPV6 ]) amanda-3.3.6/config/amanda/krb5-security.m40000664000076400007640000001024212357250007022100 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_KRB5_SECURITY # # OVERVIEW # # Handle configuration for KRB5 security, implementing the --with-krb5-security # option. If libraries are found, they are added to the relevant compiler flags. # # Defines and substitutes KRB5_SECURITY, and sets AM_CONDITIONAL # WANT_KRB5_SECURITY, if the user has selected this mechanism. Also, the # following parameters are taken from options, defined, and substituted: # AC_DEFUN([AMANDA_KRB5_SECURITY], [ # Specify --with-krb5-security if Kerberos software is in somewhere # other than the listed KRB5_SPOTS. We only compile kerberos support in # if the right files are there. KRB5_SECURITY="no" : ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} AC_ARG_WITH(krb5-security, AS_HELP_STRING([--with-krb5-security=DIR], [Location of Kerberos V software @<:@/usr/kerberos /usr/cygnus /usr /opt/kerberos@:>@]), [ case "$withval" in n | no) KRB5_SECURITY=no ;; y | ye | yes) KRB5_SECURITY=yes ;; *) KRB5_SPOTS="$KRB5_SECURITY" KRB5_SECURITY=yes ;; esac ] ) if test "x$KRB5_SECURITY" = "xyes"; then # if found, force the static versions of these libs (.a) by linking directly # with the .a files. I don't know how to get -R dependancies checked # in autoconf at this time. -kashmir AC_MSG_CHECKING(for Kerberos V libraries) KRB5_DIR_FOUND="" for dir in $KRB5_SPOTS; do for lib in lib lib64; do k5libdir=${dir}/${lib} if test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libgssapi_krb5.so -o -f ${k5libdir}/libgssapi_krb5.a \) -a \( -f ${k5libdir}/libcom_err.a -o -f ${k5libdir}/libcom_err.so \); then if test -f ${k5libdir}/libk5crypto.a -o -f ${k5libdir}/libk5crypto.so; then K5CRYPTO=-lk5crypto elif test -f ${k5libdir}/libcrypto.a -o -f ${k5libdir}/libcrypto.so; then K5CRYPTO=-lcrypto else K5CRYPTO="" fi if test -f ${k5libdir}/libkrb5support.a -o -f ${k5libdir}/libkrb5support.so; then K5SUPPORT=-lkrb5support else K5SUPPORT="" fi KRB5_DIR_FOUND=$dir KRB5_LIBDIR_FOUND=$k5libdir AMANDA_ADD_LIBS([-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err]) break elif test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libasn1.a -o -f ${k5libdir}/libasn1.so \) -a \( -f ${k5libdir}/libgssapi.a -o -f ${k5libdir}/libgssapi.so \); then AMANDA_ADD_LIBS([-lgssapi -lkrb5 -lasn1]) AMANDA_ADD_CPPFLAGS([-DKRB5_HEIMDAL_INCLUDES]) break fi done done if test "$KRB5_DIR_FOUND"; then AC_MSG_RESULT(found in $KRB5_DIR_FOUND) # # some OS's, such as NetBSD, stick krb5 includes out of the way... # should probably just use autoconf to look for various include # options and set them, but don't quite want to do that until I've # dug into it a bit more. # if test -d "$KRB5_DIR_FOUND/krb5" ; then AMANDA_ADD_CPPFLAGS([-I$KRB5_DIR_FOUND/include/krb5]) else AMANDA_ADD_CPPFLAGS([-I$KRB5_DIR_FOUND/include]) fi AC_CHECK_LIB(krb5support,main) if test "$KRB5_LIBDIR_FOUND" != "$libdir" ; then AMANDA_ADD_LDFLAGS([-L$KRB5_LIBDIR_FOUND]) fi AC_DEFINE(KRB5_SECURITY,1, [Define if Kerberos 5 security is to be enabled. ]) else AC_MSG_RESULT(no krb5 system libraries found) AC_MSG_ERROR([No Kerberos V libraries were found on your system; krb5-security cannot be enabled]) KRB5_SECURITY="no" fi fi AM_CONDITIONAL(WANT_KRB5_SECURITY, test x"$KRB5_SECURITY" = x"yes") AC_SUBST(KRB5_SECURITY) ]) amanda-3.3.6/config/amanda/config.m40000664000076400007640000000516012357250007020640 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CONFIG_LCOAL # # OVERVIEW # # Invoke ./config.local, if it exists # AC_DEFUN([AMANDA_CONFIG_LOCAL], [ if test -f config.local; then echo "running local script ./config.local" . ./config.local fi ]) # SYNOPSIS # # AMANDA_CONFIGURE_ARGS # # OVERVIEW # # Set CONFIGURE_ARGS # AC_DEFUN([AMANDA_CONFIGURE_ARGS], [ CONFIGURE_ARGS=$ac_configure_args AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, "$CONFIGURE_ARGS", [Define as the configure command line option. ]) AC_SUBST(CONFIGURE_ARGS) ]) # SYNOPSIS # # AMANDA_GET_SVN_INFO # # OVERVIEW # # If the build is in a Subversion working copy, and if an svn client # is available, then update common-src/svn-info.h to reflect the current # revision and branch. # # If these things are not available, then the file is not updated, and # any previous contents are used. If the file does not exist, it is # created. # AC_DEFUN([AMANDA_GET_SVN_INFO], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_REQUIRE([AMANDA_PROG_GREP]) AC_PATH_PROG(SVN, svn,, $LOCSYSPATH) AC_MSG_CHECKING([Subversion revision information]) if test -d $srcdir/.svn -a -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then SVN_REV=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-` SVN_URL=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-` SVN_PATH=`$GREP URL: conftemp.svn|cut -d "/" -f 7-` SVN_TYPE=`echo ${SVN_PATH} |cut -d "/" -f 1` SVN_BRANCH=`echo "${SVN_PATH}"| cut -d "/" -f 2` url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-` ( echo '#define BUILT_REV "'$SVN_REV'"' echo '#define BUILT_BRANCH "'$SVN_BRANCH'"' ) > common-src/svn-info.h AC_MSG_RESULT([updated]) else # Makefiles will be upset if the file doesn't exist, so double-check if test -f common-src/svn-info.h; then : # all good AC_MSG_RESULT([not changed]) else echo '/* no information available */' > common-src/svn-info.h AC_MSG_RESULT([not available]) fi fi rm -f conftemp.svn ]) # SYNOPSIS # # AMANDA_GET_GIT_INFO # # OVERVIEW # # If the build is in a git working copy, and if an git client # is available, then set GIT_SHA1 # AC_DEFUN([AMANDA_GET_GIT_INFO], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_REQUIRE([AMANDA_PROG_GREP]) AC_PATH_PROG(GIT, git,, $LOCSYSPATH) AC_MSG_CHECKING([git revision information]) if test -d $srcdir/.git -a -n "$GIT"; then GIT_SHA1=`(cd $srcdir > /dev/null ; $GIT rev-parse HEAD | cut -c -8 )` if test -n "$GIT_SHA1"; then AC_MSG_RESULT([$GIT_SHA1]) else AC_MSG_RESULT(['git rev-parse HEAD' failed]) fi else AC_MSG_RESULT([not available]) fi rm -f conftemp.git ]) amanda-3.3.6/config/amanda/s3-device.m40000664000076400007640000000244112357250007021154 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_S3_DEVICE # # OVERVIEW # # Perform the necessary checks for the S3 Device. If the S3 device should be built, # WANT_S3_DEVICE is DEFINEd and set up as an AM_CONDITIONAL. # AC_DEFUN([AMANDA_S3_DEVICE], [ AC_REQUIRE([AMANDA_CHECK_LIBCURL]) AC_REQUIRE([AMANDA_CHECK_HMAC]) AC_ARG_ENABLE([s3-device], AS_HELP_STRING([--disable-s3-device], [disable the S3 device]), [ WANT_S3_DEVICE=$enableval ], [ WANT_S3_DEVICE=maybe ]) AC_MSG_CHECKING([whether to include the Amazon S3 device]) # if the user didn't specify 'no', then check for support if test x"$WANT_S3_DEVICE" != x"no"; then if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then WANT_S3_DEVICE=yes else # no support -- if the user explicitly enabled the device, # then this is an error if test x"$WANT_S3_DEVICE" = x"yes"; then AC_MSG_RESULT(no) AC_MSG_ERROR([Cannot build the Amazon S3 device: one or more prerequisites are missing.]) else WANT_S3_DEVICE=no fi fi fi AC_MSG_RESULT($WANT_S3_DEVICE) AM_CONDITIONAL([WANT_S3_DEVICE], [test x"$WANT_S3_DEVICE" = x"yes"]) # Now handle any setup for S3, if we want it. if test x"$WANT_S3_DEVICE" = x"yes"; then AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver]) fi ]) amanda-3.3.6/config/amanda/defaults.m40000664000076400007640000000751712357250007021212 0ustar00martineamartinea00000000000000# SYNOPSIS # # Get default settings for various configuration and command-line options: # --with-index-server # define and substitute DEFAULT_SERVER # --with-config # define and substitute DEFAULT_CONFIG # --with-tape-server # define and substitute DEFAULT_TAPE_SERVER # --with-tape-device # define and substitute DEFAULT_TAPE_DEVICE; substitue EXAMPLE_TAPEDEV # --with-amandates # define and substitute DEFAULT_AMANDATES_FILE # AC_DEFUN([AMANDA_SETUP_DEFAULTS], [ #allow configure CONFIG_CLOBBER_MY_CONFIG= to be used by make. CONFIG_CLOBBER_MY_CONFIG=$CLOBBER_MY_CONFIG AC_SUBST(CONFIG_CLOBBER_MY_CONFIG) AC_ARG_WITH(index-server, AS_HELP_STRING([--with-index-server=HOST], [default amanda index server (default: `uname -n`)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.]) ;; *) DEFAULT_SERVER="$withval" ;; esac ], : ${DEFAULT_SERVER=`uname -n`} ) AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER", [This is the default Amanda index server.]) AC_SUBST(DEFAULT_SERVER) AC_ARG_WITH(config, AS_HELP_STRING([--with-config=CONFIG], [default amanda configuration (default: DailySet1)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-config option.]) ;; *) DEFAULT_CONFIG="$withval" ;; esac ], : ${DEFAULT_CONFIG=DailySet1} ) AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG", [This is the default Amanda configuration.]) AC_SUBST(DEFAULT_CONFIG) AC_ARG_WITH(tape-server, AS_HELP_STRING([--with-tape-server=HOST], [default tape server for restore (default: same as index-server)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.]) ;; *) DEFAULT_TAPE_SERVER="$withval" ;; esac ], : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER} ) AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER", [This is the default restoring Amanda tape server. ]) AC_SUBST(DEFAULT_TAPE_SERVER) AC_ARG_WITH(tape-device, AS_HELP_STRING([--with-tape-device=DEVICE], [default device on restore tape server]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.]) ;; *) DEFAULT_TAPE_DEVICE="$withval" ;; esac ] ) AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE", [This is the default no-rewinding tape device. ]) AC_SUBST(DEFAULT_TAPE_DEVICE) if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE" else EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE" fi AC_SUBST(EXAMPLE_TAPEDEV) AC_ARG_WITH(changer-device, AS_HELP_STRING([--with-changer-device=DEV], [(deprecated)]), [ AMANDA_MSG_WARN([--with-changer-device is no longer used.]) ] ) AC_ARG_WITH(amandates, AS_HELP_STRING([--with-amandates], [default location for 'amandates' (default: $localstatedir/amanda/amandates)]), [ case "$withval" in n | no) AC_MSG_ERROR([*** --without-amandates is not allowed.]);; y | ye | yes) amandates='$localstatedir/amanda/amandates' ;; *) amandates="$withval";; esac ], [amandates='$localstatedir/amanda/amandates'] ) AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates], [Default location for 'amandates']) DEFAULT_FSF_AFTER_FILEMARK="FALSE" case "$host" in *-solaris*) DEFAULT_FSF_AFTER_FILEMARK="TRUE" ;; esac AC_DEFINE_UNQUOTED(DEFAULT_FSF_AFTER_FILEMARK, $DEFAULT_FSF_AFTER_FILEMARK, [Define if a FSF is needed on filemark.]) ]) amanda-3.3.6/config/amanda/libs.m40000664000076400007640000003776212357250007020341 0ustar00martineamartinea00000000000000# OVERVIEW # # This file contains macros that search for specific libraries that are # required or utilized by Amanda. # SYNOPSIS # # AMANDA_CHECK_LIBCURL # # OVERVIEW # # Check for LIBCURL support. Sets the shell variable HAVE_CURL to "yes" or # "no" depending on the result of the test. If CURL is found, the necessary # compiler flags are added, and a few other type checks are performed. # # Note that libcurl itself defines a number of useful symbols as well; see # the libcurl distribution for details. # AC_DEFUN([AMANDA_CHECK_LIBCURL], [ LIBCURL_CHECK_CONFIG(yes, 7.10.0, HAVE_CURL=yes, HAVE_CURL=no) if test x"$HAVE_CURL" = x"yes"; then AMANDA_ADD_LIBS($LIBCURL) AMANDA_ADD_CPPFLAGS($LIBCURL_CPPFLAGS) AMANDA_CHECK_TYPE([curl_off_t], [off_t], [curl/curl.h]) case "$host" in *sun-solaris2*) # Solaris, all versions. # we extract the -L flags and translate them to -R flags, as required # by the runtime linker. if test -n "$_libcurl_config"; then curlflags=`$_libcurl_config --libs 2>/dev/null` for flag in curlflags; do case $flag in -L*) LDFLAGS="$LDFLAGS "`echo "x$flag" | sed -e 's/^x-L/-R/'`;; esac done fi ;; esac fi ]) # SYNOPSIS # # AMANDA_CHECK_HMAC # # OVERVIEW # # Check for HMAC support in -lcrypto. If found, the shell # variable HAVE_HMAC will be set to 'yes'. The appropriate one of # HAVE_OPENSSL_HMAC_H, HAVE_CRYPTO_HMAC_H, and HAVE_HMAC_H are also # defined via AC_CHECK_HEADERS. # AC_DEFUN([AMANDA_CHECK_HMAC], [ HAVE_HMAC=yes AC_CHECK_LIB([crypto], [HMAC_CTX_init], [], [HAVE_HMAC=no]) found_hmac_h=no AC_CHECK_HEADERS([openssl/hmac.h crypto/hmac.h hmac.h], [found_hmac_h=yes; break]) if test x"$found_hmac_h" != x"yes"; then HAVE_HMAC=no fi ]) # SYNOPSIS # # AMANDA_CHECK_NET_LIBS # # OVERIVEW # # Check for the libraries we'll need to use sockets, etc. # AC_DEFUN([AMANDA_CHECK_NET_LIBS], [ # Make sure we don't use -lnsl and -lsun on Irix systems. case "$host" in *sgi-irix*) AC_CHECK_LIB(socket,main) ;; *) AC_CHECK_LIB(resolv,main) AC_CHECK_LIB(nsl,main) AC_CHECK_LIB(socket,main) AC_CHECK_LIB(sun,main) ;; esac ]) # SYNOPSIS # # AMANDA_CHECK_GLIB # # OVERVIEW # # Search for glib. This is basically a wrapper for AM_PATH_GLIB_2_0, with # the addition of system-specific configuration to convince Amanda to compile # "out of the box" on more boxes. # AC_DEFUN([AMANDA_CHECK_GLIB], [ AC_ARG_VAR(GLIB_CFLAGS, [CFLAGS to build with glib; disables use of pkg-config; must specify all GLIB_ vars]) AC_ARG_VAR(GLIB_LIBS, [libraries to build with glib; disables use of pkg-config; must specify all GLIB_vars]) AC_ARG_VAR(GLIB_GENMARSHAL, [genmarshal binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars]) AC_ARG_VAR(GOBJECT_QUERY, [gobject_query binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars]) AC_ARG_VAR(GLIB_MKENUMS, [mkenums binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars]) # if any of the precious variables are set, disable the pkg-config run. # Further, if any is specified, all must be specified. explicit_glib=no test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes test x"$GLIB_LIBS" = x"" || explicit_glib=yes test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes if test x"$explicit_glib" = x"no"; then # search for pkg-config, which the glib configuration uses, adding a few # system-specific search paths. AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin:/opt/csw/bin) case "$host" in sparc-sun-solaris2.8) # Solaris 8 # give the linker a runtime search path; pkg-config doesn't supply this. # Users could also specify this with LD_LIBRARY_PATH to both ./configure # and make. Adding this support here makes straight './configure; make' # "just work" on Solaris 8 if test -n "$PKG_CONFIG"; then glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'` LDFLAGS="$LDFLAGS $glib_R_flag" fi ;; esac AM_PATH_GLIB_2_0(2.2.0,,[ AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help) ], gmodule gobject gthread) else # Confirm that all GLIB_ variables are set if test ! x"$GLIB_CFLAGS" = x"" && \ test ! x"$GLIB_LIBS" = x"" && \ test ! x"$GLIB_GENMARSHAL" = x"" && \ test ! x"$GOBJECT_QUERY" = x"" && \ test ! x"$GLIB_MKENUMS" = x""; then : else AC_MSG_ERROR(Not all precious glib variables were set.) fi fi # remove deprecated warning for newer version if $PKG_CONFIG --atleast-version 2.30.0 glib-2.0; then AMANDA_DISABLE_GCC_WARNING(deprecated-declarations) fi # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain. AMANDA_ADD_CPPFLAGS($GLIB_CFLAGS) AMANDA_ADD_LIBS($GLIB_LIBS) ]) # LIBCURL_CHECK_CONFIG is from the libcurl # distribution and licensed under the BSD license: # Copyright (c) 1996 - 2007, Daniel Stenberg, . # # All rights reserved. # # Permission to use, copy, modify, and distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright # notice and this permission notice appear in all copies. # # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], # [ACTION-IF-YES], [ACTION-IF-NO]) # ---------------------------------------------------------- # David Shaw May-09-2006 # # Checks for libcurl. DEFAULT-ACTION is the string yes or no to # specify whether to default to --with-libcurl or --without-libcurl. # If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the # minimum version of libcurl to accept. Pass the version as a regular # version number like 7.10.1. If not supplied, any version is # accepted. ACTION-IF-YES is a list of shell commands to run if # libcurl was successfully found and passed the various tests. # ACTION-IF-NO is a list of shell commands that are run otherwise. # Note that using --without-libcurl does run ACTION-IF-NO. # # This macro #defines HAVE_LIBCURL if a working libcurl setup is # found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary # values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are # the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy # where yyy are the various protocols supported by libcurl. Both xxx # and yyy are capitalized. See the list of AH_TEMPLATEs at the top of # the macro for the complete list of possible defines. Shell # variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also # defined to 'yes' for those features and protocols that were found. # Note that xxx and yyy keep the same capitalization as in the # curl-config list (e.g. it's "HTTP" and not "http"). # # Users may override the detected values by doing something like: # LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure # # For the sake of sanity, this macro assumes that any libcurl that is # found is after version 7.7.2, the first version that included the # curl-config script. Note that it is very important for people # packaging binary versions of libcurl to include this script! # Without curl-config, we can only guess what protocols are available, # or use curl_version_info to figure it out at runtime. AC_DEFUN([LIBCURL_CHECK_CONFIG], [ AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL]) AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4]) AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6]) AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz]) AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS]) AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN]) AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI]) AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM]) AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP]) AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS]) AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP]) AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS]) AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE]) AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET]) AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP]) AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT]) AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP]) AC_ARG_WITH(libcurl, AC_HELP_STRING([--with-libcurl=PREFIX], [look for the curl library in PREFIX/lib and headers in PREFIX/include]), [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) if test "$_libcurl_with" != "no" ; then AC_PROG_AWK _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'" _libcurl_try_link=yes if test -d "$_libcurl_with" ; then LIBCURL_CPPFLAGS="-I$withval/include" _libcurl_ldflags="-L$withval/lib" AC_PATH_PROG([_libcurl_config],[curl-config],[],["$withval/bin"]) else AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH]) fi if test x$_libcurl_config != "x" ; then AC_CACHE_CHECK([for the version of libcurl], [libcurl_cv_lib_curl_version], [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`]) _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse` if test $_libcurl_wanted -gt 0 ; then AC_CACHE_CHECK([for libcurl >= version $2], [libcurl_cv_lib_version_ok], [ if test $_libcurl_version -ge $_libcurl_wanted ; then libcurl_cv_lib_version_ok=yes else libcurl_cv_lib_version_ok=no fi ]) fi if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then if test x"$LIBCURL_CPPFLAGS" = "x" ; then LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL" = "x" ; then LIBCURL=`$_libcurl_config --libs` # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still # lots of Panther installs around. case "${host}" in powerpc-apple-darwin7*) LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` ;; esac fi # All curl-config scripts support --feature _libcurl_features=`$_libcurl_config --feature` # Is it modern enough to have --protocols? (7.12.4) if test $_libcurl_version -ge 461828 ; then _libcurl_protocols=`$_libcurl_config --protocols` fi else _libcurl_try_link=no fi unset _libcurl_wanted fi if test $_libcurl_try_link = yes ; then # we didn't find curl-config, so let's see if the user-supplied # link line (or failing that, "-lcurl") is enough. LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} AC_CACHE_CHECK([whether libcurl is usable], [libcurl_cv_lib_curl_usable], [ _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBCURL $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[ /* Try and use a few common options to force a failure if we are missing symbols or can't link. */ int x; curl_easy_setopt(NULL,CURLOPT_URL,NULL); x=CURL_ERROR_SIZE; x=CURLOPT_WRITEFUNCTION; x=CURLOPT_FILE; x=CURLOPT_ERRORBUFFER; x=CURLOPT_STDERR; x=CURLOPT_VERBOSE; ]])],[libcurl_cv_lib_curl_usable=yes],[libcurl_cv_lib_curl_usable=no]) CPPFLAGS=$_libcurl_save_cppflags LIBS=$_libcurl_save_libs unset _libcurl_save_cppflags unset _libcurl_save_libs ]) if test $libcurl_cv_lib_curl_usable = yes ; then # Does curl_free() exist in this version of libcurl? # If not, fake it with free() _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBS $LIBCURL" AC_CHECK_FUNC(curl_free,, AC_DEFINE(curl_free,free, [Define curl_free() as free() if our version of curl lacks curl_free.])) CPPFLAGS=$_libcurl_save_cppflags LIBS=$_libcurl_save_libs unset _libcurl_save_cppflags unset _libcurl_save_libs AC_DEFINE(HAVE_LIBCURL,1, [Define to 1 if you have a functional curl library.]) AC_SUBST(LIBCURL_CPPFLAGS) AC_SUBST(LIBCURL) for _libcurl_feature in $_libcurl_features ; do AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1]) eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes done if test "x$_libcurl_protocols" = "x" ; then # We don't have --protocols, so just assume that all # protocols are available _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT" if test x$libcurl_feature_SSL = xyes ; then _libcurl_protocols="$_libcurl_protocols HTTPS" # FTPS wasn't standards-compliant until version # 7.11.0 if test $_libcurl_version -ge 461568; then _libcurl_protocols="$_libcurl_protocols FTPS" fi fi fi for _libcurl_protocol in $_libcurl_protocols ; do AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1]) eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes done else unset LIBCURL unset LIBCURL_CPPFLAGS fi fi LIBCURL_USE_NSS=no LIBCURL_USE_GNUTLS=no LIBCURL_USE_OPENSSL=yes _libcurl_configures=`$_libcurl_config --configure` for _libcurl_configure in $_libcurl_configures ; do if [[[ $_libcurl_configure = \'--with-nss* ]]]; then LIBCURL_USE_NSS=yes fi if [[[ $_libcurl_configure = \'--without-nss* ]]]; then LIBCURL_USE_NSS=no fi if [[[ $_libcurl_configure = \'--with-gnutls* ]]]; then LIBCURL_USE_GNUTLS=yes fi if [[[ $_libcurl_configure = \'--without-gnutls* ]]]; then LIBCURL_USE_GNUTLS=no fi if [[[ $_libcurl_configure = \'--with-ssl* ]]]; then LIBCURL_USE_OPENSSL=yes fi if [[[ $_libcurl_configure = \'--without-ssl* ]]]; then LIBCURL_USE_OPENSSL=no fi done if test "x$LIBCURL_USE_NSS" = "xyes"; then AC_DEFINE(LIBCURL_USE_NSS, 1, [Defined if libcurl use NSS]) fi if test "x$LIBCURL_USE_GNUTLS" = "xyes"; then AC_DEFINE(LIBCURL_USE_GNUTLS, , [Defined if libcurl use GnuTLS]) fi if test "x$LIBCURL_USE_OPENSSL" = "xyes"; then AC_DEFINE(LIBCURL_USE_OPENSSL, 1, [Defined if libcurl use OpenSSL]) fi unset _libcurl_try_link unset _libcurl_version_parse unset _libcurl_config unset _libcurl_feature unset _libcurl_features unset _libcurl_protocol unset _libcurl_protocols unset _libcurl_version unset _libcurl_ldflags unset _libcurl_configure unset _libcurl_configures fi if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then # This is the IF-NO path ifelse([$4],,:,[$4]) else # This is the IF-YES path ifelse([$3],,:,[$3]) fi unset _libcurl_with ])dnl amanda-3.3.6/config/amanda/types.m40000664000076400007640000001164512357250007020544 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_TYPE(type, replacement-type, header) # # OVERVIEW # # Like AC_CHECK_TYPE, where action-if-not-found DEFINEs $1 to $2. # # 'header' must be a single header name, or blank to use the default # headers. # AC_DEFUN([AMANDA_CHECK_TYPE], [ AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_TYPE($1, [], [ AC_DEFINE($1, $2, [Type for $1, if it is not defined by the system]) ], ifelse($3, [], [], [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef STDC_HEADERS #include #include #endif #include <$3> ]) ) ]) # # SYNOPSIS # # AMANDA_TYPE_PID_T # # OVERVIEW # # Check whether pid_t is a long, int, or short. DEFINE PRINTF_PID_T to the # corresponding printf format. # AC_DEFUN([AMANDA_TYPE_PID_T], [ AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_TYPE_PID_T]) AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type, [ amanda_cv_pid_type=unknown if test "$ac_cv_type_pid_t" = no; then amanda_cv_pid_type=int fi for TEST_amanda_cv_pid_type in long short int; do if test $amanda_cv_pid_type = unknown; then AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t, [ #include #if STDC_HEADERS #include #include #endif ], amanda_cv_pid_type=$TEST_amanda_cv_pid_type) fi if test $amanda_cv_pid_type = unknown; then AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type}, [ #include #if STDC_HEADERS #include #include #endif ZZZZ pid_t ], amanda_cv_pid_type=$TEST_amanda_cv_pid_type) fi done if test $amanda_cv_pid_type = unknown; then amanda_cv_pid_type=int fi ] ) case $amanda_cv_pid_type in int) AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;; long) AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;; short) AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;; esac ] ) # SYNOPSIS # # CF_WAIT # # OVERVIEW # # Test for the presence of , 'union wait', arg-type of 'wait()'. # by T.E.Dickey" , Jim Spath # # DEFINEs WAIT_USES_UNION if 'union wait' is found. Note that many systems # support *both* 'union wait' and 'int' using a transparent union. # # Original comments: # # FIXME: These tests should have been in autoconf 1.11! # # Note that we cannot simply grep for 'union wait' in the wait.h file, # because some Posix systems turn this on only when a BSD variable is # defined. Since I'm trying to do without special defines, I'll live # with the default behavior of the include-file. # # I do _2_ compile checks, because we may have union-wait, but the # prototype for 'wait()' may want an int. # # Don't use HAVE_UNION_WAIT, because the autoconf documentation implies # that if we've got union-wait, we'll automatically use it. # # Garrett Wollman adds: # The tests described above don't quite do the right thing, # since some systems have hacks which allow `union wait' to # still work even though `int' is preferred (and generates # fewer warnings). Since all of these systems use prototypes, # we can use the prototype of wait(2) to disambiguate them. # # Alexandre Oliva adds: # A single compile check is enough. If we don't have union wait, # it's obvious that the test will fail, and that we must use int. # If we do, the prototype (on STDC systems) and WIFEXITED will tell # whether we're supposed to be using union wait instead of int. # AC_DEFUN([CF_WAIT], [ AC_REQUIRE([AC_TYPE_PID_T]) AC_HAVE_HEADERS(sys/wait.h wait.h) AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait], [ AC_TRY_COMPILE([ #include #if HAVE_SYS_WAIT_H # include #else # if HAVE_WAIT_H # include # endif #endif #ifdef __STDC__ pid_t wait(union wait *); #endif ], [ union wait x; int i; wait(&x); i = WIFEXITED(x) ], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])]) if test $cf_cv_arg_union_wait = yes; then AC_DEFINE(WAIT_USES_UNION,1, [Defined if wait() puts the status in a union wait instead of int. ]) fi ]) # SYNOPSIS # # CF_WAIT_INT # # OVERVIEW # # Test for the presence of , 'union wait', arg-type of 'wait()'. # by T.E.Dickey" , Jim Spath # # DEFINEs WAIT_USES_INT if an int result type is found. # AC_DEFUN([CF_WAIT_INT], [ AC_REQUIRE([AC_TYPE_PID_T]) AC_HAVE_HEADERS(sys/wait.h wait.h) AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int], [ AC_TRY_COMPILE([ #include #if HAVE_SYS_WAIT_H # include #else # if HAVE_WAIT_H # include # endif #endif #ifdef __STDC__ pid_t wait(int *); #endif ], [ int x; int i; wait(&x); i = WIFEXITED(x) ], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])]) if test $cf_cv_arg_int = yes; then AC_DEFINE(WAIT_USES_INT,1, [Defined if wait() puts the status in a int instead of a union wait. ]) fi ]) amanda-3.3.6/config/amanda/readline.m40000664000076400007640000001206312357250007021156 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_CHECK_READLINE # # OVERVIEW # # Check for readline support. Defines HAVE_LIBREADLINE if readline # is available, and also checks for a number of readline headers and # adds readline libraries to READLINE_LIBS. # # See common-src/util.{c,h}. # # # Some idea taken from AX_LIB_READLINE: # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html # =========================================================================== # # SYNOPSIS # # AX_LIB_READLINE # # DESCRIPTION # # Searches for a readline compatible library. If found, defines # `HAVE_LIBREADLINE'. If the found library has the `add_history' function, # sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the # necessary include files and sets `HAVE_READLINE_H' or # `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or # 'HAVE_HISTORY_H' if the corresponding include files exists. # # The libraries that may be readline compatible are `libedit', # `libeditline' and `libreadline'. Sometimes we need to link a termcap # library for readline to work, this macro tests these cases too by trying # to link with `libtermcap', `libcurses' or `libncurses' before giving up. # # Here is an example of how to use the information provided by this macro # to perform the necessary includes or declarations in a C file: # # #ifdef HAVE_LIBREADLINE # # if defined(HAVE_READLINE_READLINE_H) # # include # # elif defined(HAVE_READLINE_H) # # include # # else /* !defined(HAVE_READLINE_H) */ # extern char *readline (); # # endif /* !defined(HAVE_READLINE_H) */ # char *cmdline = NULL; # #else /* !defined(HAVE_READLINE_READLINE_H) */ # /* no readline */ # #endif /* HAVE_LIBREADLINE */ # # #ifdef HAVE_READLINE_HISTORY # # if defined(HAVE_READLINE_HISTORY_H) # # include # # elif defined(HAVE_HISTORY_H) # # include # # else /* !defined(HAVE_HISTORY_H) */ # extern void add_history (); # extern int write_history (); # extern int read_history (); # # endif /* defined(HAVE_READLINE_HISTORY_H) */ # /* no history */ # #endif /* HAVE_READLINE_HISTORY */ # # LICENSE # # Copyright (c) 2008 Ville Laurikari # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 6 AC_DEFUN([AMANDA_CHECK_READLINE], [ AC_ARG_WITH(readline, dnl no initial space here, so the results line up properly AS_HELP_STRING([--with-readline], [require readline support (for amrecover)]) AS_HELP_STRING([--without-readline], [don't search for readline]), [ case "$withval" in y | ye | yes | n | no) : ;; *) AC_MSG_ERROR([*** --with-readline does not take a value]) esac want_readline="$withval" ], [ want_readline="maybe" # meaning "only if we can find it" ] ) # unless the user said "no", look for readline. if test x"$want_readline" != x"no"; then AC_CACHE_CHECK([for a readline compatible library], ax_cv_lib_readline, [ ORIG_LIBS="$LIBS" for readline_lib in readline edit editline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" AC_TRY_LINK_FUNC(readline, ax_cv_lib_readline="$TRY_LIB") if test -n "$ax_cv_lib_readline"; then break fi done if test -n "$ax_cv_lib_readline"; then break fi done if test -z "$ax_cv_lib_readline"; then ax_cv_lib_readline="no" fi LIBS="$ORIG_LIBS" ]) if test "$ax_cv_lib_readline" != "no"; then ORIG_LIBS="$LIBS" LIBS="$LIBS $ax_cv_lib_readline" READLINE_LIBS="$ax_cv_lib_readline" AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a readline compatible library]) AC_CHECK_HEADERS(readline.h readline/readline.h) AC_CACHE_CHECK([whether readline supports history], ax_cv_lib_readline_history, [ ax_cv_lib_readline_history="no" AC_TRY_LINK_FUNC(add_history, ax_cv_lib_readline_history="yes") ]) if test "$ax_cv_lib_readline_history" = "yes"; then AC_DEFINE(HAVE_READLINE_HISTORY, 1, [Define if your readline library has \`add_history']) AC_CHECK_HEADERS(history.h readline/history.h) fi LIBS="$ORIG_LIBS" else # no readline. if the user *really* wanted it, bail out. if test x"$want_readline" = x"yes"; then AC_MSG_ERROR([*** No readline implementation found. Try using --with-libraries and --with-includes]) fi READLINE_LIBS="" fi fi AC_SUBST(READLINE_LIBS) ])dnl amanda-3.3.6/config/amanda/dvdrw-device.m40000664000076400007640000000135312357250007021756 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_DVDRW_DEVICE # # OVERVIEW # # Perform the necessary checks for the DVDRW Device. If the DVDRW device should be built, # WANT_DVDRW_DEVICE is DEFINEd and set up as an AM_CONDITIONAL. # AC_DEFUN([AMANDA_DVDRW_DEVICE], [ AC_ARG_ENABLE([dvdrw-device], AS_HELP_STRING([--disable-dvdrw-device], [disable the DVD-RW device]), [ WANT_DVDRW_DEVICE=$enableval ], [ WANT_DVDRW_DEVICE=yes ]) AC_MSG_CHECKING([whether to include the DVD-RW device]) AC_MSG_RESULT($WANT_DVDRW_DEVICE) AM_CONDITIONAL([WANT_DVDRW_DEVICE], [test x"$WANT_DVDRW_DEVICE" = x"yes"]) # Now handle any setup for DVDRW, if we want it. if test x"$WANT_DVDRW_DEVICE" = x"yes"; then AC_DEFINE(WANT_DVDRW_DEVICE, [], [Compile DVD-RW driver]) fi ]) amanda-3.3.6/config/amanda/ps.m40000664000076400007640000000350012357250007020011 0ustar00martineamartinea00000000000000# # Find ps argument for Amanda::Process # AC_DEFUN([AMANDA_PS_ARGUMENT], [ AC_PATH_PROG(PS, ps) AC_MSG_CHECKING([ps argument to use]) PS_ARGUMENT= # ps is *very* non-portable, and across many systems, the same option # (e.g., -e) can mean different things. So this macro tries to # special-case most known systems, and makes an effort to detect unknown # systems case "$host" in *-*-solaris*) PS_ARGUMENT="-eo pid,ppid,comm" PS_ARGUMENT_ARGS="-eo pid,ppid,comm" ;; *-*-linux-*) PS_ARGUMENT="-eo pid,ppid,command" PS_ARGUMENT_ARGS="-eo pid,ppid,command" ;; *-*-*bsd*) PS_ARGUMENT="-axo pid,ppid,command" PS_ARGUMENT_ARGS="-axo pid,ppid,command" ;; *-apple-darwin*) PS_ARGUMENT="-aAco pid,ppid,command" PS_ARGUMENT_ARGS="-aAo pid,ppid,command" ;; *-pc-cygwin) # Cygwin is special-cased in Amanda::Process PS_ARGUMENT=CYGWIN PS_ARGUMENT_ARGS="-ef" ;; *-*-hpux*) # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode PS="UNIX95=1 $PS" PS_ARGUMENT="-eo pid,ppid,comm" PS_ARGUMENT_ARGS="-eo pid,ppid,comm" ;; *) for try in \ "-axo pid,ppid,command" \ "-aAco pid,ppid,command" \ "-eo pid,ppid,comm" do ps $try >/dev/null 2>/dev/null if test $? -eq 0; then PS_ARGUMENT="$try" break fi done for try in \ "-axo pid,ppid,command" \ "-aAo pid,ppid,command" \ "-eo pid,ppid,comm" do ps $try >/dev/null 2>/dev/null if test $? -eq 0; then PS_ARGUMENT_ARGS="$try" break fi done if test -z "$PS_ARGUMENT" -o -z "$PS_ARGUMENT_ARGS"; then AC_MSG_ERROR([Can't find ps argument to use.]) fi ;; esac AC_MSG_RESULT([$PS_ARGUMENT and $PS_ARGUMENT_ARGS]) AC_SUBST(PS_ARGUMENT) AC_SUBST(PS_ARGUMENT_ARGS) ]) amanda-3.3.6/config/amanda/file-list0000664000076400007640000000256312357750226020760 0ustar00martineamartinea00000000000000## this file is automatically generated by autogen EXTRA_DIST += amanda/amplot.m4 EXTRA_DIST += amanda/as_needed.m4 EXTRA_DIST += amanda/bsd-security.m4 EXTRA_DIST += amanda/bsdtcp-security.m4 EXTRA_DIST += amanda/bsdudp-security.m4 EXTRA_DIST += amanda/components.m4 EXTRA_DIST += amanda/compress.m4 EXTRA_DIST += amanda/config.m4 EXTRA_DIST += amanda/debugging.m4 EXTRA_DIST += amanda/defaults.m4 EXTRA_DIST += amanda/devprefix.m4 EXTRA_DIST += amanda/dirs.m4 EXTRA_DIST += amanda/documentation.m4 EXTRA_DIST += amanda/dumpers.m4 EXTRA_DIST += amanda/dvdrw-device.m4 EXTRA_DIST += amanda/flags.m4 EXTRA_DIST += amanda/flock.m4 EXTRA_DIST += amanda/funcs.m4 EXTRA_DIST += amanda/getfsent.m4 EXTRA_DIST += amanda/i18n.m4 EXTRA_DIST += amanda/ipv6.m4 EXTRA_DIST += amanda/krb5-security.m4 EXTRA_DIST += amanda/lfs.m4 EXTRA_DIST += amanda/libs.m4 EXTRA_DIST += amanda/ndmp-device.m4 EXTRA_DIST += amanda/net.m4 EXTRA_DIST += amanda/progs.m4 EXTRA_DIST += amanda/ps.m4 EXTRA_DIST += amanda/readdir.m4 EXTRA_DIST += amanda/readline.m4 EXTRA_DIST += amanda/rsh-security.m4 EXTRA_DIST += amanda/s3-device.m4 EXTRA_DIST += amanda/socklen_t_equiv.m4 EXTRA_DIST += amanda/ssh-security.m4 EXTRA_DIST += amanda/summary.m4 EXTRA_DIST += amanda/swig.m4 EXTRA_DIST += amanda/syshacks.m4 EXTRA_DIST += amanda/tape.m4 EXTRA_DIST += amanda/types.m4 EXTRA_DIST += amanda/userid.m4 EXTRA_DIST += amanda/version.m4 amanda-3.3.6/config/amanda/tape.m40000664000076400007640000000712212357250007020324 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_WITH_MAXTAPEBLOCKSIZE # # OVERVIEW # # Implement the deprecated --with-maxtapeblocksize option. # AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [ AC_ARG_WITH(maxtapeblocksize, [(deprecated)], [ AMANDA_MSG_WARN([--with-maxtapeblocksize is no longer needed]) ] ) ]) # SYNOPSIS # # AMANDA_TAPE_DEVICE # # OVERVIEW # # Set up for the 'tape' device. WANT_TAPE_DEVICE is defined and # AM_CONDITIONAL'd if the tape device should be supported. # # If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and # mt_erreg, the corresponding HAVE_MT_* is DEFINEd. # AC_DEFUN([AMANDA_TAPE_DEVICE], [ AC_CHECK_HEADERS( \ linux/zftape.h \ sys/tape.h \ sys/mtio.h \ ) # check for MTIOCTOP, an indicator of POSIX tape support AC_CACHE_CHECK([for MTIOCTOP], amanda_cv_HAVE_MTIOCTOP,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TAPE_H # include #endif #ifdef HAVE_SYS_MTIO_H # include #endif #ifndef MTIOCTOP #error MTIOCTOP not defined #endif ], [ int dummy = 0; ], amanda_cv_HAVE_MTIOCTOP=yes, amanda_cv_HAVE_MTIOCTOP=no, amanda_cv_HAVE_MTIOCTOP=no)] HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP ) # maybe we have no tape device at all (e.g., Mac OS X)? if test x"$HAVE_MTIOCTOP" = x"yes"; then want_tape_device=yes AC_DEFINE(WANT_TAPE_DEVICE, 1, [Define if the tape-device will be built]) fi AM_CONDITIONAL(WANT_TAPE_DEVICE, test -n "$want_tape_device") # # Check for various "mt status" related structure elements. # AC_MSG_CHECKING([for mt_flags mtget structure element]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ struct mtget buf; long ds; ds = buf.mt_flags; ]])],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MT_FLAGS,1, [Define if the mtget structure has an mt_flags field]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([for mt_fileno mtget structure element]) mt_fileno_result="found" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ struct mtget buf; long ds; ds = buf.mt_fileno; ]])],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MT_FILENO,1, [Define if the mtget structure has an mt_fileno field]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for mt_blkno mtget structure element) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ struct mtget buf; long ds; ds = buf.mt_blkno; ]])],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MT_BLKNO,1, [Define if the mtget structure has an mt_blkno field]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for mt_dsreg mtget structure element) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ struct mtget buf; long ds; ds = buf.mt_dsreg; ]])],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MT_DSREG,1, [Define if the mtget structure has an mt_dsreg field]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for mt_erreg mtget structure element) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ struct mtget buf; long ds; ds = buf.mt_erreg; ]])],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MT_ERREG,1, [Define if the mtget structure has an mt_erreg field]) ],[ AC_MSG_RESULT(no) ]) case "$host" in *linux*) AC_DEFINE(DEFAULT_TAPE_NON_BLOCKING_OPEN,1, [Define if open of tape device require O_NONBLOCK]);; esac ]) amanda-3.3.6/config/amanda/bsdudp-security.m40000664000076400007640000000200012357250007022507 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_BSDUDP_SECURITY # # OVERVIEW # # Handle configuration for BSDUDP security, implementing the # --with-bsdudp-security option. # # Defines and substitutes BSDUDP_SECURITY, and sets AM_CONDITIONAL # WANT_BSDUDP_SECURITY, if the user has selected this mechanism. # AC_DEFUN([AMANDA_BSDUDP_SECURITY], [ BSDUDP_SECURITY="no" AC_ARG_WITH(bsdudp-security, AS_HELP_STRING([--with-bsdudp-security], [include BSDUDP authentication]), [ case "$withval" in n | no) : ;; y | ye | yes) BSDUDP_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsdudp-security.]) ;; esac ], ) if test "x$BSDUDP_SECURITY" = "xyes"; then AC_DEFINE(BSDUDP_SECURITY,1, [Define if BSDUDP transport should be enabled.]) fi AM_CONDITIONAL(WANT_BSDUDP_SECURITY, test x"$BSDUDP_SECURITY" = x"yes") AC_SUBST(BSDUDP_SECURITY) ]) amanda-3.3.6/config/amanda/i18n.m40000664000076400007640000000134412357250007020152 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SETUP_I18N # # OVERVIEW # # Set up Amanda's internationalization support. Note that configure.in # itself must contain (not indented): # # AM_GNU_GETTEXT_VERSION([0.15]) # AM_GNU_GETTEXT([external]) # AC_DEFUN([AMANDA_SETUP_I18N], [ # FreeBSD needs to link libxpg4 AC_CHECK_LIB(xpg4, setlocale) # ------------------------------------------------------------------ # All list of languages for which a translation exist. Each # language is separated by a space. # ------------------------------------------------------------------ ALL_LINGUAS="" AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(MSGFMT, msgfmt,,$LOCSYSPATH) AC_PATH_PROG(GETTEXT,gettext,,$LOCSYSPATH) ]) amanda-3.3.6/config/amanda/summary.m40000664000076400007640000000251112357250007021065 0ustar00martineamartinea00000000000000# OVERVIEW/BACKGROUND # # This file creates an end-of-run summary of the Amanda configuration. # # SYNOPSIS # # AMANDA_INIT_SUMMARY() # # DESCRIPTION # # Set up for producing a summary. This should be called early in the configure # process # AC_DEFUN([AMANDA_INIT_SUMMARY], [ # initialize warnings file rm -f config.warnings ]) # SYNOPSIS # # AMANDA_MSG_WARN() # # DESCRIPTION # # Like AC_MSG_WARN, but also adds the message to the summary # AC_DEFUN([AMANDA_MSG_WARN], [ AC_MSG_WARN([$1]) AMANDA_ADD_WARNING([$1]) ]) # SYNOPSIS # # AMANDA_ADD_WARNING_QUOTED(warning-text) #if text already quoted # AMANDA_ADD_WARNING(warning-text) #if text not quoted # # DESCRIPTION # # Add the given text to the warnings summary # AC_DEFUN([AMANDA_ADD_WARNING_QUOTED], [ cat <>config.warnings $1 AAW_EOF]) AC_DEFUN([AMANDA_ADD_WARNING], [ AMANDA_ADD_WARNING_QUOTED([_AS_QUOTE([$1])]) ]) # SYNOPSIS # # AMANDA_SHOW_SUMMARY() # # DESCRIPTION # # Output the configuration summary. # AC_DEFUN([AMANDA_SHOW_SUMMARY], [ AMANDA_SHOW_FLAGS_SUMMARY AMANDA_SHOW_COMPONENTS_SUMMARY AMANDA_SHOW_IPV6_SUMMARY AMANDA_SHOW_DOCUMENTATION_SUMMARY AMANDA_SHOW_DIRS_SUMMARY if test -f config.warnings; then echo "WARNINGS:" cat config.warnings | sed -e 's/^/ /g' rm config.warnings fi ]) amanda-3.3.6/config/amanda/version.m40000664000076400007640000000576612357250007021074 0ustar00martineamartinea00000000000000# Amanda version handling macros # SYNOPSIS # # AMANDA_INIT_VERSION # # DESCRIPTION # # Create a macro, AMANDA_F_VERSION using only m4 which can expand # legally before AC_INIT. AC_INIT requires the version to be a # string not a shell variable. Include FULL_VERSION if it exists, otherwise # use VERSION. -I dirs are searched for FULL_VERSION and VERSION. # AC_DEFUN([AMANDA_INIT_VERSION], [ m4_syscmd([test -f FULL_VERSION]) m4_if(m4_sysval, [0], [ m4_define([AMANDA_F_VERSION], m4_chomp(m4_include([FULL_VERSION]))) ], [ m4_define([AMANDA_F_VERSION], m4_chomp(m4_include([VERSION]))) ]) VERSION=AMANDA_F_VERSION ]) AC_DEFUN([AMANDA_VERSION], [ AMANDA_GET_SVN_INFO AMANDA_GET_GIT_INFO AC_MSG_NOTICE("version: $VERSION") ]) # SYNOPSIS # # AMANDA_SNAPSHOT_STAMP # # DESCRIPTION # # If srcdir contains a file named SNAPSHOT, with a line matching # Snapshot Date: [0-9]* # then set add the date to VERSION and set # SNAPSHOT_STAMP=SNAPSHOT. # AC_DEFUN([AMANDA_SNAPSHOT_STAMP], [ if test -f "$srcdir/SNAPSHOT"; then cat < "$srcdir/SNAPSHOT" changequote(,) snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT` changequote([,]) test -z "$snapdate" || VERSION="$VERSION-$snapdate" SNAPSHOT_STAMP=SNAPSHOT else SNAPSHOT_STAMP= fi AC_SUBST(SNAPSHOT_STAMP) ]) # SYNOPSIS # # AMANDA_SPLIT_VERSION # # DESCRIPTION # # Set the version number of this release of Amanda from the VERSION # string, which is set in AC_INIT. Sets VERSION_MAJOR, # VERSION_MINOR, VERSION_PATCH, and VERSION_COMMENT to the # corresponding components of VERSION. These four variables are # also AC_DEFINE'd # AC_DEFUN([AMANDA_SPLIT_VERSION], [ changequote(,) VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'` VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'` if test -z "$VERSION_MINOR"; then VERSION_MINOR=0 VERSION_PATCH=0 VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\(.*\)'`\" else VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` if test -z "$VERSION_PATCH"; then VERSION_PATCH=0 VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\(.*\)'`\" else VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\" fi fi changequote([,]) AC_SUBST(VERSION_MAJOR) AC_SUBST(VERSION_MINOR) AC_SUBST(VERSION_PATCH) AC_SUBST(VERSION_COMMENT) AC_DEFINE_UNQUOTED([VERSION_MAJOR], [$VERSION_MAJOR], [major Amanda version number]) AC_DEFINE_UNQUOTED([VERSION_MINOR], [$VERSION_MINOR], [minor Amanda version number]) AC_DEFINE_UNQUOTED([VERSION_PATCH], [$VERSION_PATCH], [Amanda patch number]) AC_DEFINE_UNQUOTED([VERSION_COMMENT], [$VERSION_COMMENT], [Amanda version information beyond patch]) ]) # SYNOPSIS # # AMANDA_WITH_SUFFIXES # # DESCRIPTION # # Deprectated --with-suffixes option. # AC_DEFUN([AMANDA_WITH_SUFFIXES], [ AC_ARG_WITH(suffixes, [], [ AMANDA_MSG_WARN([** --with-suffixes is deprecated]) ]) ]) amanda-3.3.6/config/amanda/userid.m40000664000076400007640000001254612357250007020674 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_DISABLE_INSTALLPERMS # # OVERVIEW # # Handle the --disable-installperms option, which disables all post-install # chown/chmod operations. This is useful when packaging, as most packaging # systems build as non-root, and apply permissions in the post-install step of # the package itself. # AC_DEFUN([AMANDA_DISABLE_INSTALLPERMS], [ WANT_INSTALLPERMS=yes AC_ARG_ENABLE(installperms, AS_HELP_STRING([--disable-installperms], [do not modify ownership and permissions on installed files]), [ WANT_INSTALLPERMS="$enableval" ], [ WANT_INSTALLPERMS="yes" ] ) AM_CONDITIONAL(WANT_INSTALLPERMS, test x"$WANT_INSTALLPERMS" = x"yes") ]) # SYNOPSIS # # AMANDA_WITH_FORCE_UID # # OVERVIEW # # Handle the --without-force-id option, which disables userid checks for # all Amanda applications. Defines and substitutes CHECK_USERID *unless* # this option is given, and also sets AM_CONDITIONAL CHECK_USERID # AC_DEFUN([AMANDA_WITH_FORCE_UID], [ AC_ARG_WITH(force-uid, AS_HELP_STRING([--without-force-uid], [do not check userids when running programs]), CHECK_USERID="$withval", : ${CHECK_USERID=yes} ) case "$CHECK_USERID" in y | ye | yes) CHECK_USERID=1 AC_DEFINE(CHECK_USERID, 1, [Define to force to another user on client machines. ]) ;; n | no) : CHECK_USERID= ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.]) esac AC_SUBST(CHECK_USERID) AM_CONDITIONAL(CHECK_USERID, test x"$CHECK_USERID" = x"1") ]) # SYNOPSIS # # AMANDA_WITH_USER # # OVERVIEW # # Handle the --with-user option, which sets the userid Amanda expects to run # under. Defines and substitutes CLIENT_LOGIN. # AC_DEFUN([AMANDA_WITH_USER], [ AC_ARG_WITH(user, AS_HELP_STRING([--with-user=USER], [force execution to USER on client systems (REQUIRED)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-user option.]) ;; *) CLIENT_LOGIN="$withval" ;; esac ], [ AMANDA_MSG_WARN([[no user specified (--with-user) -- using 'amanda']]) CLIENT_LOGIN=amanda ] ) AC_DEFINE_UNQUOTED(CLIENT_LOGIN,"$CLIENT_LOGIN", [Define as a the user to force to on client machines. ]) AC_SUBST(CLIENT_LOGIN) ]) # SYNOPSIS # # AMANDA_WITH_GROUP # # OVERVIEW # # Handle the --with-group option, which sets the groupid Amanda expects to run # under. Substitutes (but does not define) SETUID_GROUP. # AC_DEFUN([AMANDA_WITH_GROUP], [ AC_ARG_WITH(group, AS_HELP_STRING([--with-group=GROUP], [group allowed to execute setuid-root programs (REQUIRED)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-group option.]) ;; *) SETUID_GROUP="$withval" ;; esac ], [ AMANDA_MSG_WARN([[no group specified (--with-group) -- using 'backup']]) SETUID_GROUP=backup ] ) AC_SUBST(SETUID_GROUP) ]) # SYNOPSIS # # AMANDA_WITH_OWNER # # OVERVIEW # # Handle the --with-owner option, which sets the userid the 'make install' process # will use. Substitutes and defines BINARY_OWNER. # AC_DEFUN([AMANDA_WITH_OWNER], [ AC_REQUIRE([AMANDA_WITH_USER]) AC_ARG_WITH(owner, AS_HELP_STRING([--with-owner=USER] [force ownership of installed files to USER (default same as --with-user)]), [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-owner option.]) ;; *) BINARY_OWNER="$withval" ;; esac ], [ BINARY_OWNER="$CLIENT_LOGIN" ] ) AC_DEFINE_UNQUOTED(BINARY_OWNER,"$BINARY_OWNER", [Define as the user who owns installed binaries. ]) AC_SUBST(BINARY_OWNER) ]) # SYNOPSIS # # AMANDA_WITH_SINGLE_USERID # # OVERVIEW # # Check if this system is one on which clients should be built setuid, # Sets up AM_CONDITIONAL/define WANT_SETUID_CLIENT and defines # SINGLE_USERID if either the system requires it or the user specified it. # AC_DEFUN([AMANDA_WITH_SINGLE_USERID], [ SINGLE_USERID=${SINGLE_USERID:-no} WANT_SETUID_CLIENT=${WANT_SETUID_CLIENT:-true} AC_ARG_WITH(single-userid, AS_HELP_STRING([--with-single-userid] [force amanda to run as a single userid (for testing)]), [ SINGLE_USERID=$withval ]) case "$host" in *-pc-cygwin) WANT_SETUID_CLIENT=false SINGLE_USERID=yes ;; esac if test x"$WANT_SETUID_CLIENT" = x"true"; then AC_DEFINE(WANT_SETUID_CLIENT,1, [Define if clients should be built setuid-root]) fi AM_CONDITIONAL(WANT_SETUID_CLIENT, test x"$WANT_SETUID_CLIENT" = x"true") if test x"$SINGLE_USERID" = x"yes"; then AC_DEFINE(SINGLE_USERID, 1, [Define if all of Amanda will run as a single userid (e.g., on Cygwin or for installchecks)]) fi ]) amanda-3.3.6/config/amanda/progs.m40000664000076400007640000002616712357250007020537 0ustar00martineamartinea00000000000000# OVERVIEW # # Code to handle searches for programs Amanda needs. # # Because Amanda uses a customized search path, many macros which are standard # in autoconf have been wrapped here. Where this is the only change, the description # of those macros has been omitted. # # All of these macros indicate their requirements using AC_REQUIRE, so the order in # which they are called in configure.in is inconsequential. # SYNOPSIS # # AMANDA_INIT_PROGS # # OVERVIEW # # Set up some amanda-specific path directories. This should be AC_REQUIRE()d by # any macros which need to search for a program. # # SYSPATH is a list of likely system locations for a file, while # LOCPATH is a list of likely local locations. The two are combined # in different orders in SYSLOCPATH and LOCSYSPATH. These path differences # are known to affect Solaris 8. # AC_DEFUN([AMANDA_INIT_PROGS], [ SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/sfw/bin:/usr/bsd:/etc:/usr/etc" # expand prefix or exec_prefix in LOCPATH LOCPATH=`( test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=${prefix} eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin" )` SYSLOCPATH="$SYSPATH:$LOCPATH" LOCSYSPATH="$LOCPATH:$SYSPATH" ]) # SYNOPSIS # # AMANDA_PROG_LINT # # OVERVIEW # # Find a lint binary (either lint or splint) and record its name in AMLINT. # Set up appropriate flags for the discovered binary in AMLINTFLAGS # AC_DEFUN([AMANDA_PROG_LINT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_REQUIRE([AMANDA_PROG_GREP]) AC_PATH_PROG(AMLINT,lint,,/opt/SUNWspro/bin:$SYSLOCPATH) if test ! -z "$AMLINT"; then $AMLINT -flags 2>&1 | $GREP -- '-errfmt=' > /dev/null if test $? -eq 0; then AMLINTFLAGS="-n -s -u -m -x" AMLINTFLAGS="$AMLINTFLAGS -errchk=%all" AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro" AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include" AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user" AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended" AMLINTFLAGS="$AMLINTFLAGS -errtags=yes" AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all" AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2" AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED" AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET" AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT" AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT" AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT" AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION" AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE" AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT" AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR" AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED" AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0" AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1" AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2" AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD" AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD" AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF" AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF" AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL" AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP" AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW" AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL" AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN" AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT" AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL" AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE" AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F" else AMLINTFLAGS="" fi else AC_PATH_PROG(AMLINT,splint,,$SYSLOCPATH) if test ! -z "$AMLINT"; then AMLINT="splint" AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' else AMLINT='echo "Error: LINT is not installed" ; false' AMLINTFLAGS='' fi fi AC_SUBST(AMLINTFLAGS) ]) # SYNOPSIS # # AMANDA_PROG_LPR # # OVERVIEW # # Search for a binary for printing, usually either 'lp' or 'lpr', and put its # path in LPR. # # LPRFLAG is substituted as the appropriate command-line flag to use # to select a printer; either -P or -d. # AC_DEFUN([AMANDA_PROG_LPR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(LPR, lpr lp) if test ! -z "$LPR"; then AC_DEFINE([HAVE_LPR_CMD], [1], [Set to 1 if an LPR command was found at configure time]) AC_CACHE_CHECK([which flag to use to select a printer], amanda_cv_printer_flag, [ amanda_cv_printer_flag=$LPRFLAG case "$LPR" in lpr|*/lpr) amanda_cv_printer_flag="-P";; lp|*/lp) amanda_cv_printer_flag="-d";; esac ]) if test ! -z "$amanda_cv_printer_flag"; then LPRFLAG=$amanda_cv_printer_flag else AMANDA_MSG_WARN([WARNING: amanda will always print to the default printer]) fi fi AC_SUBST([LPR]) AC_SUBST([LPRFLAG]) ]) # SYNOPSIS # # AMANDA_PROG_GNUPLOT # # OVERVIEW # # Search for a 'gnuplot' binary, placing the result in the precious # variable GNUPLOT. Also accepts --with-gnuplot to indicate the location # of the binary. # AC_DEFUN([AMANDA_PROG_GNUPLOT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_ARG_WITH(gnuplot, AS_HELP_STRING([--with-gnuplot=PATH], [use gnuplot executable at PATH in amplot]), [ case "$withval" in y | ye | yes) : ;; n | no) GNUPLOT=no ;; *) GNUPLOT="$withval" ;; esac ]) if test "x$GNUPLOT" = "xno"; then GNUPLOT= else AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH) fi AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary]) AC_SUBST(GNUPLOT) ]) ## simple macros needing no description; some add AC_DEFINE_UNQUOTED AC_DEFUN([AMANDA_PROG_GREP], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(GREP,grep,grep,$LOCSYSPATH) AC_DEFINE_UNQUOTED(GREP,"$GREP", [Define the location of the grep program. ]) ]) AC_DEFUN([AMANDA_PROG_CAT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(CAT,cat,cat,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_COMPRESS], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(COMPRESS,compress,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_DD], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(DD,dd,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_GETCONF], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(GETCONF,getconf,,$SYSPATH) ]) AC_DEFUN([AMANDA_PROG_GZIP], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(GZIP,gzip,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_SORT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_REQUIRE([AMANDA_CHECK_COMPONENTS]) AC_PATH_PROG(SORT,sort,NONE,$LOCSYSPATH) # sort is only needed in the server build if test x"$SORT" = x"NONE" && $WANT_SERVER; then AC_MSG_ERROR([Set SORT to the path of the sort program.]) fi AC_DEFINE_UNQUOTED(SORT_PATH,"$SORT", [Define to the exact path to the sort program. ]) ]) AC_DEFUN([AMANDA_PROG_MAILER], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(MAILER,Mail mailx mail,NONE) if test x"$MAILER" = x"NONE"; then AMANDA_MSG_WARN([WARNING: Amanda cannot send mail reports without a mailer.]) DEFAULT_MAILER="" else DEFAULT_MAILER="$MAILER" fi AC_DEFINE_UNQUOTED(DEFAULT_MAILER,"$DEFAULT_MAILER", [A program that understands -s "subject" user < message_file]) AC_SUBST(DEFAULT_MAILER) ]) # SYNOPSIS # # AMANDA_PROG_MT # # OVERVIEW # # Find and SUBST 'mt', and additionally calculate the proper flag to use # to identify the tape device (usually -f) and DEFINE and SUBST that value # as MT_FILE_FLAG. # AC_DEFUN([AMANDA_PROG_MT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(MT,mt,mt,$SYSLOCPATH) case "$host" in *-hp-*) MT_FILE_FLAG="-t" ;; *) MT_FILE_FLAG="-f" ;; esac AC_SUBST(MT_FILE_FLAG) AC_DEFINE_UNQUOTED(MT_FILE_FLAG, "$MT_FILE_FLAG", [The switch to be used when invoking mt to specify the * tape device. ]) ]) AC_DEFUN([AMANDA_PROG_MTX], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(MTX,mtx,mtx,$LOCSYSPATH) AC_ARG_VAR([MTX], [Path to the 'mtx' binary]) ]) AC_DEFUN([AMANDA_PROG_MOUNT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(MOUNT,mount,mount,$LOCSYSPATH) AC_ARG_VAR([MOUNT], [Path to the 'mount' binary]) ]) AC_DEFUN([AMANDA_PROG_UMOUNT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(UMOUNT,umount,umount,$LOCSYSPATH) AC_ARG_VAR([UMOUNT], [Path to the 'umount' binary]) ]) AC_DEFUN([AMANDA_PROG_UNAME], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(UNAME,uname,,$LOCSYSPATH) AC_DEFINE_UNQUOTED(UNAME_PATH,"$UNAME", [Define the location of the uname program. ]) ]) AC_DEFUN([AMANDA_PROG_PCAT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(PCAT,pcat,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_PERL], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(PERL,perl5 perl,,$LOCSYSPATH) AC_ARG_VAR([PERL], [Path to the 'perl' binary]) AC_PROG_PERL_VERSION([5.6.0], [], [ AC_MSG_ERROR([Amanda requires at least perl 5.6.0]) ]) ]) AC_DEFUN([AMANDA_PROG_SWIG], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(SWIG,swig,,$LOCSYSPATH) AC_ARG_VAR([SWIG], [Path to the 'swig' binary (developers only)]) # 1.3.32 introduces a change in the way empty strings are handled (old versions # returned undef in Perl, while new versions return an empty Perl string) # 1.3.39 is required for the %begin block AC_PROG_SWIG([1.3.39]) ]) AC_DEFUN([AMANDA_PROG_AR], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(AR,ar,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_BASH], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(BASH,bash,,$SYSPATH) ]) AC_DEFUN([AMANDA_PROG_SSH], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH) AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary]) ]) AC_DEFUN([AMANDA_PROG_GETTEXT], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(GETTEXT,gettext,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_RPCGEN], [ AC_REQUIRE([AMANDA_INIT_PROGS]) AC_PATH_PROG(RPCGEN,rpcgen,,$LOCSYSPATH) ]) AC_DEFUN([AMANDA_PROG_LEX], [ AC_REQUIRE([AM_PROG_LEX]) AC_REQUIRE([AMANDA_PROG_GREP]) if test x"$LEX" != x""; then AC_MSG_CHECKING([whether lex is broken Solaris (SGU) lex]) $LEX -V < /dev/null >/dev/null 2>conftest.out if grep SGU conftest.out >/dev/null; then AC_MSG_RESULT([yes - disabled (set LEX=/path/to/lex to use a specific binary)]) LEX='echo no lex equivalent available; false' else AC_MSG_RESULT([no]) fi rm conftest.out fi ]) AC_DEFUN([AMANDA_PROG_NC], [ AC_PATH_PROG(NC,nc,,$LOCSYSPATH) AC_PATH_PROG(NC6,nc6,,$LOCSYSPATH) AC_PATH_PROG(NETCAT,netcat,,$LOCSYSPATH) ]) amanda-3.3.6/config/amanda/socklen_t_equiv.m40000664000076400007640000000301312357250007022560 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SOCKLEN_T_EQUIV # # OVERVIEW # # Find a type which will work like socklen_t should. Unfortunately, # HP/UX systems define socklen_t, but use int * as the result parameter # for socket functions returning a socket length. # # This check defines a type socklen_t_equiv which is of the appropriate # size to be used with socket functions. # AC_DEFUN([AMANDA_SOCKLEN_T_EQUIV], [ ## lifted from config/gnulib/socklen.m4 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl AC_MSG_CHECKING([for socklen_t equivalent]) AC_CACHE_VAL([gl_cv_socklen_t_equiv], [# Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername gl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in socklen_t int size_t "unsigned int" "long int" "unsigned long int"; do AC_TRY_COMPILE( [#include #include int getpeername (int, $arg2 *, $t *);], [$t len; getpeername (0, 0, &len);], [gl_cv_socklen_t_equiv="$t"]) test "$gl_cv_socklen_t_equiv" != "" && break done test "$gl_cv_socklen_t_equiv" != "" && break done ]) ## end lifting from config/gnulib/socklen.m4 # fallback if the check fails if test "$gl_cv_socklen_t_equiv" = ""; then gl_cv_socklen_t_equiv=socklen_t fi AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) AC_DEFINE_UNQUOTED([socklen_t_equiv], [$gl_cv_socklen_t_equiv], [type to use for socket length parameters; use instead of socklen_t]) ]) amanda-3.3.6/config/amanda/ssh-security.m40000664000076400007640000000503212357250007022033 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SSH_SECURITY # # OVERVIEW # # Handle configuration for SSH security, implementing the --with-ssh-security # option and checking for the relevant programs and options. Defines and substitutes # SSH_SECURITY, searches for and defines SSH, and defines SSH_OPTIONS. # AC_DEFUN([AMANDA_SSH_SECURITY], [ SSH_SECURITY=yes AC_ARG_WITH(ssh-security, AS_HELP_STRING([--with-ssh-security], [include SSH authentication]), [ case "$withval" in n | no) SSH_SECURITY=no ;; y | ye | yes) SSH_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.]) ;; esac ], ) if test "x$SSH_SECURITY" = "xyes"; then # find the SSH binary AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH) # see what options we should use AC_ARG_WITH(ssh-options, AS_HELP_STRING([ --with-ssh-options=@<:@OPTIONS@:>@], [Use these ssh options for ssh security; the default should work]), [ SSH_OPTIONS="$withval" ], [ SSH_OPTIONS='' ] ) case "$SSH_OPTIONS" in y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to --with-ssh-options.]);; *) : ;; esac AC_MSG_CHECKING([SSH options]) # if we didn't get SSH options from the user, figure them out for ourselves if test -z "$SSH_OPTIONS"; then case `$SSH -V 2>&1` in OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';; *) SSH_OPTIONS='-x -o BatchMode=yes' ;; esac fi # now convert that to a comma-separated list of C strings eval "set dummy ${SSH_OPTIONS}"; shift SSH_OPTIONS='' for i in "${@}"; do quoted="\"`echo "$i" | sed -e 's/\"/\\\"/'`\"" SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }$quoted"; done AC_MSG_RESULT($SSH_OPTIONS) # finally, make the various outputs for all of this AC_DEFINE(SSH_SECURITY,1, [Define if SSH transport should be enabled. ]) AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary]) AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS, [Arguments to ssh]) fi AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY" = x"yes") AC_SUBST(SSH_SECURITY) # (note -- don't just substitute SSH_OPTIONS -- shell quoting will break) ]) amanda-3.3.6/config/amanda/flock.m40000664000076400007640000000754612357250007020503 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SETUP_FILE_LOCKING # # OVERVIEW # # Set up file locking support. Four locking mechanisms are available: # POSIX_FCNTL - use fcntl(). The full job. # FLOCK - use flock(). Does just as well. # LOCKF - use lockf(). Only handles advisory, exclusive, # blocking file locks as used by Amanda. # LNLOCK - Home brew exclusive, blocking file lock. # # For the chosen method, WANT_AMFLOCK_mech is defined and set up as an # AM_CONDITIONAL. Also, LOCKING, which contains the mechanism, is substituted. # AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], [ AC_CHECK_HEADERS( fcntl.h \ sys/fcntl.h \ sys/types.h \ sys/file.h \ unistd.h \ ) # find a working file-locking mechanism. # Note: these all use AC_TRY_LINK to make sure that we can compile # and link each variant. They do not try to test the variants -- # that is left to runtime. LOCKING="no" # check POSIX locking AC_CACHE_CHECK( [whether POSIX locking (with fcntl(2)) is available], amanda_cv_posix_filelocking, [ AC_TRY_LINK([ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_UNISTD_H # include #endif #if HAVE_FCNTL_H # include #endif ], [ struct flock lock; lock.l_type = F_RDLCK; lock.l_start = 0; lock.l_whence = SEEK_CUR; lock.l_len = 0; return fcntl(1, F_SETLK, &lock); ], [ amanda_cv_posix_filelocking="yes" ],[ amanda_cv_posix_filelocking="no" ]) ]) if test "x$amanda_cv_posix_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_POSIX,1,[Define to use POSIX (fcntl()) for file locking]) WANT_AMFLOCK_POSIX="yes" LOCKING="POSIX_FCNTL" fi AM_CONDITIONAL(WANT_AMFLOCK_POSIX, test x"$WANT_AMFLOCK_POSIX" = x"yes") # check flock-based (BSD) locking AC_CACHE_CHECK( [whether flock locking is available], amanda_cv_flock_filelocking, [ AC_TRY_LINK([ #if HAVE_SYS_FILE_H # include #endif ], [ return flock(1, LOCK_SH); ], [ amanda_cv_flock_filelocking="yes" ],[ amanda_cv_flock_filelocking="no" ]) ]) if test "x$amanda_cv_flock_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_FLOCK,1,[Define to use flock(2) for file locking]) WANT_AMFLOCK_FLOCK="yes" LOCKING="FLOCK" fi AM_CONDITIONAL(WANT_AMFLOCK_FLOCK, test x"$WANT_AMFLOCK_FLOCK" = x"yes") # check lockf-based (SVR2, SVR3, SVR4) locking AC_CACHE_CHECK( [whether lockf(3) locking is available], amanda_cv_lockf_filelocking, [ AC_TRY_LINK([ #if HAVE_UNISTD_H # include #endif ], [ return lockf(1, F_LOCK, 0); ], [ amanda_cv_lockf_filelocking="yes" ],[ amanda_cv_lockf_filelocking="no" ]) ]) if test "x$amanda_cv_lockf_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_LOCKF,1,[Define to use lockf(3) for file locking.]) WANT_AMFLOCK_LOCKF="yes" LOCKING="LOCKF" fi AM_CONDITIONAL(WANT_AMFLOCK_LOCKF, test x"$WANT_AMFLOCK_LOCKF" = x"yes") # check our homebrew hardlink-based locking (requires hardlinks) AC_CACHE_CHECK( [whether link(2) is available for locking], amanda_cv_lnlock_filelocking, [ AC_TRY_LINK([ #if HAVE_UNISTD_H # include #endif ], [ return link("/tmp/foo", "/tmp/bar"); ], [ amanda_cv_lnlock_filelocking="yes" ],[ amanda_cv_lnlock_filelocking="no" ]) ]) if test "x$amanda_cv_lnlock_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_LNLOCK,1,[Define to use link(2) to emulate file locking.]) WANT_AMFLOCK_LNLOCK="yes" LOCKING="LNLOCK" fi AM_CONDITIONAL(WANT_AMFLOCK_LNLOCK, test x"$WANT_AMFLOCK_LNLOCK" = x"yes") if test x"$LOCKING" = "no"; then # this shouldn't happen, and is *bad* if it does AC_MSG_ERROR([*** No working file locking capability found!]) fi AC_SUBST(LOCKING) ]) amanda-3.3.6/config/amanda/amplot.m40000664000076400007640000000257012357250007020671 0ustar00martineamartinea00000000000000# OVERVIEW # # 'amplot' is largely pieced together by the instantiation phase of # configure; that is handled here. # SYNOPSIS # # AMANDA_SETUP_AMPLOT # # DESCRIPTION # # Check for the requirements for amplot, and set the Automake conditional # WANT_AMPLOT appropriately. If amplot is to be built, then also set up # the required substitutions to build it correctly. # AC_DEFUN([AMANDA_SETUP_AMPLOT], [ AC_REQUIRE([AMANDA_PROG_GNUPLOT]) AC_REQUIRE([AMANDA_PROG_PCAT]) AC_REQUIRE([AMANDA_PROG_COMPRESS]) AC_REQUIRE([AMANDA_PROG_GZIP]) AC_REQUIRE([AC_PROG_AWK]) if test "x$GNUPLOT" != "x"; then WANT_AMPLOT=true # variable substitutions for amcat.awk if test "$PCAT"; then AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else" else AMPLOT_CAT_PACK= fi if test "$COMPRESS"; then AMPLOT_COMPRESS=$COMPRESS AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else" else AMPLOT_CAT_COMPRESS= fi if test "$GZIP"; then AMPLOT_COMPRESS=$GZIP AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else" else AMPLOT_CAT_GZIP= fi AC_SUBST(AMPLOT_COMPRESS) AC_SUBST(AMPLOT_CAT_GZIP) AC_SUBST(AMPLOT_CAT_COMPRESS) AC_SUBST(AMPLOT_CAT_PACK) else WANT_AMPLOT=false AMANDA_MSG_WARN([Not building 'amplot', because gnuplot was not found]) fi AM_CONDITIONAL(WANT_AMPLOT, test x"$WANT_AMPLOT" = x"true") ]) amanda-3.3.6/config/amanda/syshacks.m40000664000076400007640000000477612357250007021237 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SYSHACKS # # OVERVIEW # # This macro encapsulates any system-specific hacks required to make Amanda # compile that don't fit neatly into any other macro. It is implemented as a # big 'case' statement based on the canonical target architecture. # # It also serves as a list of the "supported" architectures, represented by # case statements with empty bodies. If no architecture matches, the user # is presented with a warning. # AC_DEFUN([AMANDA_SYSHACKS], [ case "$host" in *-dec-osf*) ;; *-dg-*) ;; *-netbsd*) ;; *-freebsd*) ;; *-openbsd*) ;; *-hp-*) case "$CC" in *gcc*) AMANDA_ADD_CPPFLAGS([-D__STDC_EXT__]) ;; *cc*) AMANDA_ADD_CFLAGS([-Ae]) ;; esac ;; *-ibm-aix*) ;; m88k-motorola-sysv4) ;; *-nextstep3) ;; *-pc-bsdi*) ;; *-pc-linux-*) ;; *-redhat-linux-*) ;; *-suse-linux-*) ;; x86_64-*-linux-*) ;; alpha*-*-linux-*) ;; sparc*-*-linux-*) ;; s390x-*-linux-*) ;; powerpc-*-linux-*) ;; *-sgi-irix3*) # The old cc won't work! if test "x$GCC" != "xyes"; then AC_MSG_ERROR([The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc]) fi ;; *-sgi-irix4*) ;; *-sgi-irix5*) ;; *-sgi-irix6*) ;; *-solaris2*) ;; *-sun-sunos4.1*) ;; *-ultrix*) ;; *-sysv4.2uw2*) ;; *-sco3.2v5*) ;; i386-pc-isc4*) ;; *-sni-sysv4) ;; *-pc-cygwin) AC_DEFINE(IGNORE_TAR_ERRORS,1,[Define on Cygwin. ]) # Cygwin needs PATH to find cygwin1.dll AC_DEFINE(NEED_PATH_ENV,1,[Define on Cygwin. ]) AC_DEFINE(IGNORE_FSTAB,1,[Define on Cygwin. ]) AMANDA_ADD_LDFLAGS([-Wl,-enable-runtime-pseudo-reloc -no-undefined]) ;; *-apple-darwin7*) # MacOS X 10.3.* (Panther) ;; *-apple-darwin8*) # MacOS X 10.4.* (Tiger) ;; *-apple-darwin9*) # MacOS X 10.5.* (Leopard) ;; *-apple-darwin10*) # MacOS X 10.6.* (Snow Leopard) ;; *) AMANDA_ADD_WARNING( [***** This machine, target type $host, is not known to be fully supported by this configure script. If the installation of Amanda on this system succeeds or needed any patches, please email amanda-hackers@amanda.org with the patches or an indication of the sucess or failure of the Amanda installation on your system. *****]) ;; esac ]) amanda-3.3.6/config/amanda/debugging.m40000664000076400007640000001147712357250007021336 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_WITH_ASSERTIONS # # OVERVIEW # # Handles the --with-assertions flag. Defines and substitutes ASSERTIONS # if the flag is given. # AC_DEFUN([AMANDA_WITH_ASSERTIONS], [ ASSERTIONS= AC_ARG_WITH(assertions, AS_HELP_STRING([--with-assertions], [compile assertions into code]), [ case "$withval" in n | no) : ;; y | ye | yes) ASSERTIONS=1 AC_DEFINE(ASSERTIONS,1, [Define if you want assertion checking. ]) ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.]) ;; esac ] ) AC_SUBST(ASSERTIONS) ]) # SYNOPSIS # # AMANDA_WITH_DEBUGGING # # OVERVIEW # # Handles the --with[out]-debugging flag. If debugging is not disabled, then define # DEBUG_CODE, and define and substitute AMANDA_DBGDIR to either the location the # user gave, or AMANDA_TMPDIR. # AC_DEFUN([AMANDA_WITH_DEBUGGING], [ AC_REQUIRE([AMANDA_WITH_TMPDIR]) AC_ARG_WITH(debugging, AS_HELP_STRING([--with-debugging=DIR] [put debug logs in DIR (default same as --with-tmpdir)]), [ debugging="$withval" ], [ debugging="yes" ] ) case "$debugging" in n | no) AC_MSG_ERROR([Amanda no longer supports building with debugging disabled]);; y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";; *) AMANDA_DBGDIR="$debugging";; esac # evaluate any extra variables in the directory AC_DEFINE_DIR([AMANDA_DBGDIR], [AMANDA_DBGDIR], [Location of Amanda directories and files. ]) ]) # SYNOPSIS # # AMANDA_GLIBC_BACKTRACE # # OVERVIEW # # Check for glibc's backtrace support, and define HAVE_GLIBC_BACKTRACE if it is present. AC_DEFUN([AMANDA_GLIBC_BACKTRACE], [ AC_CHECK_HEADER([execinfo.h], [ AC_CHECK_FUNC([backtrace_symbols_fd], [ AC_DEFINE(HAVE_GLIBC_BACKTRACE, 1, [Define this if glibc's backtrace functionality (execinfo.h) is present]) ]) ]) ]) # SYNOPSIS # # AMANDA_WITH_DEBUG_DAYS # # OVERVIEW # # Handles the --with-debug-days flag. Defines and substitutes AMANDA_DEBUG_DAYS. # AC_DEFUN([AMANDA_WITH_DEBUG_DAYS], [ AC_ARG_WITH(debug_days, AS_HELP_STRING([--with-debug-days=NN], [number of days to keep debugging files (default: 4)]), [ debug_days="$withval" ], [ debug_days="yes" ] ) case "$debug_days" in n | no) AMANDA_DEBUG_DAYS=0 ;; y | ye | yes) AMANDA_DEBUG_DAYS=4 ;; [[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]]) AMANDA_DEBUG_DAYS="$debug_days" ;; *) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.]) ;; esac AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS, [Number of days to keep debugging files. ]) AC_SUBST(AMANDA_DEBUG_DAYS) ]) # SYNOPSIS # # AMANDA_WITH_TESTING # # OVERVIEW # # Handles the --with-testing flag. Defines and substitutes SERVICE_SUFFIX, and # defines AMANDA_SERVICE_NAME and KAMANDA_SERVICE_NAME. # AC_DEFUN([AMANDA_WITH_TESTING], [ AC_ARG_WITH(testing, AS_HELP_STRING([--with-testing@<:@=SUFFIX@:>@], [use alternate service names with suffix (default 'test')]), [ TESTING="$withval" ], [ TESTING="no" ] ) case "$TESTING" in n | no) SERVICE_SUFFIX="";; y | ye | yes) SERVICE_SUFFIX="-test";; *) SERVICE_SUFFIX="-$TESTING";; esac AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX" KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX" AC_SUBST(SERVICE_SUFFIX) AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX", [A suffix that will be appended to service names. * Useful for testing in parallel with a working version. ]) AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME, "$AMANDA_SERVICE_NAME", [The name for the Amanda service. ]) AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME", [The name for the Kerberized Amanda service. ]) ]) # SYNOPSIS # # AMANDA_ENABLE_SYNTAX_CHECKS # # OVERVIEW # # Handles the --enable-syntax-checks flag, which triggers syntax checks # for most 'make' targets, but causes spurious errors in all but the most # carefully-constructed build environments. AC_DEFUN([AMANDA_DISABLE_SYNTAX_CHECKS], [ AC_ARG_ENABLE(syntax-checks, AS_HELP_STRING([--enable-syntax-checks], [Perform syntax checks when installing - developers only]), [ case "$enableval" in no) SYNTAX_CHECKS=false;; *) SYNTAX_CHECKS=true AMANDA_MSG_WARN([--enable-syntax-checks can cause build failures and should only be used by developers]) ;; esac ], [ SYNTAX_CHECKS=false ]) AM_CONDITIONAL(SYNTAX_CHECKS, $SYNTAX_CHECKS) ]) amanda-3.3.6/config/amanda/getfsent.m40000664000076400007640000000043412357250007021211 0ustar00martineamartinea00000000000000# SYNOPSIS # # AMANDA_SETUP_GETFSENT # # OVERVIEW # # Checks for support for client-src/getfsent.c # AC_DEFUN([AMANDA_SETUP_GETFSENT], [ AC_CHECK_HEADERS( fstab.h \ mntent.h \ mnttab.h \ sys/vfstab.h \ ) AC_CHECK_FUNCS(endmntent) AC_CHECK_FUNCS(setmntent) ]) amanda-3.3.6/config/missing0000775000076400007640000002557712357250007017325 0ustar00martineamartinea00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -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 # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/set_full_version0000775000076400007640000000461512357250007021224 0ustar00martineamartinea00000000000000#!/bin/bash # # This script is run by autogen to create the FULL_VERSION file. # # If run from a git branch, it append '.git.' + git sha1 to the VERSION file. # If run from a svn branch, it append '.svn.' + svn number to the VERSION file. # If run from a svn tag that match /rc/ it use only the tag name to set the # VERSION, this is done specifically for zmanda rc build. # If run from a svn tag that doesn't match /rc/ it use only the VERSION file. # # It is important to update the VERSION file before creating a tag. # # ./autogen run config/set_full_version, it create the FULL_VERSION file. # ./configure use the FULL_VERSION file. # srcdir=$1 if test -d .svn; then svn info . > conftemp.svn else echo "" > conftemp.svn fi if test -d .svn && ( grep Revision: conftemp.svn > /dev/null; ); then #if grep Revision: conftemp.svn > /dev/null ; then SVN_REV=`grep Revision: conftemp.svn|cut -d: -f 2|cut -c2-` SVN_URL=`grep URL: conftemp.svn|cut -d: -f 2-|cut -c2-` SVN_PATH=`grep URL: conftemp.svn|cut -d "/" -f 7-` SVN_TYPE=`echo ${SVN_PATH} |cut -d "/" -f 1` SVN_BRANCH=`echo "${SVN_PATH}"| cut -d "/" -f 2` url=`grep URL: conftemp.svn|cut -d: -f 2-|cut -c2-` fi if test -d .git; then GIT_SHA1=`git rev-parse HEAD | cut -c -8 ` fi if test -f FULL_VERSION; then FULL_VERSION_FILE="FULL_VERSION" OLD_VERSION=`cat $FULL_VERSION_FILE` else if test -n "$srcdir" -a -f $srcdir/FULL_VERSION; then FULL_VERSION_FILE="$srcdir/FULL_VERSION" OLD_VERSION=`cat $FULL_VERSION_FILE` else FULL_VERSION_FILE="FULL_VERSION" OLD_VERSION= fi fi if test -n "$srcdir"; then VERSION_FILE="$srcdir/VERSION" else VERSION_FILE="VERSION" fi VERSION=`cat $VERSION_FILE` if test -n "$SVN_REV"; then if test "${SVN_TYPE}" = "branches"; then VERSION=${VERSION}.svn.${SVN_REV} else if test "${SVN_TYPE}" = "trunk"; then VERSION=${VERSION}.svn.${SVN_REV} else RC=`echo "${SVN_BRANCH}"| grep "rc"` if test -n "$RC"; then VERSION=`echo "${SVN_BRANCH}"| sed 's/[^0-9]*// ; s/[_.]//g'` VERSION=`echo ${VERSION}| sed 's/^\([0-9]\)\([0-9]\)\([0-9]\)/\1.\2.\3/'` fi fi fi else if test -n "$GIT_SHA1"; then VERSION=${VERSION}".git."${GIT_SHA1} else if test -n "$OLD_VERSION"; then VERSION=$OLD_VERSION fi fi fi if test "$VERSION" != "$OLD_VERSION" -o $VERSION_FILE -nt FULL_VERSION; then echo "$VERSION" > FULL_VERSION fi amanda-3.3.6/config/install-sh0000775000076400007640000003246412357250007017723 0ustar00martineamartinea00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # 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_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done 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 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 trap '(exit $?); exit' 1 2 13 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 starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: amanda-3.3.6/config/automake/0000775000076400007640000000000012357750426017526 5ustar00martineamartinea00000000000000amanda-3.3.6/config/automake/vars.am0000664000076400007640000000214612357250007021011 0ustar00martineamartinea00000000000000# vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = amanda-3.3.6/config/automake/scripts.am0000664000076400007640000001547512357250007021536 0ustar00martineamartinea00000000000000# vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ if SYNTAX_CHECKS @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ rm $@.nouselib; \ else \ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ fi endif %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # config.status leaves config.log files around CLEANFILES += config.log # and we'll need to clean up our generated files for distclean DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) $(SCRIPTS_INCLUDE) # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi if SYNTAX_CHECKS check-local: check-perl endif # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi if SYNTAX_CHECKS check-local: check-shell endif # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts amanda-3.3.6/config/automake/precompile.am0000664000076400007640000000061712357250007022176 0ustar00martineamartinea00000000000000# vim:ft=automake # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< amanda-3.3.6/config/automake/file-list0000664000076400007640000000030012357750226021330 0ustar00martineamartinea00000000000000## this file is automatically generated by autogen EXTRA_DIST += automake/installperms.am EXTRA_DIST += automake/precompile.am EXTRA_DIST += automake/scripts.am EXTRA_DIST += automake/vars.am amanda-3.3.6/config/automake/installperms.am0000664000076400007640000000765412357250007022564 0ustar00martineamartinea00000000000000# vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs=s|^.*/|| # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. if WANT_INSTALLPERMS do_file=pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ if test -n "$$chown"; then \ echo chown "$$chown" "$$pa"; \ chown "$$chown" "$$pa" || exit 1; \ fi; \ if test -n "$$chmod"; then \ echo chmod "$$chmod" "$$pa"; \ chmod "$$chmod" "$$pa" || exit 1; \ fi else installperms_sh="$(top_builddir)/installperms.sh" do_file=pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" DISTCLEANFILES += $(installperms_sh) endif do_installperms=dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file if WANT_INSTALLPERMS installperms-init: else installperms-init: rm -f "$(installperms_sh)" endif amanda-3.3.6/config/ltoptions.m40000664000076400007640000002725612357250007020217 0ustar00martineamartinea00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) amanda-3.3.6/config/config.sub0000775000076400007640000010115312357250007017672 0ustar00martineamartinea00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: amanda-3.3.6/config/lt~obsolete.m40000664000076400007640000001375612357250007020536 0ustar00martineamartinea00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) amanda-3.3.6/aclocal.m40000664000076400007640000016164012357750234016320 0ustar00martineamartinea00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 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_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. 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'.])]) # Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, dnl gthread, or gio is specified in MODULES, pass to pkg-config dnl AC_DEFUN([AM_PATH_GLIB_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; gio*) pkg_config_args="$pkg_config_args $module-2.0" ;; esac done PKG_PROG_PKG_CONFIG([0.7]) no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { unsigned int major, minor, micro; char *tmp_version; fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GOBJECT_QUERY) AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 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[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # 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]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- 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`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- 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 ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # 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 $1]) _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 "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$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]) ]) 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 .]) ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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.11' 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.11.6], [], [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.11.6])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, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], 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 8's {/usr,}/bin/sh. touch 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])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], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [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([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl 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 ]) 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, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_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) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # 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, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_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, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([config/macro-archive/ac_define_dir.m4]) m4_include([config/macro-archive/ac_perl_module_version.m4]) m4_include([config/macro-archive/ac_prog_perl_version.m4]) m4_include([config/macro-archive/ac_prog_swig.m4]) m4_include([config/macro-archive/ax_compare_version.m4]) m4_include([config/macro-archive/docbook-dtd.m4]) m4_include([config/macro-archive/docbook-xslt-min.m4]) m4_include([config/macro-archive/docbook-xslt.m4]) m4_include([config/macro-archive/xsltproc.m4]) m4_include([config/amanda/amplot.m4]) m4_include([config/amanda/as_needed.m4]) m4_include([config/amanda/bsd-security.m4]) m4_include([config/amanda/bsdtcp-security.m4]) m4_include([config/amanda/bsdudp-security.m4]) m4_include([config/amanda/components.m4]) m4_include([config/amanda/compress.m4]) m4_include([config/amanda/config.m4]) m4_include([config/amanda/debugging.m4]) m4_include([config/amanda/defaults.m4]) m4_include([config/amanda/devprefix.m4]) m4_include([config/amanda/dirs.m4]) m4_include([config/amanda/documentation.m4]) m4_include([config/amanda/dumpers.m4]) m4_include([config/amanda/dvdrw-device.m4]) m4_include([config/amanda/flags.m4]) m4_include([config/amanda/flock.m4]) m4_include([config/amanda/funcs.m4]) m4_include([config/amanda/getfsent.m4]) m4_include([config/amanda/i18n.m4]) m4_include([config/amanda/ipv6.m4]) m4_include([config/amanda/krb5-security.m4]) m4_include([config/amanda/lfs.m4]) m4_include([config/amanda/libs.m4]) m4_include([config/amanda/ndmp-device.m4]) m4_include([config/amanda/net.m4]) m4_include([config/amanda/progs.m4]) m4_include([config/amanda/ps.m4]) m4_include([config/amanda/readdir.m4]) m4_include([config/amanda/readline.m4]) m4_include([config/amanda/rsh-security.m4]) m4_include([config/amanda/s3-device.m4]) m4_include([config/amanda/socklen_t_equiv.m4]) m4_include([config/amanda/ssh-security.m4]) m4_include([config/amanda/summary.m4]) m4_include([config/amanda/swig.m4]) m4_include([config/amanda/syshacks.m4]) m4_include([config/amanda/tape.m4]) m4_include([config/amanda/types.m4]) m4_include([config/amanda/userid.m4]) m4_include([config/amanda/version.m4]) m4_include([config/gnulib/00gnulib.m4]) m4_include([config/gnulib/alloca.m4]) m4_include([config/gnulib/arpa_inet_h.m4]) m4_include([config/gnulib/base64.m4]) m4_include([config/gnulib/btowc.m4]) m4_include([config/gnulib/configmake.m4]) m4_include([config/gnulib/eealloc.m4]) m4_include([config/gnulib/environ.m4]) m4_include([config/gnulib/errno_h.m4]) m4_include([config/gnulib/euidaccess.m4]) m4_include([config/gnulib/exponentd.m4]) m4_include([config/gnulib/extensions.m4]) m4_include([config/gnulib/extern-inline.m4]) m4_include([config/gnulib/fcntl-o.m4]) m4_include([config/gnulib/fcntl_h.m4]) m4_include([config/gnulib/float_h.m4]) m4_include([config/gnulib/fseek.m4]) m4_include([config/gnulib/fseeko.m4]) m4_include([config/gnulib/fstat.m4]) m4_include([config/gnulib/fsusage.m4]) m4_include([config/gnulib/ftell.m4]) m4_include([config/gnulib/ftello.m4]) m4_include([config/gnulib/ftruncate.m4]) m4_include([config/gnulib/getaddrinfo.m4]) m4_include([config/gnulib/getgroups.m4]) m4_include([config/gnulib/getopt.m4]) m4_include([config/gnulib/gettimeofday.m4]) m4_include([config/gnulib/gnulib-common.m4]) m4_include([config/gnulib/gnulib-comp.m4]) m4_include([config/gnulib/group-member.m4]) m4_include([config/gnulib/hostent.m4]) m4_include([config/gnulib/include_next.m4]) m4_include([config/gnulib/inet_ntop.m4]) m4_include([config/gnulib/inet_pton.m4]) m4_include([config/gnulib/intmax_t.m4]) m4_include([config/gnulib/langinfo_h.m4]) m4_include([config/gnulib/largefile.m4]) m4_include([config/gnulib/localcharset.m4]) m4_include([config/gnulib/locale-fr.m4]) m4_include([config/gnulib/locale-ja.m4]) m4_include([config/gnulib/locale-zh.m4]) m4_include([config/gnulib/locale_h.m4]) m4_include([config/gnulib/localeconv.m4]) m4_include([config/gnulib/lock.m4]) m4_include([config/gnulib/longlong.m4]) m4_include([config/gnulib/lseek.m4]) m4_include([config/gnulib/lstat.m4]) m4_include([config/gnulib/malloc.m4]) m4_include([config/gnulib/mbrtowc.m4]) m4_include([config/gnulib/mbsinit.m4]) m4_include([config/gnulib/mbstate_t.m4]) m4_include([config/gnulib/mbtowc.m4]) m4_include([config/gnulib/memchr.m4]) m4_include([config/gnulib/mkdtemp.m4]) m4_include([config/gnulib/mmap-anon.m4]) m4_include([config/gnulib/msvc-inval.m4]) m4_include([config/gnulib/msvc-nothrow.m4]) m4_include([config/gnulib/multiarch.m4]) m4_include([config/gnulib/netdb_h.m4]) m4_include([config/gnulib/netinet_in_h.m4]) m4_include([config/gnulib/nl_langinfo.m4]) m4_include([config/gnulib/nocrash.m4]) m4_include([config/gnulib/off_t.m4]) m4_include([config/gnulib/pathmax.m4]) m4_include([config/gnulib/physmem.m4]) m4_include([config/gnulib/printf.m4]) m4_include([config/gnulib/raise.m4]) m4_include([config/gnulib/read.m4]) m4_include([config/gnulib/regex.m4]) m4_include([config/gnulib/safe-read.m4]) m4_include([config/gnulib/safe-write.m4]) m4_include([config/gnulib/secure_getenv.m4]) m4_include([config/gnulib/servent.m4]) m4_include([config/gnulib/signal_h.m4]) m4_include([config/gnulib/snprintf.m4]) m4_include([config/gnulib/socketlib.m4]) m4_include([config/gnulib/sockets.m4]) m4_include([config/gnulib/socklen.m4]) m4_include([config/gnulib/sockpfaf.m4]) m4_include([config/gnulib/ssize_t.m4]) m4_include([config/gnulib/stat.m4]) m4_include([config/gnulib/stdalign.m4]) m4_include([config/gnulib/stdbool.m4]) m4_include([config/gnulib/stddef_h.m4]) m4_include([config/gnulib/stdint.m4]) m4_include([config/gnulib/stdio_h.m4]) m4_include([config/gnulib/stdlib_h.m4]) m4_include([config/gnulib/string_h.m4]) m4_include([config/gnulib/sys_socket_h.m4]) m4_include([config/gnulib/sys_stat_h.m4]) m4_include([config/gnulib/sys_time_h.m4]) m4_include([config/gnulib/sys_types_h.m4]) m4_include([config/gnulib/sys_uio_h.m4]) m4_include([config/gnulib/tempname.m4]) m4_include([config/gnulib/threadlib.m4]) m4_include([config/gnulib/time_h.m4]) m4_include([config/gnulib/unistd_h.m4]) m4_include([config/gnulib/vasnprintf.m4]) m4_include([config/gnulib/warn-on-use.m4]) m4_include([config/gnulib/wchar_h.m4]) m4_include([config/gnulib/wcrtomb.m4]) m4_include([config/gnulib/wctype_h.m4]) m4_include([config/gnulib/write.m4]) m4_include([config/gettext-macros/codeset.m4]) m4_include([config/gettext-macros/gettext.m4]) m4_include([config/gettext-macros/glibc21.m4]) m4_include([config/gettext-macros/iconv.m4]) m4_include([config/gettext-macros/inttypes_h.m4]) m4_include([config/gettext-macros/lib-ld.m4]) m4_include([config/gettext-macros/lib-link.m4]) m4_include([config/gettext-macros/lib-prefix.m4]) m4_include([config/gettext-macros/nls.m4]) m4_include([config/gettext-macros/po.m4]) m4_include([config/gettext-macros/progtest.m4]) m4_include([config/gettext-macros/size_max.m4]) m4_include([config/gettext-macros/stdint_h.m4]) m4_include([config/gettext-macros/wchar_t.m4]) m4_include([config/gettext-macros/wint_t.m4]) m4_include([config/gettext-macros/xsize.m4]) m4_include([config/libtool.m4]) m4_include([config/ltoptions.m4]) m4_include([config/ltsugar.m4]) m4_include([config/ltversion.m4]) m4_include([config/lt~obsolete.m4]) amanda-3.3.6/ReleaseNotes0000664000076400007640000004411412357250010016753 0ustar00martineamartinea00000000000000 Release Notes for amanda-3.3.6 * ambsdtar o new application that use BSD tar to do the backup. * Many bugs fix. Release Notes for amanda-3.3.5 * amtape o faster 'verify' command. * fix parsing of config override arguments. * amsamba o Add REGEX-MATCH property. * amvault o Print progress status. * ndmp device o INDIRECT property default to yes. * Many bugs fix. Release Notes for amanda-3.3.4 * amreport o new --format argument o new 'json' and 'json_raw' format. * amanda.conf o new REPORT-FORMAT option. * amtape o new 'verify' command. * amadmin o new 'force-level-1' command. * ampgsql o Add VERBOSE property. * S3 device o handle DURABLE_REDUCED_AVAILABILITY for google storage. * Many bugs fix. Release Notes for amanda-3.3.3 * amdump.X log files use timestamp instead of number, amdump and amdump.1 are maintained as symlink. * chg-disk o Use the changerfile for the statefile. * s3 device o support CASTOR storage * amanda.conf o New REPORT-USE-MEDIA and REPORT-NEXT-MEDIA. * amfetchdump o new --extract, --directory, --data-path and --application-property arguments. It allow to do the extraction on the server. * --exact-match argument to many command, and '=' prefix to expression. o It diable use of expression for host, disk, level and datestamp on command line argument. * All changer scripts. o Add LOCK-TIMEOUT property. * Many bug fix. Release Notes for amanda-3.3.2 * amgtar o New IGNORE-ZEROS property. * amsamba o Fix use of subdir for restore. * s3 device o New PROXY property. o New PASSWORD, USERNAME, TENANT_ID, TENANT_NAME properties. o New STORAGE_API property. o New S3_MULTI_DELETE property o New CLIENT_ID, CLIENT_SECRET and REFRESH_TOKEN properties. o New CREATE-BUCKET property. o New PROJECT-ID property. o New REUSE-CONNECTION property. o Works with swift and google storage. * NDMP device o Add INDIRECT property. * amanda.conf o Add 'max-warnings', The maximum number of warning lines in the report. o Default 'columspec' changed to: HostName=0:-12:12,Disk=1:-11:11,Level=1:-1:1,OrigKB=1:-7:0,OutKB=1:-7:0,Compress=1:-6:1,DumpTime=1:-7:7,Dumprate=1:-6:1,TapeTime=1:-6:6,TapeRate=1:-6:1 * amadmin o Add --no-default and --print-source arguments for config and disklist command. * amfetchdump o Print progress. o Add --decrypt, --no-decrypt, --server-decrypt, --client-decrypt, --compress, --no-compress, --server-compress and --client-compress options. * fix for compilation with newer glib. * fix for compilation on cigwin. * Many bug fix. Release Notes for amanda-3.3.1 * amrecover o New 'settransalte' command. * amanda.conf o new '$s' substitution in autolabel. o new 'max-dle-by-volume' global option. o new 'eject-volume' global option. * diskfile o new 'includefile' option * amcheck o new '--client-verbose' argument. * All programs have a new '--version' argument. * ampgsql can take property from server configuration. * amgetconf can print one property of a section. * s3 device o new S3_SERVER_SIDE_ENCRYPTION property. o use multiple thread to speedup deleting a volume. * Many bug fix. Release Notes for amanda-3.3.0 * The default auth is changed to "bsdtcp", if you are using the default bsd then you must add it to your configuration. o in amanda.conf o in amanda-client.conf o in dumptype/disklist o in xinetd (if no '-auth' argument to amandad) * amdump trap crtl-c, it still send the report and do cleanup if you do one crtl-c, do it more than once to abort the run. * s3 device o use multiple threads to speedup the transfer o can connect to eucalytus. o new NB_THREADS_BACKUP property o new NB_THREADS_RECOVERY property o new S3_HOST property o new S3_SERVICE_PATH property o new S3_SUBDOMAIN property * chg-aggregate: new changer that use other changer sequentially. * meta-volume * Add meta label in tapelist file * chg-disk: o support for removable disk o new NUM-SLOT property o new AUTO-CREATE-SLOT property o new REMOVABLE property o new MOUNT property o new UMOUNT property o new UMOUNT-LOCKFILE property o new UMOUNT-IDLE property * new taperscan algorithm: o oldest: this algorithm try to run through the volumes in the oldest order o lexical: this algorithm try to run through the volumes in the natural order * Change in amanda.conf o new meta-autolabel option o autolabel can include org, config, barcode, meta in the label o new client-name option in appication and script. * application and script in amanda-client.conf can be used to set default properties for application or script. * amlabel o The label argument is no longer required, an autolabel can be generated o new --meta option o new --barcode option o new --assign option * amgtar, amstar: The path must be specified, it will not works with a device. * amrecover: decompression and decryption are now done on the client if compression/encryption was done on the client. * amtape: inventory print the current slot * amanda.conf: o autoflush have value "no|yes|all" o script have single-execution setting. o Add pre-amcheck, post-amcheck, pre-estimate, post-estimate, pre-backup and post-backup to execute-on of script. o Add taperscan and interactivity section. o add 'server' value in recovery-limit. o add dump-limit in a dumptype. * amanda-client.conf o add amdump-server setting. * script are searched in $APPLICATION_DIR, $CONFIG_DIR//application and $CONFIG_DIR/application * amservice o add -s argument o is also installed on client * new amdumpd server service, if enable, it allow client to start a backup of itself. * new amdump_client program, it is use on client to start a backup of itself * implement restore command amzfs-sendrecv, it can be use with amrecover. Release Notes for amanda-3.2.2 * Do not restore the NUL padding bytes, some program fail with them. * Fix driver doing nothing if taper crash early. * Fix taperalog *FIT no going to second volume. * Fix amrestore '-p' not going to next file. * flush even if flush threshold are not met if it save tape space. * fix crash in amtrmidx due to memory leak. * amsamba use 'Use smbclient -TF' for restore. Release Notes for amanda-3.2.1 * barcode are added to the tapelist file. * Faster 'amadmin find', improve speed on many programs. * device-output-buffer-size default to a minimum of 4*block_size. * ssh auth use the client-port * Bug fixed o "Can't opendata output stream: Connection refused" bug. o Better handling of dump to tape. o Corrupted 'amdump' log file, amstatus not showing correct state. o Execute subprocess with the config overwrite. o tape-device allow to set LEOM. o Crash in robot changer. o Script output property are not sent to application. Release Notes for amanda-3.2.0 * Support for multiple simultaneous writes to storage devices o Can write to all available drives in parallel. o Works only with the new changer API. o Useful if two or more volumes are used in a single run. o dump direct to tape can be scheduled any time during the run, previously they were done sequencially after all dump to holding disk. o enabled with the new 'taper-parallel-write' configuration option. * Support for LEOM in storage devices o allows splitting without partial parts, saving space o much more efficient, since parts need not be cached on disk in most cases * new, simpler splitting commands in the tapetype section: part-size, part-cache-type, part-cache-dir, part-cache-max-size; see amanda.conf(5) for details * Amanda server configuration file changes (amanda.conf) o new configuration keyword: + taper-parallel-write -- How many drive amanda can write to in parallel. o deprecated configuration keywords: + amrecover_do_fsf + amrecover_check_label * the CONFIG parameter to amidxtaped is now required; this means that versions of amrecover older than 2.4.3 will be unable to recover from servers running Amanda-3.2 and later. * The new dumptype and global parameters 'recovery-limit' can be used to limit which hosts may recover from a particular DLE. See amanda.conf(5) and amanda-auth(7) for more information. * Several old changers have been removed - these changers will work with Amanda for the forseeable future, but are no longer included in the distribution. o chg-chio o chg-chs o chg-iomega o chg-juke o chg-mcutil o chg-mtx o chg-null (use the new "chg-null:") o chg-rait (use the new "chg-rait:{dev1,dev2}") o chg-rth o chg-scsi-chio o chg-scsi * Amdump change: o new '--no-taper' option to start the run in degraded mode * Amvault is much improved, but still experimental: o supports assembling split parts on the source volume and re-splitting them on the destination o supports filtering dumps with the same syntax as amfetchdump o a --fulls-only option skips all incremental dumps on the source o an --export option tries to move tertiary volumes to import/export slots when completed o command-line syntax has changed incompatibly; see manpage or 'amvault --help' * Rewritten and improved: o amoverview o amcheckdump Release Notes for amanda-3.1.0 config * The 'rawtapedev' keyword was removed, and the 'label_new_tapes' keyword was deprecated. * New warnings for dangerous splitting configurations changer We have many changers implementing the new changer API. The new changers are faster, more reliable, and have many new features. One new features is that the changer keeps track of which label is in which slot, allowing it to locate a tape faster. But with some changers (new chg-multi or chg-robot without a barcode), it doesn't get automaticaly notified if you change the volume in a slot. In this case, you must notify the changer of it with the 'amtape update' command: amtape DailySet1 update 3-8 amtape DailySet1 update 3-8= amtape DailySet1 update 3=DailySet-003 See amanda-changers(7) for more information. ndmp, dvdrw New Amanda devices - see amanda-devices(7) for more information. amsamba The default amandapass file for the amsamba application is $CONFIG_DIR/amandapass, but it is /etc/amandapass for program GNUTAR. Don't forget to move the file if you switch to the amsamba application. ampgsql, amsuntar, amraw New applications to back up PostgreSQL databases, Solaris systems, and raw device files, respectively. amtape Amtape's behavior has changed; see NEWS amrmtape Rewritten with new command-line interface; see NEWS amdevcheck New --label and --properties options give more information about device amreport New, more natural command-line interface (try 'amreport $config') Release Notes for amanda-2.6.1 amgtar, amstar, amsamba, amzfs-sendrecv Three new programs implementing application-api. Swithching from the program "GNUTAR" to the application "amgtar" have some advantage: - amgtar use by default the gtar --atime-preserve=system option, you must disable it if you gtar relase doesn't have that option. - Can be configured to cross filesystem. - Can be configured to not check the device number on newer gtar (--no-check-device of gtar). - You can configure error message from gtar you don't want to see in the report. amzfs-snapshot, script-email Two new scripts implementing script-api. The 'zfs-snapshot' script must be used only with the 'amgtar' application. amarchiver New program to manipulate file in amanda archive format. New perl Module: Application (perl utility functions for Applications) Archive (Perl access to the amanda archive library) Constants (perl access to build-time configuration values) MainLoop (Perl interface to the Glib MainLoop) Process (interface to process), used by amcleanup. Script (perl utility functions for Scripts) Tapelist (Manipulate the Amanda tapelist) Xfer (Xfer-api) Release Notes for amanda-2.6.0 amcheckdump New program written entirely in perl, it replaces 'amverify' and 'amveryfyrun' amcryptsimple, amgpgcrypt New encryption plugins based on gpg. amserverconfig, amaddclient New Initial Amanda configuration tools, these tools make assumptions, please see man page. Deprecated programs 'amverify' and 'amveryfyrun' are deprecated -- use amcheckdump. 'amdd' and 'ammt' are also deprecated. If you have scripts that use them, then you must rewrite them in perl using the new perl modules. Configure options --disable-shared doesn't work because perl modules require shared library. Instead, use --with-static-binaries to build staticailly linked binaries. --with-amlibdir, libraries are now installed in $amlibdir --without-amlibdir : amlibdir=$libdir --with-amlibdir=yes : amlibdir=$libdir/amanda (default value) --with-amlibdir=/path/to/libdir : amlibdir=/path/to/libdir --with-amlibexecdir, internal programs are installed in $amlibexecdir --without-amlibexecdir : amlibdir=$libexecdir --with-amlibexecdir=yes : amlibdir=$libexecdir/amanda (default value) --with-amlibexecdir=/path/to/libexecdir : amlibdir=/path/to/libexecdir --with-amperldir, Where to install perl modules --without-amperldir : amperldir=$amlibdir/perl --with-amperldir=yes : amperldir= $(perl installsitelib) (default value) --with-amperldir=/path/to/perldir : amperldir=/path/to/perldir Path changes Libraries are installed in $amlibdir (previously $libdir) Internal programs are installed in $amlibexecdir (previously $libexecdir) You must change your inetd/xinetd config for the new amandad path. The amandad path change affect rsh/ssh auth, amanda-2.6.0 installations will need to add an 'amandad_path' parameter to configuration files in order to talk to older versions of Amanda: amanda-2.6.0 client -> amanda-2.5.2 or earlier server: add 'amandad_path "/usr/libexec/amandad"' (or the appropriate path) to /etc/amanda/amanda-client.conf amanda-2.5.2 or earlier client -> amanda-2.6.0 server: add 'amandad_path "/usr/libexec/amanda/amandad"' (or the appropriate path) to /etc/amanda/amanda-client.conf amanda-2.6.0 server -> amanda-2.5.2 or earlier client: add 'amandad_path "/usr/libexec/amandad"' (or the appropriate path) to the dumptype amanda-2.5.2 or earlier server -> amanda-2.6.0 client: add 'amandad_path "/usr/libexec/amanda/amandad"' (or the appropriate path) to the dumptype The amandates files is now $localstatedir/amanda/amandates, previously it was /etc/amandates, this file must be created on all client. usetimestamps It now defaults to 'yes'. Glib glib is required to compile and run amanda. It is free and can be downloaded form http://www.gtk.org/download/ Device API The Device API is a complete rewrite of all tape-access functionality. To use the Device API, all devices must be specified by their full name, e.g., tape:/dev/nst0. Existing functionality is now available in the tape, file, and rait devices, and a new Amazon S3 backend named 's3' is also available. Perl Module Link directly to Amanda, to support writing Amanda applications in Perl Available Modules: Changer (Execute changer scripts) Cmdline (Parse command line argument) Config (Parse config files) Device (device-api) Debug (Write to debug files) Logfile (Parse log files) Tapefile (Parse tapelist file) Perl modules are installed in $amperldir local security driver (auth) Allows backups of the Amanda server without any need for network configuration, and similarly allows amrecover to work on the Amanda server without any network configuration. make installcheck Almost 200 unit tests are available, which should be run on an installed copy of Amanda. See http://wiki.zmanda.com/index.php/Testing for more information. flush-threshold-dumped, flush-threshold-scheduled, taperflush These three config options allow to better fill your tapes. They are what was known as the taperstart/taperflush feature. Release Notes for amanda-2.5.2 IPv6 IPv6 support is enabled by default if your OS support it, if your OS is not working correctly with IPV6, you can disable it at configure time with '--without-ipv6'. readblocksize This option is useful only if you configured amanda with a big '--with-maxtapeblocksize' and your hardware can't works with big block size. Release Notes for amanda-2.5.1 usetimestamps This new feature will record all dump with timestamp instead of datestamp, it will allow to do many dump in a day and recover easily anyone of them. If you use this features, you will not be able to downgrade to 2.5.0 or earlier. see the usetimestamps section of 'man amanda.conf' bsdudp/bsdtcp These are 2 new auth, they still use bsd authentification like bsd, but use less port. bsdudp is like bsd, it use udp for connecting to client but it will use only one tcp port for all data stream. bsdtcp use tcp to connect the to client and it's the only network connection use. It doesn't have the udp packet size limit, so you can have an unlimited number of DLE for a single host. amrecover use the security-api amrecover now use the security-api, You don't need to configure an amindexd and an amidxtaped services in your xinetd. amindexd and amidxtaped will be launched by amandad like any other services. You must do modification to your xinetd configuration and .amandahosts toi allow connection to amindexd and amidxtaped. new format of xinetd.d/amanda amandad get in arguments the list of services it can launch, you must add theses services in the server_args options. new format of .amandahosts You must append to each line the services this client can launch, the default is "amdump" See the AUTHORIZATION section of the amanda man page and the docs/howto-auth.txt amanda-3.3.6/xfer-src/0000775000076400007640000000000012357750426016204 5ustar00martineamartinea00000000000000amanda-3.3.6/xfer-src/dest-directtcp-listen.c0000664000076400007640000000760112357250004022551 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "sockaddr-util.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_directtcp_listen() references * it directly. */ GType xfer_dest_directtcp_listen_get_type(void); #define XFER_DEST_DIRECTTCP_LISTEN_TYPE (xfer_dest_directtcp_listen_get_type()) #define XFER_DEST_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListen) #define XFER_DEST_DIRECTTCP_LISTEN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListen const) #define XFER_DEST_DIRECTTCP_LISTEN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListenClass) #define IS_XFER_DEST_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_directtcp_listen_get_type ()) #define XFER_DEST_DIRECTTCP_LISTEN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListenClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestDirectTCPListen { XferElement __parent__; } XferDestDirectTCPListen; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferDestDirectTCPListenClass; /* * Implementation */ static gboolean start_impl( XferElement *elt) { elt->output_listen_addrs = elt->upstream->output_listen_addrs; return FALSE; } static void class_init( XferDestDirectTCPListenClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->start = start_impl; klass->perl_class = "Amanda::Xfer::Dest::DirectTCPListen"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_directtcp_listen_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestDirectTCPListenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestDirectTCPListen), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestDirectTCPListen", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_dest_directtcp_listen(void) { XferDestDirectTCPListen *self = (XferDestDirectTCPListen *) g_object_new(XFER_DEST_DIRECTTCP_LISTEN_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); return elt; } amanda-3.3.6/xfer-src/Makefile.in0000664000076400007640000021057512357750241020256 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda library. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) TESTS = xfer-test$(EXEEXT) noinst_PROGRAMS = $(am__EXEEXT_1) subdir = xfer-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibdir)" LTLIBRARIES = $(amlib_LTLIBRARIES) libamxfer_la_DEPENDENCIES = ../common-src/libamanda.la am_libamxfer_la_OBJECTS = dest-fd.lo dest-null.lo dest-buffer.lo \ dest-directtcp-connect.lo dest-directtcp-listen.lo \ element-glue.lo filter-xor.lo filter-process.lo \ source-random.lo source-fd.lo source-pattern.lo \ source-directtcp-connect.lo source-directtcp-listen.lo \ xfer-element.lo xfer.lo xmsg.lo libamxfer_la_OBJECTS = $(am_libamxfer_la_OBJECTS) libamxfer_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamxfer_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = xfer-test$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_xfer_test_OBJECTS = xfer-test.$(OBJEXT) xfer_test_OBJECTS = $(am_xfer_test_OBJECTS) xfer_test_DEPENDENCIES = ../common-src/libtestutils.la libamxfer.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamxfer_la_SOURCES) $(xfer_test_SOURCES) DIST_SOURCES = $(libamxfer_la_SOURCES) $(xfer_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done INCLUDES = -I$(top_srcdir)/gnulib \ -I$(top_srcdir)/device-src \ -I$(top_srcdir)/common-src AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) amlib_LTLIBRARIES = libamxfer.la LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) libamxfer_la_SOURCES = \ dest-fd.c \ dest-null.c \ dest-buffer.c \ dest-directtcp-connect.c \ dest-directtcp-listen.c \ element-glue.c \ filter-xor.c \ filter-process.c \ source-random.c \ source-fd.c \ source-pattern.c \ source-directtcp-connect.c \ source-directtcp-listen.c \ xfer-element.c \ xfer.c \ xmsg.c libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamxfer_la_LIBADD = \ ../common-src/libamanda.la noinst_HEADERS = \ amxfer.h \ element-glue.h \ xfer-element.h \ xfer.h \ xmsg.h xfer_test_SOURCES = xfer-test.c xfer_test_LDADD = \ ../common-src/libtestutils.la \ libamxfer.la all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xfer-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu xfer-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || 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)$(amlibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \ } uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \ done clean-amlibLTLIBRARIES: -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libamxfer.la: $(libamxfer_la_OBJECTS) $(libamxfer_la_DEPENDENCIES) $(EXTRA_libamxfer_la_DEPENDENCIES) $(libamxfer_la_LINK) -rpath $(amlibdir) $(libamxfer_la_OBJECTS) $(libamxfer_la_LIBADD) $(LIBS) 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 xfer-test$(EXEEXT): $(xfer_test_OBJECTS) $(xfer_test_DEPENDENCIES) $(EXTRA_xfer_test_DEPENDENCIES) @rm -f xfer-test$(EXEEXT) $(LINK) $(xfer_test_OBJECTS) $(xfer_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dest-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dest-directtcp-connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dest-directtcp-listen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dest-fd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dest-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/element-glue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-process.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-xor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-directtcp-connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-directtcp-listen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-fd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-pattern.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-random.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-element.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmsg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-amlibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-amlibLTLIBRARIES .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-amlibLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-amlibLTLIBRARIES install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook 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 uninstall uninstall-am uninstall-amlibLTLIBRARIES installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< # lint support lint: @echo $(LINT) $(libamxfer_la_SOURCES) @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamxfer_la_SOURCES) @echo $(LINT) $(genversion_SOURCES) @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES) listlibsrc: @ for p in $(libamxfer_la_SOURCES); do \ listlibsrcs="$$listlibsrcs `pwd`/$$p"; \ done; \ echo $$listlibsrcs >listlibsrc.output # 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: amanda-3.3.6/xfer-src/xmsg.c0000664000076400007640000000441212357250004017312 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* TODO: use glib chunk allocator */ /* * Methods */ XMsg * xmsg_new( XferElement *elt, xmsg_type type, int version) { XMsg *msg = g_new0(XMsg, 1); msg->elt = elt; msg->type = type; msg->version = version; /* messages hold a reference to the XferElement, to avoid dangling * pointers. */ g_object_ref((GObject *)elt); return msg; } void xmsg_free( XMsg *msg) { /* unreference the source */ g_object_unref((GObject *)msg->elt); /* and free any allocated attributes */ if (msg->repr) g_free(msg->repr); if (msg->message) g_free(msg->message); /* then free the XMsg itself */ g_free(msg); } char * xmsg_repr( XMsg *msg) { if (!msg) return "(nil)"; /* better safe than sorry */ /* this just shows the "header" fields for now */ if (!msg->repr) { char *typ = NULL; switch (msg->type) { case XMSG_INFO: typ = "INFO"; break; case XMSG_ERROR: typ = "ERROR"; break; case XMSG_DONE: typ = "DONE"; break; case XMSG_CANCEL: typ = "CANCEL"; break; case XMSG_PART_DONE: typ = "PART_DONE"; break; case XMSG_READY: typ = "READY"; break; default: typ = "**UNKNOWN**"; break; } msg->repr = vstrallocf("", msg, typ, xfer_element_repr(msg->elt), msg->version); } return msg->repr; } amanda-3.3.6/xfer-src/filter-xor.c0000664000076400007640000001162012357250004020426 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_filter_xor() references * it directly. */ GType xfer_filter_xor_get_type(void); #define XFER_FILTER_XOR_TYPE (xfer_filter_xor_get_type()) #define XFER_FILTER_XOR(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_filter_xor_get_type(), XferFilterXor) #define XFER_FILTER_XOR_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_filter_xor_get_type(), XferFilterXor const) #define XFER_FILTER_XOR_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_filter_xor_get_type(), XferFilterXorClass) #define IS_XFER_FILTER_XOR(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_filter_xor_get_type ()) #define XFER_FILTER_XOR_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_filter_xor_get_type(), XferFilterXorClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferFilterXor { XferElement __parent__; char xor_key; } XferFilterXor; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferFilterXorClass; /* * Utilities */ static void apply_xor( char *buf, size_t len, char xor_key) { size_t i; /* Apply XOR. This is a pretty sophisticated encryption algorithm! */ for (i = 0; i < len; i++) { buf[i] ^= xor_key; } } /* * Implementation */ static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferFilterXor *self = (XferFilterXor *)elt; char *buf; if (elt->cancelled) { /* drain our upstream only if we're expecting an EOF */ if (elt->expect_eof) { xfer_element_drain_buffers(XFER_ELEMENT(self)->upstream); } /* return an EOF */ *size = 0; return NULL; } /* get a buffer from upstream, xor it, and hand it back */ buf = xfer_element_pull_buffer(XFER_ELEMENT(self)->upstream, size); if (buf) apply_xor(buf, *size, self->xor_key); return buf; } static void push_buffer_impl( XferElement *elt, gpointer buf, size_t len) { XferFilterXor *self = (XferFilterXor *)elt; /* drop the buffer if we've been cancelled */ if (elt->cancelled) { amfree(buf); return; } /* xor the given buffer and pass it downstream */ if (buf) apply_xor(buf, len, self->xor_key); xfer_element_push_buffer(XFER_ELEMENT(self)->downstream, buf, len); } static void instance_init( XferElement *elt) { elt->can_generate_eof = TRUE; } static void class_init( XferFilterXorClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PULL_BUFFER, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_PUSH_BUFFER, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->push_buffer = push_buffer_impl; klass->pull_buffer = pull_buffer_impl; klass->perl_class = "Amanda::Xfer::Filter::Xor"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_filter_xor_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferFilterXorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferFilterXor), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferFilterXor", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_filter_xor( unsigned char xor_key) { XferFilterXor *xfx = (XferFilterXor *)g_object_new(XFER_FILTER_XOR_TYPE, NULL); XferElement *elt = XFER_ELEMENT(xfx); xfx->xor_key = xor_key; return elt; } amanda-3.3.6/xfer-src/element-glue.h0000664000076400007640000000373512357250004020733 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef ELEMENT_GLUE_H #define ELEMENT_GLUE_H #include #include #include "xfer-element.h" #include "amsemaphore.h" /* * Class declaration */ GType xfer_element_glue_get_type(void); #define XFER_ELEMENT_GLUE_TYPE (xfer_element_glue_get_type()) #define XFER_ELEMENT_GLUE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_element_glue_get_type(), XferElementGlue) #define XFER_ELEMENT_GLUE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_element_glue_get_type(), XferElementGlue const) #define XFER_ELEMENT_GLUE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_element_glue_get_type(), XferElementGlueClass) #define IS_XFER_ELEMENT_GLUE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_element_glue_get_type ()) #define XFER_ELEMENT_GLUE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_element_glue_get_type(), XferElementGlueClass) /* Constructor */ XferElement * xfer_element_glue(void); /* the mech pairs supported by this object */ extern xfer_element_mech_pair_t *xfer_element_glue_mech_pairs; #endif amanda-3.3.6/xfer-src/source-fd.c0000664000076400007640000000701612357250004020226 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_fd() references * it directly. */ GType xfer_source_fd_get_type(void); #define XFER_SOURCE_FD_TYPE (xfer_source_fd_get_type()) #define XFER_SOURCE_FD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_fd_get_type(), XferSourceFd) #define XFER_SOURCE_FD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_fd_get_type(), XferSourceFd const) #define XFER_SOURCE_FD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_fd_get_type(), XferSourceFdClass) #define IS_XFER_SOURCE_FD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_fd_get_type ()) #define XFER_SOURCE_FD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_fd_get_type(), XferSourceFdClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceFd { XferElement __parent__; } XferSourceFd; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferSourceFdClass; /* * Implementation */ static void class_init( XferSourceFdClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_READFD, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->perl_class = "Amanda::Xfer::Source::Fd"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_fd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceFdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceFd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceFd", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_source_fd( int fd) { XferSourceFd *self = (XferSourceFd *)g_object_new(XFER_SOURCE_FD_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); g_assert(fd >= 0); /* we read from a *copy* of this file descriptor, as the downstream element * will close output_fd on EOF */ g_assert(xfer_element_swap_output_fd(elt, dup(fd)) == -1); return elt; } amanda-3.3.6/xfer-src/source-directtcp-listen.c0000664000076400007640000001035512357250004023112 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "sockaddr-util.h" #include "amxfer.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_directtcp_listen() references * it directly. */ static GType xfer_source_directtcp_listen_get_type(void); #define XFER_SOURCE_DIRECTTCP_LISTEN_TYPE (xfer_source_directtcp_listen_get_type()) #define XFER_SOURCE_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_directtcp_listen_get_type(), XferSourceDirectTCPListen) #define XFER_SOURCE_DIRECTTCP_LISTEN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_directtcp_listen_get_type(), XferSourceDirectTCPListen const) #define XFER_SOURCE_DIRECTTCP_LISTEN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_directtcp_listen_get_type(), XferSourceDirectTCPListenClass) #define IS_XFER_SOURCE_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_directtcp_listen_get_type ()) #define XFER_SOURCE_DIRECTTCP_LISTEN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_directtcp_listen_get_type(), XferSourceDirectTCPListenClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceDirectTCPListen { XferElement __parent__; } XferSourceDirectTCPListen; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferSourceDirectTCPListenClass; /* * Implementation */ static gboolean start_impl( XferElement *elt) { /* this is really all we do -- copy the input addresses from our downstream * neighbor. This seems trivial, but downstream may be a glue element, which * means we get the listening socket for free. */ elt->input_listen_addrs = elt->downstream->input_listen_addrs; return FALSE; } static void instance_init( XferElement *elt) { elt->can_generate_eof = FALSE; } static void class_init( XferSourceDirectTCPListenClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->start = start_impl; klass->perl_class = "Amanda::Xfer::Source::DirectTCPListen"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_directtcp_listen_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceDirectTCPListenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceDirectTCPListen), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceDirectTCPListen", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_source_directtcp_listen(void) { XferSourceDirectTCPListen *xsr = (XferSourceDirectTCPListen *)g_object_new(XFER_SOURCE_DIRECTTCP_LISTEN_TYPE, NULL); XferElement *elt = XFER_ELEMENT(xsr); return elt; } amanda-3.3.6/xfer-src/dest-buffer.c0000664000076400007640000001234712357250004020550 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_buffer() references * it directly. */ GType xfer_dest_buffer_get_type(void); #define XFER_DEST_BUFFER_TYPE (xfer_dest_buffer_get_type()) #define XFER_DEST_BUFFER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_buffer_get_type(), XferDestBuffer) #define XFER_DEST_BUFFER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_buffer_get_type(), XferDestBuffer const) #define XFER_DEST_BUFFER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_buffer_get_type(), XferDestBufferClass) #define IS_XFER_DEST_BUFFER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_buffer_get_type ()) #define XFER_DEST_BUFFER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_buffer_get_type(), XferDestBufferClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestBuffer { XferElement __parent__; gsize max_size; gpointer buf; gsize len; gsize allocated; } XferDestBuffer; /* * Class definition */ typedef struct { XferElementClass __parent__; void (*get)(XferDestBuffer *self, gpointer *buf, gsize *size); } XferDestBufferClass; /* * Implementation */ static void get_impl( XferDestBuffer *self, gpointer *buf, gsize *size) { if (size) *size = self->len; if (buf) *buf = self->buf; } static void push_buffer_impl( XferElement *elt, gpointer buf, size_t len) { XferDestBuffer *self = (XferDestBuffer *)elt; if (!buf) return; /* make sure this isn't too much data */ if (self->max_size && self->len + len > self->max_size) { xfer_cancel_with_error(elt, _("illegal attempt to transfer more than %zd bytes"), self->max_size); wait_until_xfer_cancelled(elt->xfer); amfree(buf); return; } /* expand the buffer if necessary */ if (self->len + len > self->allocated) { gsize new_size = self->allocated * 2; if (new_size < self->len+len) new_size = self->len+len; if (self->max_size && new_size > self->max_size) new_size = self->max_size; self->buf = g_realloc(self->buf, new_size); self->allocated = new_size; } g_memmove(((guint8 *)self->buf)+self->len, buf, len); self->len += len; amfree(buf); } static void finalize_impl( GObject * obj_self) { XferDestBuffer *self = XFER_DEST_BUFFER(obj_self); if (self->buf) g_free(self->buf); self->buf = NULL; /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferDestBufferClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; selfc->get = get_impl; klass->push_buffer = push_buffer_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Dest::Buffer"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_buffer_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestBufferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestBuffer), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestBuffer", &info, 0); } return type; } void xfer_dest_buffer_get( XferElement *elt, gpointer *buf, gsize *size) { XferDestBufferClass *klass; g_assert(IS_XFER_DEST_BUFFER(elt)); klass = XFER_DEST_BUFFER_GET_CLASS(elt); klass->get(XFER_DEST_BUFFER(elt), buf, size); } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_dest_buffer( gsize max_size) { XferDestBuffer *self = (XferDestBuffer *)g_object_new(XFER_DEST_BUFFER_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); self->max_size = max_size; return elt; } amanda-3.3.6/xfer-src/Makefile.am0000664000076400007640000000312612357250004020225 0ustar00martineamartinea00000000000000# Makefile for Amanda library. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_srcdir)/gnulib \ -I$(top_srcdir)/device-src \ -I$(top_srcdir)/common-src AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) amlib_LTLIBRARIES = libamxfer.la LINT=$(AMLINT) LINTFLAGS=$(AMLINTFLAGS) libamxfer_la_SOURCES = \ dest-fd.c \ dest-null.c \ dest-buffer.c \ dest-directtcp-connect.c \ dest-directtcp-listen.c \ element-glue.c \ filter-xor.c \ filter-process.c \ source-random.c \ source-fd.c \ source-pattern.c \ source-directtcp-connect.c \ source-directtcp-listen.c \ xfer-element.c \ xfer.c \ xmsg.c libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamxfer_la_LIBADD = \ ../common-src/libamanda.la noinst_HEADERS = \ amxfer.h \ element-glue.h \ xfer-element.h \ xfer.h \ xmsg.h # automake-style tests TESTS = xfer-test noinst_PROGRAMS = $(TESTS) xfer_test_SOURCES = xfer-test.c xfer_test_LDADD = \ ../common-src/libtestutils.la \ libamxfer.la # lint support lint: @echo $(LINT) $(libamxfer_la_SOURCES) @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamxfer_la_SOURCES) @echo $(LINT) $(genversion_SOURCES) @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES) listlibsrc: @ for p in $(libamxfer_la_SOURCES); do \ listlibsrcs="$$listlibsrcs `pwd`/$$p"; \ done; \ echo $$listlibsrcs >listlibsrc.output amanda-3.3.6/xfer-src/filter-process.c0000664000076400007640000002427212357250004021303 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "event.h" #include "util.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_filter_process() references * it directly. */ GType xfer_filter_process_get_type(void); #define XFER_FILTER_PROCESS_TYPE (xfer_filter_process_get_type()) #define XFER_FILTER_PROCESS(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_filter_process_get_type(), XferFilterProcess) #define XFER_FILTER_PROCESS_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_filter_process_get_type(), XferFilterProcess const) #define XFER_FILTER_PROCESS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_filter_process_get_type(), XferFilterProcessClass) #define IS_XFER_FILTER_PROCESS(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_filter_process_get_type ()) #define XFER_FILTER_PROCESS_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_filter_process_get_type(), XferFilterProcessClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferFilterProcess { XferElement __parent__; gchar **argv; gboolean need_root; int pipe_err[2]; pid_t child_pid; GSource *child_watch; gboolean child_killed; } XferFilterProcess; /* * Class definition */ typedef struct { XferElementClass __parent__; int (*get_err_fd)(XferFilterProcess *elt); } XferFilterProcessClass; /* * Implementation */ static void child_watch_callback( pid_t pid, gint status, gpointer data) { XferFilterProcess *self = XFER_FILTER_PROCESS(data); XferElement *elt = (XferElement *)self; XMsg *msg; char *errmsg = NULL; g_assert(pid == self->child_pid); self->child_pid = -1; /* it's gone now.. */ if (WIFEXITED(status)) { int exitcode = WEXITSTATUS(status); g_debug("%s: process exited with status %d", xfer_element_repr(elt), exitcode); if (exitcode != 0) { errmsg = g_strdup_printf("%s exited with status %d", self->argv[0], exitcode); } } else if (WIFSIGNALED(status)) { int signal = WTERMSIG(status); if (signal != SIGKILL || !self->child_killed) { errmsg = g_strdup_printf("%s died on signal %d", self->argv[0], signal); g_debug("%s: %s", xfer_element_repr(elt), errmsg); } } if (errmsg) { msg = xmsg_new(XFER_ELEMENT(self), XMSG_INFO, 0); msg->message = g_strdup("ERROR"); xfer_queue_message(XFER_ELEMENT(self)->xfer, msg); } else { msg = xmsg_new(XFER_ELEMENT(self), XMSG_INFO, 0); msg->message = g_strdup("SUCCESS"); xfer_queue_message(XFER_ELEMENT(self)->xfer, msg); } /* if this is an error exit, send an XMSG_ERROR and cancel */ if (!elt->cancelled) { if (errmsg) { msg = xmsg_new(XFER_ELEMENT(self), XMSG_ERROR, 0); msg->message = errmsg; xfer_queue_message(XFER_ELEMENT(self)->xfer, msg); xfer_cancel(elt->xfer); } else if (elt->cancel_on_success) { xfer_cancel(elt->xfer); } } /* this element is as good as cancelled already, so fall through to XMSG_DONE */ xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); } static int get_err_fd_impl( XferFilterProcess *xfp) { return xfp->pipe_err[0]; } static gboolean start_impl( XferElement *elt) { XferFilterProcess *self = (XferFilterProcess *)elt; char *cmd_str; char **argv; char *errmsg; char **env; int rfd, wfd; /* first build up a log message of what we're going to do, properly shell quoted */ argv = self->argv; cmd_str = g_shell_quote(*(argv++)); while (*argv) { char *qarg = g_shell_quote(*(argv++)); cmd_str = newvstralloc(cmd_str, cmd_str, " ", qarg, NULL); g_free(qarg); } g_debug("%s spawning: %s", xfer_element_repr(elt), cmd_str); rfd = xfer_element_swap_output_fd(elt->upstream, -1); wfd = xfer_element_swap_input_fd(elt->downstream, -1); /* now fork off the child and connect the pipes */ switch (self->child_pid = fork()) { case -1: error("cannot fork: %s", strerror(errno)); /* NOTREACHED */ case 0: /* child */ /* first, copy our fd's out of the stdio range */ while (rfd <= STDERR_FILENO) rfd = dup(rfd); while (wfd <= STDERR_FILENO) wfd = dup(wfd); /* set up stdin, stdout, and stderr, overwriting anything already open * on those fd's */ dup2(rfd, STDIN_FILENO); dup2(wfd, STDOUT_FILENO); dup2(self->pipe_err[1], STDERR_FILENO); /* and close everything else */ safe_fd(-1, 0); env = safe_env(); if (self->need_root && !become_root()) { errmsg = g_strdup_printf("could not become root: %s\n", strerror(errno)); full_write(STDERR_FILENO, errmsg, strlen(errmsg)); exit(1); } execve(self->argv[0], self->argv, env); errmsg = g_strdup_printf("exec of '%s' failed: %s\n", self->argv[0], strerror(errno)); full_write(STDERR_FILENO, errmsg, strlen(errmsg)); exit(1); default: /* parent */ break; } g_free(cmd_str); /* close the pipe fd's */ close(rfd); close(wfd); close(self->pipe_err[1]); /* watch for child death */ self->child_watch = new_child_watch_source(self->child_pid); g_source_set_callback(self->child_watch, (GSourceFunc)child_watch_callback, self, NULL); g_source_attach(self->child_watch, NULL); g_source_unref(self->child_watch); return TRUE; } static gboolean cancel_impl( XferElement *elt, gboolean expect_eof) { XferFilterProcess *self = (XferFilterProcess *)elt; /* chain up first */ XFER_ELEMENT_CLASS(parent_class)->cancel(elt, expect_eof); /* if the process is running as root, we can't do anything but wait until * we get an upstream EOF, or downstream does something to trigger a * SIGPIPE */ if (self->need_root) return expect_eof; /* avoid the risk of SIGPIPEs by not killing the process if it is already * expecting an EOF */ if (expect_eof) { return expect_eof; } /* and kill the process, if it's not already dead; this will likely send * SIGPIPE to anything upstream. */ if (self->child_pid != -1) { g_debug("%s: killing child process", xfer_element_repr(elt)); if (kill(self->child_pid, SIGKILL) < 0) { /* log but ignore */ g_debug("while killing child process: %s", strerror(errno)); return FALSE; /* downstream should not expect EOF */ } /* make sure we don't send an XMSG_ERROR about this */ self->child_killed = 1; } return TRUE; /* downstream should expect an EOF */ } static void instance_init( XferElement *elt) { XferFilterProcess *self = (XferFilterProcess *)elt; /* we can generate an EOF *unless* the process is running as root */ elt->can_generate_eof = !self->need_root; self->argv = NULL; self->child_pid = -1; self->child_killed = FALSE; } static void finalize_impl( GObject * obj_self) { XferFilterProcess *self = XFER_FILTER_PROCESS(obj_self); if (self->argv) g_strfreev(self->argv); /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferFilterProcessClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = (GObjectClass*) klass; static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_READFD, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->start = start_impl; klass->cancel = cancel_impl; klass->perl_class = "Amanda::Xfer::Filter::Process"; klass->mech_pairs = mech_pairs; selfc->get_err_fd = get_err_fd_impl; goc->finalize = finalize_impl; parent_class = g_type_class_peek_parent(selfc); } GType xfer_filter_process_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferFilterProcessClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferFilterProcess), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferFilterProcess", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_filter_process( gchar **argv, gboolean need_root, gboolean must_drain, gboolean cancel_on_success, gboolean ignore_broken_pipe) { XferFilterProcess *xfp = (XferFilterProcess *)g_object_new(XFER_FILTER_PROCESS_TYPE, NULL); XferElement *elt = XFER_ELEMENT(xfp); if (!argv || !*argv) error("xfer_filter_process got a NULL or empty argv"); xfp->argv = argv; xfp->need_root = need_root; if (pipe(xfp->pipe_err) < 0) { g_critical(_("Can't create pipe: %s"), strerror(errno)); } elt->must_drain = must_drain; elt->cancel_on_success = cancel_on_success; elt->ignore_broken_pipe = ignore_broken_pipe; return elt; } int get_err_fd(XferElement *elt); int get_err_fd( XferElement *elt) { XferFilterProcessClass *klass; g_assert(IS_XFER_FILTER_PROCESS(elt)); klass = XFER_FILTER_PROCESS_GET_CLASS(elt); if (klass->get_err_fd) return klass->get_err_fd(XFER_FILTER_PROCESS(elt)); else return 0; } amanda-3.3.6/xfer-src/dest-fd.c0000664000076400007640000000667112357250004017673 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_fd() references * it directly. */ GType xfer_dest_fd_get_type(void); #define XFER_DEST_FD_TYPE (xfer_dest_fd_get_type()) #define XFER_DEST_FD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_fd_get_type(), XferDestFd) #define XFER_DEST_FD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_fd_get_type(), XferDestFd const) #define XFER_DEST_FD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_fd_get_type(), XferDestFdClass) #define IS_XFER_DEST_FD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_fd_get_type ()) #define XFER_DEST_FD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_fd_get_type(), XferDestFdClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestFd { XferElement __parent__; } XferDestFd; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferDestFdClass; /* * Implementation */ static void class_init( XferDestFdClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_WRITEFD, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->perl_class = "Amanda::Xfer::Dest::Fd"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_fd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestFdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestFd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestFd", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_dest_fd( int fd) { XferDestFd *self = (XferDestFd *)g_object_new(XFER_DEST_FD_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); g_assert(fd >= 0); /* We keep a *copy* of this fd, because our caller will close it to * indicate EOF */ g_assert(xfer_element_swap_input_fd(elt, dup(fd)) == -1); return elt; } amanda-3.3.6/xfer-src/source-random.c0000664000076400007640000001134212357250004021112 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "simpleprng.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_random() references * it directly. */ GType xfer_source_random_get_type(void); #define XFER_SOURCE_RANDOM_TYPE (xfer_source_random_get_type()) #define XFER_SOURCE_RANDOM(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_random_get_type(), XferSourceRandom) #define XFER_SOURCE_RANDOM_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_random_get_type(), XferSourceRandom const) #define XFER_SOURCE_RANDOM_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_random_get_type(), XferSourceRandomClass) #define IS_XFER_SOURCE_RANDOM(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_random_get_type ()) #define XFER_SOURCE_RANDOM_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_random_get_type(), XferSourceRandomClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceRandom { XferElement __parent__; gboolean limited_length; guint64 length; simpleprng_state_t prng; } XferSourceRandom; /* * Class definition */ typedef struct { XferElementClass __parent__; guint32 (*get_seed)(XferSourceRandom *elt); } XferSourceRandomClass; /* * Implementation */ static guint32 get_seed_impl( XferSourceRandom *self) { return simpleprng_get_seed(&self->prng); } static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferSourceRandom *self = (XferSourceRandom *)elt; char *buf; if (elt->cancelled || (self->limited_length && self->length == 0)) { *size = 0; return NULL; } if (self->limited_length) { *size = MIN(10240, self->length); self->length -= *size; } else { *size = 10240; } buf = g_malloc(*size); simpleprng_fill_buffer(&self->prng, buf, *size); return buf; } static void instance_init( XferElement *elt) { elt->can_generate_eof = TRUE; } static void class_init( XferSourceRandomClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; selfc->get_seed = get_seed_impl; klass->pull_buffer = pull_buffer_impl; klass->perl_class = "Amanda::Xfer::Source::Random"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_random_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceRandomClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceRandom), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceRandom", &info, 0); } return type; } guint32 xfer_source_random_get_seed( XferElement *elt) { XferSourceRandomClass *klass; g_assert(IS_XFER_SOURCE_RANDOM(elt)); klass = XFER_SOURCE_RANDOM_GET_CLASS(elt); return klass->get_seed(XFER_SOURCE_RANDOM(elt)); } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_source_random( guint64 length, guint32 prng_seed) { XferSourceRandom *xsr = (XferSourceRandom *)g_object_new(XFER_SOURCE_RANDOM_TYPE, NULL); XferElement *elt = XFER_ELEMENT(xsr); xsr->length = length; xsr->limited_length = (length != 0); simpleprng_seed(&xsr->prng, prng_seed); return elt; } amanda-3.3.6/xfer-src/xfer.h0000664000076400007640000001774412357250004017321 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* An Xfer abstracts an active data transfer through the Amanda core. */ #ifndef XFER_H #define XFER_H #include /* An Xfer represents a flow of data from a source, via zero or more filters, * to a destination. Sources, filters, and destinations are "transfer elements". * The job of the Xfer is glue together a sequence of elements, and provide a * dispatch point for messages from those elements to the caller. * * Xfers are not implemented as GObjects because there is no reason to subclass an * Xfer or apply any of the other features that come with GObject. */ /* The moment-to-moment state of a transfer */ typedef enum { XFER_INIT = 1, /* initializing */ XFER_START = 2, /* starting */ XFER_RUNNING = 3, /* data flowing */ XFER_CANCELLING = 4,/* cancellation begun */ XFER_CANCELLED = 5, /* all elements cancelled; draining data */ XFER_DONE = 6, /* data no longer flowing */ } xfer_status; /* forward declarations */ struct XferElement; struct XMsgSource; struct XMsg; /* * "Class" declaration */ struct Xfer { /* The current status of this transfer. This is read-only, and * must only be accessed from the main thread or with status_mutex * held. */ xfer_status status; /* lock this while checking status in a thread * other than the main thread */ GMutex *status_mutex; /* and wait on this for status changes */ GCond *status_cond; /* -- remaining fields are private -- */ gint refcount; /* All transfer elements for this transfer, in order from * source to destination. This is initialized when the Xfer is * created. */ GPtrArray *elements; /* temporary string for a representation of this transfer */ char *repr; /* GSource and queue for incoming messages */ struct XMsgSource *msg_source; GAsyncQueue *queue; /* Number of active elements remaining (a.k.a. the number of * XMSG_DONE messages to expect) */ gint num_active_elements; /* Used to coordinate handing off file descriptors among elements of this * xfer */ GMutex *fd_mutex; int cancelled; }; typedef struct Xfer Xfer; /* Note that all functions must be called from the main thread unless * otherwise noted */ /* Create a new Xfer object, which should later be freed with xfref_free. * * This function adds a reference to each element. The caller should * unreference the elements if it does not intend to use them directly. * The Xfer returned has a refcount of one. * * @param elements: array of pointers to transfer elements, in order from source * to destination * @param nelements: length of 'elements' * @returns: new Xfer object */ Xfer *xfer_new(struct XferElement **elements, unsigned int nelements); /* Increase the reference count of a transfer. * * @param xfer: the transfer */ void xfer_ref(Xfer *xfer); /* Decrease the reference count of a transfer, possibly freeing it. A running * transfer (state neither XFER_INIT nor XFER_DONE) will not be freed. * * @param xfer: the transfer */ void xfer_unref(Xfer *xfer); /* Get a GSource which will produce events corresponding to messages from * this transfer. This is a "peek" operation, so the reference count for the * GSource is not affected. Note that the same GSource is returned on every * call for a particular transfer. * * @returns: GSource object */ GSource *xfer_get_source(Xfer *xfer); /* Typedef for the callback to be set on the GSource returned from * xfer_get_source. */ typedef void (*XMsgCallback)(gpointer data, struct XMsg *msg, Xfer *xfer); /* Queue a message for delivery via this transfer's GSource. This can * be called in any thread. * * @param xfer: the transfer * @param msg: the message to queue */ void xfer_queue_message(Xfer *xfer, struct XMsg *msg); /* Get a representation of this transfer. The string belongs to the transfer, and * will be freed when the transfer is freed. * * @param xfer: the Xfer object * @returns: statically allocated string */ char *xfer_repr(Xfer *xfer); /* Start a transfer. This function will fail with an error message if it is * unable to set up the transfer (e.g., if the elements cannot be connected * correctly). * * @param xfer: the Xfer object * @param offset: the offset to start the transfer from (must be 0) * @param size: the Xfer object: the number of bytes to transfer. */ void xfer_start(Xfer *xfer, gint64 offset, gint64 size); /* Abort a running transfer. This essentially tells the source to stop * producing data and allows the remainder of the transfer to "drain". Thus * the transfer will signal its completion "normally" some time after * xfer_cancel returns. In particular, the state transitions will occur * as follows: * * - XFER_RUNNING * - xfer_cancel() (note state may still be XFER_RUNNING on return) * - XFER_CANCELLING * - (individual elements' cancel() methods are invoked) * - XFER_CANCELLED * - (data drains from the transfer) * - XFER_DONE * * This function can be called from any thread at any time. It will return * without blocking. * * @param xfer: the Xfer object */ void xfer_cancel(Xfer *xfer); /* * Utilities */ /* Wait for the xfer's state to become CANCELLED or DONE; this is useful to * wait until a cancelletion is in progress before returning an EOF or * otherwise handling a failure. If you call this in the main thread, you'll * be waiting for a while. * * @param xfer: the transfer object * @returns: the new status (XFER_CANCELLED or XFER_DONE) */ xfer_status wait_until_xfer_cancelled(Xfer *xfer); /* Wait for the xfer's state to become anything but START; this is * called *automatically* for every xfer_element_pull_buffer call, as the * upstream element may not be running and ready for a pull just yet. But * the function may be useful in other places, too. * * @param xfer: the transfer object * @returns: the new status (XFER_CANCELLED or XFER_DONE) */ xfer_status wait_until_xfer_running(Xfer *xfer); /* Send an XMSG_ERROR constructed with the given format and arguments, then * cancel the transfer, then wait until the transfer is completely cancelled. * This is the most common error-handling process for transfer elements. All * that remains to be done on return is to branch to the appropriate point in * the cancellation-handling portion of the transfer. * * @param elt: the transfer element producing the error * @param fmt: the format for the error message * @param ...: arguments corresponding to the format */ void xfer_cancel_with_error(struct XferElement *elt, const char *fmt, ...) G_GNUC_PRINTF(2,3); /* Return the fd in *FDP and set *FDP to NEWFD, all in one step. The operation * is atomic with respect to all other such operations in this transfer, making * this a good way to "move" a file descriptor from one element to another. If * xfer is NULL, the operation proceeds with no locking. * * @param xfer: the xfer within which this fd is used * @param fdp: pointer to the file descriptor to swap * @param newfd: the new value for *FDP * @returns: the previous contents of *fdp (may be -1) */ gint xfer_atomic_swap_fd(Xfer *xfer, gint *fdp, gint newfd); #endif /* XFER_H */ amanda-3.3.6/xfer-src/xmsg.h0000664000076400007640000001452012357250004017320 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef XMSG_H #define XMSG_H #include #include "xfer-element.h" /* This module handles transmission of discrete messages from transfer * elements to the transfer master. Messages have: * an overall type (xmsg_msg_type) * a version number * a source (an XferElement) * a number of attributes containing the message data * * Extensions to the protocol may add key/value pairs at any time without * affecting old implementations (that is, it is never an error to ignore * an unrecognized key). Changes to the meaning of, or removal of, * existing keys from a message requires a version increment, which will * preclude older implementations from processing the message. External * measures (such as amfeatures) should be employed in this case to ensure * backward compatibility. * * The implementation of messages is intended to sacrifice memory consumption * for speed and serializability. Relatively few messages will exist at any * one time, but over the course of a dump, many messages will be created, * serialized, unserialized, and processed. */ /* * Message types */ /* N.B. -- when adding new message types, add the corresponding case label * to xfer-src/xmsg.c:xmsg_repr() and perl/Amanda/Xfer.swg */ typedef enum { /* XMSG_INFO: informational messages suitable for display to user. Attributes: * - message */ XMSG_INFO = 1, /* XMSG_ERROR: error message from an element. Attributes: * - message */ XMSG_ERROR = 2, /* XMSG_DONE: the transfer is done. Only one XMSG_DONE message will be * delivered, when all elements are finished. * Attributes: * (none) */ XMSG_DONE = 3, /* XMSG_CANCEL: this transfer is being cancelled, but data may still be * "draining" from buffers. A subsequent XMSG_DONE indicates that the * transfer has actually completed. * Attributes: * (none) */ XMSG_CANCEL = 4, /* XMSG_PART_DONE: a split part is finished; used by XferDestTaper and * XferSourceTaper elements to indicate that the element is paused and * awaiting instructions to start a new part. Not all of the attributes * are applicable to both elements. * * Attributes: * - successful (true if the whole part was written; always false for * XferSourceTaper) * - eom (true if the device is at EOM; always false for XferSourceTaper) * - eof (recipient should not call start_part; always false for * XferSourceTaper) * - size (bytes written to or read from the volume) * - duration (time spent writing, not counting changer ops, etc.) * - partnum (the zero-based number of this part in the overall * dumpfile; always 0 for XferSourceTaper) * - fileno (the on-media file number used for this part, or 0 if no file * was used) */ XMSG_PART_DONE = 5, /* XMSG_READY: some elements do some additional, potentially long-term * startup operations after the xfer itself starts. This message is used * to indicate that the startup was successful. * * Attributes: * (none) */ XMSG_READY = 6, } xmsg_type; /* * Class Declaration */ typedef struct XMsg { /* General header information */ /* the origin of the message */ struct XferElement *elt; /* the message's overall type */ xmsg_type type; /* the message's version number */ int version; /* internal use only; use xmsg_repr() to get the representation */ char *repr; /* Attributes. Many of these will be zero or null. See the xmsg_type * enumeration for a description of the attributes that are set for each * message type. * * Note that any pointer-based attributes (strings, etc.) become owned * by the XMsg object, and will be freed in xmsg_free. The use of stralloc() * is advised for strings. * * NOTE TO IMPLEMENTERS: * * When adding a new attribute, make changes in the following places: * - add the attribute to the XMsg struct in xmsg.h * - add the attribute to the comments for the appropriate xmsg_types * - free the attribute in xmsg_free. * - edit perl/Amanda/Xfer.swg:new_sv_for_xmsg */ /* free-form string message for display to the users * * This string is always valid UTF-8. If it contains pathnames from a * bytestring-based filesystem, then non-ASCII bytes will be encoded using * quoted-printable. */ char *message; /* true indicates a successful operation */ gboolean successful; /* true if an EOM condition has occurred */ gboolean eom; /* true if an EOF condition has occurred */ gboolean eof; /* size, in bytes */ guint64 size; /* duration, in seconds */ double duration; /* split-part number */ guint64 partnum; /* file number on a volume */ guint64 fileno; } XMsg; /* * Methods */ /* Create a new XMsg. * * @param elt: element originating this message * @param type: message type * @param version: message version * @return: a new XMsg. */ XMsg *xmsg_new( XferElement *elt, xmsg_type type, int version); /* Free all memory associated with an XMsg. * * @param msg: the XMsg */ void xmsg_free(XMsg *msg); /* Return a printable representation of an XMsg. This representation * is stored with the message, and will be freed when the message is * freed. * * @param msg: the XMsg * @return: string representation */ char *xmsg_repr(XMsg *msg); #endif amanda-3.3.6/xfer-src/xfer-element.c0000664000076400007640000001546112357250004020735 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" /* parent class for XferElement */ static GObjectClass *parent_class = NULL; /* parent class for XferDest, XferFilter, and XferSource */ static XferElementClass *xfer_element_class = NULL; /*********************** * XferElement */ static void xfer_element_init( XferElement *xe) { xe->xfer = NULL; xe->output_mech = XFER_MECH_NONE; xe->input_mech = XFER_MECH_NONE; xe->upstream = xe->downstream = NULL; xe->_input_fd = xe->_output_fd = -1; xe->repr = NULL; xe->must_drain = FALSE; } static gboolean xfer_element_setup_impl( XferElement *elt G_GNUC_UNUSED) { return TRUE; /* success */ } static gboolean xfer_element_set_size_impl( XferElement *elt G_GNUC_UNUSED, gint64 size G_GNUC_UNUSED) { elt->size = size; return TRUE; /* success */ } static gboolean xfer_element_start_impl( XferElement *elt G_GNUC_UNUSED) { return FALSE; /* will not send XMSG_DONE */ } static gboolean xfer_element_cancel_impl( XferElement *elt, gboolean expect_eof) { elt->cancelled = TRUE; elt->expect_eof = expect_eof; return elt->can_generate_eof; } static gpointer xfer_element_pull_buffer_impl( XferElement *elt G_GNUC_UNUSED, size_t *size G_GNUC_UNUSED) { return NULL; } static void xfer_element_push_buffer_impl( XferElement *elt G_GNUC_UNUSED, gpointer buf G_GNUC_UNUSED, size_t size G_GNUC_UNUSED) { } static xfer_element_mech_pair_t * xfer_element_get_mech_pairs_impl( XferElement *elt) { return XFER_ELEMENT_GET_CLASS(elt)->mech_pairs; } static char * xfer_element_repr_impl( XferElement *elt) { if (!elt->repr) { elt->repr = newvstrallocf(elt->repr, "<%s@%p>", G_OBJECT_TYPE_NAME(G_OBJECT(elt)), elt); } return elt->repr; } static void xfer_element_finalize( GObject * obj_self) { XferElement *elt = XFER_ELEMENT(obj_self); gint fd; /* free the repr cache */ if (elt->repr) g_free(elt->repr); /* close up the input/output file descriptors, being careful to do so * atomically, and making any errors doing so into mere warnings */ fd = xfer_element_swap_input_fd(elt, -1); if (fd != -1 && close(fd) != 0) g_warning("error closing fd %d: %s", fd, strerror(errno)); fd = xfer_element_swap_output_fd(elt, -1); if (fd != -1 && close(fd) != 0) g_warning("error closing fd %d: %s", fd, strerror(errno)); /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void xfer_element_class_init( XferElementClass * klass) { GObjectClass *goc = (GObjectClass*) klass; klass->repr = xfer_element_repr_impl; klass->setup = xfer_element_setup_impl; klass->set_size = xfer_element_set_size_impl; klass->start = xfer_element_start_impl; klass->cancel = xfer_element_cancel_impl; klass->pull_buffer = xfer_element_pull_buffer_impl; klass->push_buffer = xfer_element_push_buffer_impl; klass->get_mech_pairs = xfer_element_get_mech_pairs_impl; goc->finalize = xfer_element_finalize; klass->perl_class = NULL; parent_class = g_type_class_peek_parent(klass); xfer_element_class = klass; } GType xfer_element_get_type(void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xfer_element_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferElement), 0 /* n_preallocs */, (GInstanceInitFunc) xfer_element_init, NULL }; type = g_type_register_static (G_TYPE_OBJECT, "XferElement", &info, (GTypeFlags)G_TYPE_FLAG_ABSTRACT); } return type; } /* * Method stubs */ void xfer_element_unref( XferElement *elt) { if (elt) g_object_unref(elt); } char * xfer_element_repr( XferElement *elt) { return XFER_ELEMENT_GET_CLASS(elt)->repr(elt); } gboolean xfer_element_setup( XferElement *elt) { return XFER_ELEMENT_GET_CLASS(elt)->setup(elt); } gboolean xfer_element_set_size( XferElement *elt, gint64 size) { return XFER_ELEMENT_GET_CLASS(elt)->set_size(elt, size); } gboolean xfer_element_start( XferElement *elt) { return XFER_ELEMENT_GET_CLASS(elt)->start(elt); } gboolean xfer_element_cancel( XferElement *elt, gboolean expect_eof) { return XFER_ELEMENT_GET_CLASS(elt)->cancel(elt, expect_eof); } gpointer xfer_element_pull_buffer( XferElement *elt, size_t *size) { xfer_status status; /* Make sure that the xfer is running before calling upstream's * pull_buffer method; this avoids a race condition where upstream * hasn't finished its xfer_element_start yet, and isn't ready for * a pull */ g_mutex_lock(elt->xfer->status_mutex); status = elt->xfer->status; g_mutex_unlock(elt->xfer->status_mutex); if (status == XFER_START) wait_until_xfer_running(elt->xfer); return XFER_ELEMENT_GET_CLASS(elt)->pull_buffer(elt, size); } void xfer_element_push_buffer( XferElement *elt, gpointer buf, size_t size) { /* There is no race condition with push_buffer, because downstream * elements are started first. */ XFER_ELEMENT_GET_CLASS(elt)->push_buffer(elt, buf, size); } xfer_element_mech_pair_t * xfer_element_get_mech_pairs( XferElement *elt) { return XFER_ELEMENT_GET_CLASS(elt)->get_mech_pairs(elt); } /**** * Utilities */ void xfer_element_drain_buffers( XferElement *upstream) { gpointer buf; size_t size; while ((buf =xfer_element_pull_buffer(upstream, &size))) { amfree(buf); } } void xfer_element_drain_fd( int fd) { size_t len; char buf[1024]; while (1) { len = full_read(fd, buf, sizeof(buf)); if (len < sizeof(buf)) return; } } amanda-3.3.6/xfer-src/source-directtcp-connect.c0000664000076400007640000001137612357250004023251 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "sockaddr-util.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_directtcp_connect() references * it directly. */ static GType xfer_source_directtcp_connect_get_type(void); #define XFER_SOURCE_DIRECTTCP_CONNECT_TYPE (xfer_source_directtcp_connect_get_type()) #define XFER_SOURCE_DIRECTTCP_CONNECT(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_directtcp_connect_get_type(), XferSourceDirectTCPConnect) #define XFER_SOURCE_DIRECTTCP_CONNECT_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_directtcp_connect_get_type(), XferSourceDirectTCPConnect const) #define XFER_SOURCE_DIRECTTCP_CONNECT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_directtcp_connect_get_type(), XferSourceDirectTCPConnectClass) #define IS_XFER_SOURCE_DIRECTTCP_CONNECT(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_directtcp_connect_get_type ()) #define XFER_SOURCE_DIRECTTCP_CONNECT_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_directtcp_connect_get_type(), XferSourceDirectTCPConnectClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceDirectTCPConnect { XferElement __parent__; /* Addresses to connect to */ DirectTCPAddr *addrs; } XferSourceDirectTCPConnect; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferSourceDirectTCPConnectClass; /* * Implementation */ static gboolean setup_impl( XferElement *elt) { XferSourceDirectTCPConnect *self = (XferSourceDirectTCPConnect *)elt; g_assert(self->addrs && SU_GET_FAMILY(self->addrs) != 0); elt->output_listen_addrs = self->addrs; return TRUE; } static void finalize_impl( GObject * obj_self) { XferSourceDirectTCPConnect *self = XFER_SOURCE_DIRECTTCP_CONNECT(obj_self); if (self->addrs) g_free(self->addrs); self->addrs = NULL; /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void instance_init( XferElement *elt) { elt->can_generate_eof = FALSE; } static void class_init( XferSourceDirectTCPConnectClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->setup = setup_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Source::DirectTCPConnect"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_directtcp_connect_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceDirectTCPConnectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceDirectTCPConnect), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceDirectTCPConnect", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_source_directtcp_connect(DirectTCPAddr *addrs) { XferSourceDirectTCPConnect *self = (XferSourceDirectTCPConnect *) g_object_new(XFER_SOURCE_DIRECTTCP_CONNECT_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); int i; g_assert(addrs != NULL); for (i = 0; SU_GET_FAMILY(&addrs[i]) != 0; i++); self->addrs = g_memdup(addrs, (i+1) * sizeof(*addrs)); return elt; } amanda-3.3.6/xfer-src/xfer-element.h0000664000076400007640000004552612357250004020747 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* Base classes for transfer elements. */ #ifndef XFER_ELEMENT_H #define XFER_ELEMENT_H #include #include #include "xfer.h" #include "amanda.h" #include "directtcp.h" typedef enum { /* sources have no input mechanisms and destinations have no output * mechansisms. */ XFER_MECH_NONE, /* downstream element will read() from elt->upstream's output_fd; EOF * is indicated by the usual OS mechanism resulting in a zero-length * read, in response to which the downstream element must close * the fd. */ XFER_MECH_READFD, /* upstream element will write() to elt->downstream's input_fd. EOF * is indicated by closing the file descriptor. */ XFER_MECH_WRITEFD, /* downstream element will call elt->upstream->pull_buffer() to * pull a buffer. EOF is indicated by returning a NULL buffer */ XFER_MECH_PULL_BUFFER, /* upstream element will call elt->downstream->push_buffer(buf) to push * a buffer. EOF is indicated by passing a NULL buffer. */ XFER_MECH_PUSH_BUFFER, /* DirectTCP: downstream sends an array of IP:PORT addresses to which a TCP * connection should be made, then upstream connects to one of the addreses * and sends the data over that connection */ XFER_MECH_DIRECTTCP_LISTEN, /* DirectTCP: downstream gets IP:PORT addresses from upstream to which a * TCP connection should be made, then connects to one of the addreses and * receives the data over that connection */ XFER_MECH_DIRECTTCP_CONNECT, /* (sentinel value) */ XFER_MECH_MAX, } xfer_mech; /* * Description of a pair (input, output) of xfer mechanisms that an * element can support, along with the associated costs. An array of these * pairs is stored in the class-level variable 'mech_pairs', describing * all of the mechanisms that an element supports. * * Use the XFER_NROPS() and XFER_NTHREADS() macros below in declarations in * order to make declarations more understandable. */ #define XFER_NROPS(x) (x) #define XFER_NTHREADS(x) (x) typedef struct { xfer_mech input_mech; xfer_mech output_mech; guint8 ops_per_byte; /* number of byte copies or other operations */ guint8 nthreads; /* number of additional threads created */ } xfer_element_mech_pair_t; /*********************** * XferElement * * The virtual base class for all transfer elements */ GType xfer_element_get_type(void); #define XFER_ELEMENT_TYPE (xfer_element_get_type()) #define XFER_ELEMENT(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_element_get_type(), XferElement) #define XFER_ELEMENT_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_element_get_type(), XferElement const) #define XFER_ELEMENT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_element_get_type(), XferElementClass) #define IS_XFER_ELEMENT(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_element_get_type ()) #define XFER_ELEMENT_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_element_get_type(), XferElementClass) /* * Main object structure */ typedef struct XferElement { GObject __parent__; /* The transfer to which this element is attached */ Xfer *xfer; /* set by xfer_new */ /* assigned input and output mechanisms */ xfer_mech input_mech; xfer_mech output_mech; /* neighboring xfer elements */ struct XferElement *upstream; struct XferElement *downstream; /* Information regarding cancellation. Cancelled and expect_eof are set by * the default cancel() method. Can_generate_eof should be set during * initialization, and is returned by the default cancel implementation */ gboolean cancelled; gboolean expect_eof; gboolean can_generate_eof; /* file descriptors for XFER_MECH_READFD and XFER_MECH_WRITEFD. These * should be set during setup(), and can be accessed by neighboring * elements during start(). These values are shared among multiple * elements, and thus must be accessed with xfer_element_swap_input_fd and * xfer_element_swap_output_fd. Any file descriptors remaining here at * finalize time will be closed. */ gint _input_fd; gint _output_fd; /* array of IP:PORT pairs that can be used to connect to this element, * terminated by a 0.0.0.0:0. The first is set by elements with an input * mech of XFER_MECH_DIRECTTCP_LISTEN and accessed by their upstream * neighbor; the second is set by elements with an output mech of * XFER_MECH_DIRECTTCP_CONNECT and accessed by their downstream neighbor. * */ DirectTCPAddr *input_listen_addrs; DirectTCPAddr *output_listen_addrs; /* cache for repr() */ char *repr; /* maximum size to transfer */ gint64 size; /* if input must be drained in case of write error */ gboolean must_drain; gboolean drain_mode; gboolean cancel_on_success; gboolean ignore_broken_pipe; } XferElement; /* * Class definition */ typedef struct { GObjectClass __parent__; /* Get a string representation of this element. The returned string will be freed * when the element is finalized, and is static until that time. This method is * implemented by XferElement, but can be overridden by classes that can provide * additional useful information about themselves. Overriding methods can use * the 'repr' instance variable as a cache -- it will be freed on finalize(). * * @param elt: the XferElement * @return: statically allocated string */ char *(*repr)(XferElement *elt); /* Set up this element. This function is called for all elements in a * transfer before start() is called for any elements. For mechanisms * where this element supplies a file descriptor, it should set its * input_fd and/or output_fd appropriately; neighboring elements will use * that value in start(). Elements which supply IP:PORT pairs should set * their input_addrs, for neighboring elements to use in start(). * * elt->input_mech and elt->output_mech are already set when this function * is called, but upstream and downstream are not. * * If the setup operation fails, the method should send an XMSG_ERROR and * call XMSG_CANCEL, and return False. In this situation, the start method * will not be called. The Xfer will appear to the user to start and * immediately fail. * * Note that this method may never be called if other elements' setup methods * fail first. * * @param elt: the XferElement * @return: false on failure, true on success */ gboolean (*setup)(XferElement *elt); /* set the size of data to transfer, to skip NUL padding bytes * @param elt: the XferElement * @param size: the size of data to transfer * @return: TRUE */ gboolean (*set_size)(XferElement *elt, gint64 size); /* Start transferring data. The element downstream of this one will * already be started, while the upstream element will not, so data will * not begin flowing immediately. It is safe to access attributes of * neighboring elements during this call. * * This method will *not* be called if all elements do not set up * correctly. * * @param elt: the XferElement * @return: TRUE if this element will send XMSG_DONE */ gboolean (*start)(XferElement *elt); /* Stop transferring data. The upstream element's cancel method will * already have been called, but due to buffering and synchronization * issues, data may yet arrive. The element may discard any such data, but * must not fail. This method is only called for abnormal terminations; * elements should normally stop processing on receiving an EOF indication * from upstream. * * If expect_eof is TRUE, then this element should expect an EOF from its * upstream element, and should drain any remaining data until that EOF * arrives and generate an EOF to the downstream element. The utility * functions xfer_element_drain_fd and xfer_element_drain_buffers may be * useful for this purpose. This draining is important in order to avoid * hung threads or unexpected SIGPIPEs. * * If expect_eof is FALSE, then the upstream elements are unable to * generate an early EOF, so this element should *not* attempt to drain any * remaining data. As an example, an FdSource is not active and thus * cannot generate an EOF on request. * * If this element can generate an EOF, it should return TRUE, otherwise * FALSE. * * This method may be called before start or setup if an error is * encountered during setup. * * The default implementation sets self->expect_eof and self->cancelled * appropriately and returns self->can_generate_eof. * * This method is always called from the main thread. It must not block. * * @param elt: the XferElement * @param expect_eof: element should expect an EOF * @returns: true if this element can return EOF */ gboolean (*cancel)(XferElement *elt, gboolean expect_eof); /* Get a buffer full of data from this element. This function is called by * the downstream element under XFER_MECH_PULL_CALL. It can block indefinitely, * and must only return NULL on EOF. Responsibility to free the buffer transfers * to the caller. * * @param elt: the XferElement * @param size (output): size of resulting buffer * @returns: buffer pointer */ gpointer (*pull_buffer)(XferElement *elt, size_t *size); /* A buffer full of data is being sent to this element for processing; this * function is called by the upstream element under XFER_MECH_PUSH_CALL. * It can block indefinitely if the data cannot be processed immediately. * An EOF condition is signaled by call with a NULL buffer. Responsibility to * free the buffer transfers to the callee. * * @param elt: the XferElement * @param buf: buffer * @param size: size of buffer */ void (*push_buffer)(XferElement *elt, gpointer buf, size_t size); /* Returns the mech_pairs that this element supports. The default * implementation just returns the class attribute 'mech_pairs', but * subclasses can dynamically select the available mechanisms by overriding * this method. Note that the method is called before the setup() method. * * @param elt: the XferElement * @returns: array of mech pairs, terminated by */ xfer_element_mech_pair_t *(*get_mech_pairs)(XferElement *elt); /* If the data must be drained without error if writing fail * * @param elt: the XferElement */ gboolean (*must_drain)(XferElement *elt); /* class variables */ /* This is used by the perl bindings -- it is a class variable giving the * appropriate perl class to wrap this XferElement. It should be set by * each class's class_init. */ const char *perl_class; /* Statically allocated array of input/output mechanisms supported by this * class (terminated by ). The default * get_mech_pairs method returns this. */ xfer_element_mech_pair_t *mech_pairs; } XferElementClass; /* * Method stubs */ void xfer_element_unref(XferElement *elt); gboolean xfer_element_link_to(XferElement *elt, XferElement *successor); char *xfer_element_repr(XferElement *elt); gboolean xfer_element_setup(XferElement *elt); gboolean xfer_element_set_size(XferElement *elt, gint64 size); gboolean xfer_element_start(XferElement *elt); void xfer_element_push_buffer(XferElement *elt, gpointer buf, size_t size); gpointer xfer_element_pull_buffer(XferElement *elt, size_t *size); gboolean xfer_element_cancel(XferElement *elt, gboolean expect_eof); xfer_element_mech_pair_t *xfer_element_get_mech_pairs(XferElement *elt); /**** * Subclass utilities * * These are utilities for subclasses */ /* Drain UPSTREAM by pulling buffers until EOF * * @param upstream: the element to drain */ void xfer_element_drain_buffers(XferElement *upstream); /* Drain UPSTREAM by reading until EOF. This does not close * the file descriptor. * * @param fd: the file descriptor to drain */ void xfer_element_drain_fd(int fd); /* Atomically swap a value into elt->_input_fd and _output_fd, respectively. * Always use these methods to access the field. * * @param elt: xfer element * @param newfd: new value for the fd field * @returns: old value of the fd field */ #define xfer_element_swap_input_fd(elt, newfd) \ xfer_atomic_swap_fd((elt)->xfer, &(elt)->_input_fd, newfd) #define xfer_element_swap_output_fd(elt, newfd) \ xfer_atomic_swap_fd((elt)->xfer, &(elt)->_output_fd, newfd) /*********************** * XferElement subclasses * * These simple subclasses do not introduce any additional public members or * methods, so they do not have their own header file. The functions here * provide their only public interface. The implementation of these elements * can also provide a good prototype for new elements. */ /* A transfer source that produces LENGTH bytes of random data, for testing * purposes. * * Implemented in source-random.c * * @param length: bytes to produce, or zero for no limit * @param prng_seed: initial value for random number generator * @return: new element */ XferElement *xfer_source_random(guint64 length, guint32 prng_seed); /* Get the ending random seed for the xfer_source_random. Call this after a * transfer has finished, and construct a new xfer_source_random with the seed. * The new source will continue the same random sequence at the next byte. This * is useful for constructing spanned dumps in testing. * * @param src: XferSourceRandom object * @returns: seed */ guint32 xfer_source_random_get_seed(XferElement *src); /* A transfer source that produces LENGTH bytes containing repeated * copies of the provided pattern, for testing purposes. * * Implemented in source-pattern.c * * @param length: bytes to produce, or zero for no limit * @param pattern: Pointer to memory containing the desired byte pattern. * @param pattern_length: Size of pattern to repeat. * @return: new element */ XferElement *xfer_source_pattern(guint64 length, void * pattern, size_t pattern_length); /* A transfer source that provides bytes read from a file descriptor. * Reading continues until EOF, but the file descriptor is not closed. * * Implemented in source-fd.c * * @param fd: the file descriptor from which to read * @return: new element */ XferElement * xfer_source_fd( int fd); /* A transfer source that exposes its listening DirectTCPAddrs (via * elt->input_listen_addrs) for external use * * Implemented in source-directtcp-listen.c * * @return: new element */ XferElement * xfer_source_directtcp_listen(void); /* A transfer source that connects to a DirectTCP address and pulls data * from it into the transfer. * * Implemented in source-directtcp-listen.c * * @param addrs: DirectTCP addresses to connect to * @return: new element */ XferElement * xfer_source_directtcp_connect(DirectTCPAddr *addrs); /* A transfer filter that copy its input to its output but contimue to read * the input if it get a Broken pipe to the output. * * Implemented in filter-drain.c * * @return: new element */ XferElement *xfer_filter_drain(void); /* A transfer filter that executes an external application, feeding it data on * stdin and taking the results on stdout. * * The memory for ARGV becomes the property of the transfer element and will be * g_strfreev'd when the xfer is destroyed. * * Implemented in filter-process.c * * @param argv: NULL-terminated command-line arguments * @param need_root: become root before exec'ing the subprocess * @return: new element */ XferElement *xfer_filter_process(gchar **argv, gboolean need_root, gboolean must_drain, gboolean cancel_on_success, gboolean ignore_broken_pipe); /* A transfer filter that just applies a bytewise XOR transformation to the data * that passes through it. * * Implemented in filter-xor.c * * @param xor_key: key for xor operations * @return: new element */ XferElement *xfer_filter_xor( unsigned char xor_key); /* A transfer destination that consumes all bytes it is given, optionally * validating that they match those produced by source_random * * Implemented in dest-null.c * * @param prng_seed: if nonzero, validate that the datastream matches * that produced by a random source with this random seed. If zero, * no validation is performed. * @return: new element */ XferElement *xfer_dest_null( guint32 prng_seed); /* A transfer destination that writes bytes to a file descriptor. The file * descriptor is not closed when the transfer is complete. * * Implemented in dest-fd.c * * @param fd: file descriptor to which to write * @return: new element */ XferElement *xfer_dest_fd( int fd); /* A transfer destination that writes bytes to an in-memory buffer. * * Implemented in dest-buffer.c * * @param max_size: maximum size for the buffer, or zero for no limit * @return: new element */ XferElement *xfer_dest_buffer( gsize max_size); /* Get the buffer and size from an XferDestBuffer. The resulting buffer * will remain allocated until the XDB itself is freed. * * Implemented in dest-buffer.c * * @param elt: the element * @param buf (output): buffer pointer * @param size (output): buffer size */ void xfer_dest_buffer_get( XferElement *elt, gpointer *buf, gsize *size); /* A transfer dest that connects to a DirectTCPAddr and sends data to * it * * Implemented in dest-directtcp-connect.c * * @param addrs: DirectTCP addresses to connect to * @return: new element */ XferElement * xfer_dest_directtcp_connect(DirectTCPAddr *addrs); /* A transfer dest that listens for a DirecTCP connection and sends data to it * when connected. Listening addresses are exposed at * elt->output_listen_addrs. * * Implemented in dest-directtcp-listen.c * * @return: new element */ XferElement * xfer_dest_directtcp_listen(void); #endif amanda-3.3.6/xfer-src/xfer.c0000664000076400007640000005025712357250004017310 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "element-glue.h" #include "arglist.h" /* XMsgSource objects are GSource "subclasses" which manage * a queue of messages, delivering those messages via callback * in the mainloop. Messages can be *sent* from any thread without * any concern for locking, but must only be received in the main * thread, in the default GMainContext. * * An XMsgSource pointer can be cast to a GSource pointer as * necessary. */ typedef struct XMsgSource { GSource source; /* must be the first element of the struct */ Xfer *xfer; } XMsgSource; /* forward prototypes */ static void xfer_set_status(Xfer *xfer, xfer_status status); static XMsgSource *xmsgsource_new(Xfer *xfer); static void link_elements(Xfer *xfer); Xfer * xfer_new( XferElement **elements, unsigned int nelements) { Xfer *xfer = g_new0(Xfer, 1); unsigned int i; g_assert(elements); g_assert(nelements >= 2); xfer->status = XFER_INIT; xfer->status_mutex = g_mutex_new(); xfer->status_cond = g_cond_new(); xfer->fd_mutex = g_mutex_new(); xfer->refcount = 1; xfer->repr = NULL; /* Create our message source and corresponding queue */ xfer->msg_source = xmsgsource_new(xfer); xfer->queue = g_async_queue_new(); /* copy the elements in, verifying that they're all XferElement objects */ xfer->elements = g_ptr_array_sized_new(nelements); for (i = 0; i < nelements; i++) { g_assert(elements[i] != NULL); g_assert(IS_XFER_ELEMENT(elements[i])); g_assert(elements[i]->xfer == NULL); g_ptr_array_add(xfer->elements, (gpointer)elements[i]); g_object_ref(elements[i]); elements[i]->xfer = xfer; } return xfer; } void xfer_ref( Xfer *xfer) { ++xfer->refcount; } void xfer_unref( Xfer *xfer) { unsigned int i; XMsg *msg; if (!xfer) return; /* be friendly to NULLs */ if (--xfer->refcount > 0) return; g_assert(xfer != NULL); g_assert(xfer->status == XFER_INIT || xfer->status == XFER_DONE); /* Divorce ourselves from the message source */ xfer->msg_source->xfer = NULL; g_source_unref((GSource *)xfer->msg_source); xfer->msg_source = NULL; /* Try to empty the message queue */ while ((msg = (XMsg *)g_async_queue_try_pop(xfer->queue))) { g_warning("Dropping XMsg from %s because the XMsgSource is being destroyed", xfer_element_repr(msg->elt)); xmsg_free(msg); } g_async_queue_unref(xfer->queue); g_mutex_free(xfer->status_mutex); g_cond_free(xfer->status_cond); g_mutex_free(xfer->fd_mutex); /* Free our references to the elements, and also set the 'xfer' * attribute of each to NULL, making them "unattached" (although * subsequent reuse of elements is untested). */ for (i = 0; i < xfer->elements->len; i++) { XferElement *elt = (XferElement *)g_ptr_array_index(xfer->elements, i); elt->xfer = NULL; g_object_unref(elt); } g_ptr_array_free(xfer->elements, TRUE); if (xfer->repr) g_free(xfer->repr); g_free(xfer); } GSource * xfer_get_source( Xfer *xfer) { return (GSource *)xfer->msg_source; } void xfer_queue_message( Xfer *xfer, XMsg *msg) { g_assert(xfer != NULL); g_assert(msg != NULL); g_async_queue_push(xfer->queue, (gpointer)msg); /* TODO: don't do this if we're in the main thread */ g_main_context_wakeup(NULL); } char * xfer_repr( Xfer *xfer) { unsigned int i; if (!xfer->repr) { xfer->repr = newvstrallocf(xfer->repr, "elements->len; i++) { XferElement *elt = (XferElement *)g_ptr_array_index(xfer->elements, i); xfer->repr = newvstralloc(xfer->repr, xfer->repr, (i==0)?"":" -> ", xfer_element_repr(elt), NULL); } xfer->repr = newvstralloc(xfer->repr, xfer->repr, ")>", NULL); } return xfer->repr; } void xfer_start( Xfer *xfer, gint64 offset G_GNUC_UNUSED, gint64 size) { unsigned int len; unsigned int i; gboolean setup_ok; g_assert(xfer != NULL); g_assert(xfer->status == XFER_INIT); g_assert(xfer->elements->len >= 2); g_assert(offset == 0); g_debug("Starting %s", xfer_repr(xfer)); /* set the status to XFER_START and add a reference to our count, so that * we are not freed while still in operation. We'll drop this reference * when the status becomes XFER_DONE. */ xfer_ref(xfer); xfer->num_active_elements = 0; xfer_set_status(xfer, XFER_START); /* Link the elements. This calls error() on failure, and rewrites * xfer->elements */ link_elements(xfer); /* Tell all elements to set up. This is done before upstream and downstream * are set so that elements cannot interfere with one another before setup() * is completed. */ setup_ok = TRUE; for (i = 0; i < xfer->elements->len; i++) { XferElement *xe = (XferElement *)g_ptr_array_index(xfer->elements, i); if (!xfer_element_setup(xe)) { setup_ok = FALSE; break; } } /* If setup_ok is false, then there is an XMSG_CANCEL in the message queue * already, so skip calling start for any of the elements and send an * XMSG_DONE, since none of the elements will do so. */ if (setup_ok) { /* Set the upstream and downstream links between elements */ len = xfer->elements->len; for (i = 0; i < len; i++) { XferElement *elt = g_ptr_array_index(xfer->elements, i); if (i > 0) elt->upstream = g_ptr_array_index(xfer->elements, i-1); if (i < len-1) elt->downstream = g_ptr_array_index(xfer->elements, i+1); } /* Set size for first element */ if (size) { XferElement *xe = (XferElement *)g_ptr_array_index(xfer->elements, 0); xfer_element_set_size(xe, size); } /* now tell them all to start, in order from destination to source */ for (i = xfer->elements->len; i >= 1; i--) { XferElement *xe = (XferElement *)g_ptr_array_index(xfer->elements, i-1); if (xfer_element_start(xe)) xfer->num_active_elements++; } } /* (note that status can only change in the main thread, so we can be * certain that the status is still XFER_START and we have not yet been * cancelled. We may have an XMSG_CANCEL already queued up for us, though) */ xfer_set_status(xfer, XFER_RUNNING); /* If this transfer involves no active processing, then we consider it to * be done already. We send a "fake" XMSG_DONE from the destination element, * so that all of the usual processing will take place. */ if (xfer->num_active_elements == 0) { if (setup_ok) g_debug("%s has no active elements; generating fake XMSG_DONE", xfer_repr(xfer)); xfer->num_active_elements++; xfer_queue_message(xfer, xmsg_new((XferElement *)g_ptr_array_index(xfer->elements, xfer->elements->len-1), XMSG_DONE, 0)); } } void xfer_cancel( Xfer *xfer) { /* Since xfer_cancel can be called from any thread, we just send a message. * The action takes place when the message is received. */ XferElement *src; if (xfer->cancelled > 0) return; xfer->cancelled++; src = g_ptr_array_index(xfer->elements, 0); xfer_queue_message(xfer, xmsg_new(src, XMSG_CANCEL, 0)); } static void xfer_set_status( Xfer *xfer, xfer_status status) { if (xfer->status == status) return; g_mutex_lock(xfer->status_mutex); /* check that this state transition is valid */ switch (status) { case XFER_START: g_assert(xfer->status == XFER_INIT); break; case XFER_RUNNING: g_assert(xfer->status == XFER_START); break; case XFER_CANCELLING: g_assert(xfer->status == XFER_RUNNING); break; case XFER_CANCELLED: g_assert(xfer->status == XFER_CANCELLING); break; case XFER_DONE: g_assert(xfer->status == XFER_CANCELLED || xfer->status == XFER_RUNNING); break; case XFER_INIT: default: g_assert_not_reached(); } xfer->status = status; g_cond_broadcast(xfer->status_cond); g_mutex_unlock(xfer->status_mutex); } /* * Element linking */ /* How is ELT linked? link_recurse uses an array of these to track its progress * and find the optimal overall linkage. */ typedef struct linkage { XferElement *elt; xfer_element_mech_pair_t *mech_pairs; int elt_idx; /* index into elt's mech_pairs */ int glue_idx; /* index into glue pairs for elt's output; -1 = no glue */ } linkage; /* Overall state of the recursive linking process */ typedef struct linking_state { int nlinks; /* number of linkage objects in each array */ linkage *cur; /* "current" linkage */ linkage *best; /* best linkage so far */ gint32 best_cost; /* cost for best */ } linking_state; /* used for debugging messages */ static char * xfer_mech_name( xfer_mech mech) { switch (mech) { case XFER_MECH_NONE: return "NONE"; case XFER_MECH_READFD: return "READFD"; case XFER_MECH_WRITEFD: return "WRITEFD"; case XFER_MECH_PULL_BUFFER: return "PULL_BUFFER"; case XFER_MECH_PUSH_BUFFER: return "PUSH_BUFFER"; case XFER_MECH_DIRECTTCP_LISTEN: return "DIRECTTCP_LISTEN"; case XFER_MECH_DIRECTTCP_CONNECT: return "DIRECTTCP_CONNECT"; default: return "UNKNOWN"; } } /* calculate an integer representing the cost of a mech pair as a * single integer. OPS_PER_BYTE is the most important metric, * followed by NTHREADS. * * PAIR will be evaluated multiple times. */ #define PAIR_COST(pair) (((pair).ops_per_byte << 8) + (pair).nthreads) /* maximum cost */ #define MAX_COST 0xffffff /* Generate all possible linkages of elements [idx:nlinks], where * elements [0:idx-1] have cost 'cost' and end with mechanism * 'input_mech'. */ static void link_recurse( linking_state *st, int idx, xfer_mech input_mech, gint32 cost) { xfer_element_mech_pair_t *elt_pairs, *glue_pairs; linkage *my; /* if we've overrun the previous best cost already, then bail out */ if (cost >= st->best_cost) return; /* have we linked everything? */ if (idx == st->nlinks) { /* if we ended on other than XFER_MECH_NONE, then this is not a * valid transfer */ if (input_mech != XFER_MECH_NONE) return; /* we already know this has lower cost than the previous best */ memcpy(st->best, st->cur, st->nlinks * sizeof(linkage)); st->best_cost = cost; return; } /* recurse for each linkage we can make that starts with input_mech */ my = &st->cur[idx]; elt_pairs = my->mech_pairs; glue_pairs = xfer_element_glue_mech_pairs; for (my->elt_idx = 0; elt_pairs[my->elt_idx].input_mech != XFER_MECH_NONE || elt_pairs[my->elt_idx].output_mech != XFER_MECH_NONE; my->elt_idx++) { /* reject this pair if the input mech does not match */ if (elt_pairs[my->elt_idx].input_mech != input_mech) continue; /* recurse with no glue */ my->glue_idx = -1; link_recurse(st, idx+1, elt_pairs[my->elt_idx].output_mech, cost + PAIR_COST(elt_pairs[my->elt_idx])); /* and recurse with glue */ for (my->glue_idx = 0; glue_pairs[my->glue_idx].input_mech != XFER_MECH_NONE || glue_pairs[my->glue_idx].output_mech != XFER_MECH_NONE; my->glue_idx++) { /* reject this glue pair if it doesn't match with the element output */ if (glue_pairs[my->glue_idx].input_mech != elt_pairs[my->elt_idx].output_mech) continue; /* and recurse with the glue */ link_recurse(st, idx+1, glue_pairs[my->glue_idx].output_mech, cost + PAIR_COST(elt_pairs[my->elt_idx]) + PAIR_COST(glue_pairs[my->glue_idx])); } } } static void link_elements( Xfer *xfer) { GPtrArray *new_elements; XferElement *elt; char *linkage_str; linking_state st; gint i, len; /* Note that this algorithm's running time is polynomial in the length of * the transfer, with a fairly high order. If Amanda is regularly assembling * transfers with more than, say, 6 elements, then the algorithm should be * redesigned. */ /* set up the state for recursion */ st.nlinks = xfer->elements->len; st.cur = g_new0(linkage, st.nlinks); st.best = g_new0(linkage, st.nlinks); st.best_cost = MAX_COST; for (i = 0; i < st.nlinks; i++) { st.cur[i].elt = (XferElement *)g_ptr_array_index(xfer->elements, i); st.cur[i].mech_pairs = xfer_element_get_mech_pairs(st.cur[i].elt); } /* check that the first element is an XferSource and the last is an XferDest. * A source is identified by having no input mechanisms. */ if (st.cur[0].mech_pairs[0].input_mech != XFER_MECH_NONE) error("Transfer element 0 is not a transfer source"); /* Similarly, a destination has no output mechanisms. */ if (st.cur[st.nlinks-1].mech_pairs[0].output_mech != XFER_MECH_NONE) error("Last transfer element is not a transfer destination"); /* start recursing with the first element, asserting that its input mech is NONE */ link_recurse(&st, 0, XFER_MECH_NONE, 0); /* check that we got *some* solution */ if (st.best_cost == MAX_COST) { error(_("Xfer %s cannot be linked."), xfer_repr(xfer)); } /* Now create a new list of elements, containing any glue elements * that we need to add, and set their input_mech and output_mech fields */ new_elements = g_ptr_array_sized_new(xfer->elements->len); for (i = 0; i < st.nlinks; i++) { elt = st.best[i].elt; elt->input_mech = st.best[i].mech_pairs[st.best[i].elt_idx].input_mech; elt->output_mech = st.best[i].mech_pairs[st.best[i].elt_idx].output_mech; g_ptr_array_add(new_elements, elt); if (st.best[i].glue_idx != -1) { elt = xfer_element_glue(); elt->xfer = xfer; elt->input_mech = xfer_element_glue_mech_pairs[st.best[i].glue_idx].input_mech; elt->output_mech = xfer_element_glue_mech_pairs[st.best[i].glue_idx].output_mech; g_ptr_array_add(new_elements, elt); } } /* install the new list of elements */ g_ptr_array_free(xfer->elements, FALSE); xfer->elements = new_elements; new_elements = NULL; /* debug-log the xfer's linkage */ len = xfer->elements->len; linkage_str = stralloc("Final linkage: "); for (i = 0; i < len; i++) { XferElement *elt = g_ptr_array_index(xfer->elements, i); if (i == 0) linkage_str = newvstralloc(linkage_str, linkage_str, xfer_element_repr(elt), NULL); else linkage_str = newvstrallocf(linkage_str, "%s -(%s)-> %s", linkage_str, xfer_mech_name(elt->input_mech), xfer_element_repr(elt)); } g_debug("%s", linkage_str); amfree(linkage_str); amfree(st.cur); amfree(st.best); } /* * XMsgSource */ static gboolean xmsgsource_prepare( GSource *source, gint *timeout_) { XMsgSource *xms = (XMsgSource *)source; *timeout_ = -1; return xms->xfer && g_async_queue_length(xms->xfer->queue) > 0; } static gboolean xmsgsource_check( GSource *source) { XMsgSource *xms = (XMsgSource *)source; return xms->xfer && g_async_queue_length(xms->xfer->queue) > 0; } static gboolean xmsgsource_dispatch( GSource *source G_GNUC_UNUSED, GSourceFunc callback, gpointer user_data) { XMsgSource *xms = (XMsgSource *)source; Xfer *xfer = xms->xfer; XMsgCallback my_cb = (XMsgCallback)callback; XMsg *msg; gboolean deliver_to_caller; guint i; gboolean xfer_done = FALSE; /* we're potentially calling Perl code within this loop, so we have to * check that everything is ok on each iteration of the loop. */ while (xfer && xfer->status != XFER_DONE && (msg = (XMsg *)g_async_queue_try_pop(xfer->queue))) { /* We get first crack at interpreting messages, before calling the * designated callback. */ deliver_to_caller = TRUE; switch (msg->type) { /* Intercept and count DONE messages so that we can determine when * the entire transfer is finished. */ case XMSG_DONE: if (--xfer->num_active_elements <= 0) { /* mark the transfer as done, and take a note to break out * of this loop after delivering the message to the user */ xfer_set_status(xfer, XFER_DONE); xfer_done = TRUE; } else { /* eat this XMSG_DONE, since we expect more */ deliver_to_caller = FALSE; } break; case XMSG_CANCEL: if (xfer->status == XFER_CANCELLING || xfer->status == XFER_CANCELLED) { /* ignore duplicate cancel messages */ deliver_to_caller = FALSE; } else { /* call cancel() on each child element */ gboolean expect_eof; g_debug("Cancelling %s", xfer_repr(xfer)); xfer_set_status(xfer, XFER_CANCELLING); expect_eof = FALSE; for (i = 0; i < xfer->elements->len; i++) { XferElement *elt = (XferElement *) g_ptr_array_index(xfer->elements, i); expect_eof = xfer_element_cancel(elt, expect_eof) || expect_eof; } /* if nothing in the transfer can generate an EOF, then we * can't cancel this transfer, and we'll just have to wait * until it's finished. This may happen, for example, if * the operating system is copying data for us * asynchronously */ if (!expect_eof) g_warning("Transfer %s cannot be cancelled.", xfer_repr(xfer)); /* and now we're done cancelling */ xfer_set_status(xfer, XFER_CANCELLED); } break; default: break; /* nothing interesting to do */ } if (deliver_to_caller) { if (my_cb) { my_cb(user_data, msg, xfer); } else { g_warning("Dropping %s because no callback is set", xmsg_repr(msg)); } } xmsg_free(msg); /* This transfer is done, so kill it and exit the loop */ if (xfer_done) { xfer_unref(xfer); xfer = NULL; break; } } /* Never automatically un-queue the event source */ return TRUE; } XMsgSource * xmsgsource_new( Xfer *xfer) { static GSourceFuncs *xmsgsource_funcs = NULL; GSource *src; XMsgSource *xms; /* initialize these here to avoid a compiler warning */ if (!xmsgsource_funcs) { xmsgsource_funcs = g_new0(GSourceFuncs, 1); xmsgsource_funcs->prepare = xmsgsource_prepare; xmsgsource_funcs->check = xmsgsource_check; xmsgsource_funcs->dispatch = xmsgsource_dispatch; } src = g_source_new(xmsgsource_funcs, sizeof(XMsgSource)); xms = (XMsgSource *)src; xms->xfer = xfer; return xms; } xfer_status wait_until_xfer_cancelled( Xfer *xfer) { xfer_status seen_status; g_assert(xfer != NULL); g_mutex_lock(xfer->status_mutex); while (xfer->status != XFER_CANCELLED && xfer->status != XFER_DONE) g_cond_wait(xfer->status_cond, xfer->status_mutex); seen_status = xfer->status; g_mutex_unlock(xfer->status_mutex); return seen_status; } xfer_status wait_until_xfer_running( Xfer *xfer) { xfer_status seen_status; g_assert(xfer != NULL); g_mutex_lock(xfer->status_mutex); while (xfer->status == XFER_START) g_cond_wait(xfer->status_cond, xfer->status_mutex); seen_status = xfer->status; g_mutex_unlock(xfer->status_mutex); return seen_status; } void xfer_cancel_with_error( XferElement *elt, const char *fmt, ...) { va_list argp; XMsg *msg; g_assert(elt != NULL); g_assert(elt->xfer != NULL); msg = xmsg_new(elt, XMSG_ERROR, 0); arglist_start(argp, fmt); msg->message = g_strdup_vprintf(fmt, argp); arglist_end(argp); /* send the XMSG_ERROR */ xfer_queue_message(elt->xfer, msg); /* cancel the transfer */ xfer_cancel(elt->xfer); } gint xfer_atomic_swap_fd(Xfer *xfer, gint *fdp, gint newfd) { gint rv; if (xfer) g_mutex_lock(xfer->fd_mutex); rv = *fdp; *fdp = newfd; if (xfer) g_mutex_unlock(xfer->fd_mutex); return rv; } amanda-3.3.6/xfer-src/xfer-test.c0000664000076400007640000014343312357250004020264 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com * * Author: Dustin J. Mitchell */ #include "amanda.h" #include "amxfer.h" #include "glib-util.h" #include "testutils.h" #include "event.h" #include "simpleprng.h" #include "sockaddr-util.h" /* Having tests repeat exactly is an advantage, so we use a hard-coded * random seed. */ #define RANDOM_SEED 0xf00d /* * XferElement subclasses * * This file defines a few "private" element classes that each have only one * mechanism pair. These classes are then used to test all of the possible * combinations of glue. */ /* constants to determine the total amount of data to be transfered; EXTRA is * to test out partial-block handling; it should be prime. */ #define TEST_BLOCK_SIZE 32768 #define TEST_BLOCK_COUNT 10 #define TEST_BLOCK_EXTRA 97 #define TEST_XFER_SIZE ((TEST_BLOCK_SIZE*TEST_BLOCK_COUNT)+TEST_BLOCK_EXTRA) /* READFD */ static GType xfer_source_readfd_get_type(void); #define XFER_SOURCE_READFD_TYPE (xfer_source_readfd_get_type()) #define XFER_SOURCE_READFD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_readfd_get_type(), XferSourceReadfd) #define XFER_SOURCE_READFD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_readfd_get_type(), XferSourceReadfd const) #define XFER_SOURCE_READFD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_readfd_get_type(), XferSourceReadfdClass) #define IS_XFER_SOURCE_READFD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_readfd_get_type ()) #define XFER_SOURCE_READFD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_readfd_get_type(), XferSourceReadfdClass) typedef struct XferSourceReadfd { XferElement __parent__; int write_fd; GThread *thread; simpleprng_state_t prng; } XferSourceReadfd; typedef struct { XferElementClass __parent__; } XferSourceReadfdClass; static gpointer source_readfd_thread( gpointer data) { XferSourceReadfd *self = XFER_SOURCE_READFD(data); char buf[TEST_XFER_SIZE]; int fd = self->write_fd; simpleprng_fill_buffer(&self->prng, buf, sizeof(buf)); if (full_write(fd, buf, sizeof(buf)) < sizeof(buf)) { error("error in full_write(): %s", strerror(errno)); } close(fd); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean source_readfd_setup_impl( XferElement *elt) { XferSourceReadfd *self = XFER_SOURCE_READFD(elt); int p[2]; simpleprng_seed(&self->prng, RANDOM_SEED); if (pipe(p) < 0) g_critical("Error from pipe(): %s", strerror(errno)); self->write_fd = p[1]; g_assert(xfer_element_swap_output_fd(elt, p[0]) == -1); return TRUE; } static gboolean source_readfd_start_impl( XferElement *elt) { XferSourceReadfd *self = XFER_SOURCE_READFD(elt); self->thread = g_thread_create(source_readfd_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void source_readfd_class_init( XferSourceReadfdClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->setup = source_readfd_setup_impl; xec->start = source_readfd_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_readfd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceReadfdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_readfd_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceReadfd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceReadfd", &info, 0); } return type; } /* WRITEFD */ static GType xfer_source_writefd_get_type(void); #define XFER_SOURCE_WRITEFD_TYPE (xfer_source_writefd_get_type()) #define XFER_SOURCE_WRITEFD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_writefd_get_type(), XferSourceWritefd) #define XFER_SOURCE_WRITEFD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_writefd_get_type(), XferSourceWritefd const) #define XFER_SOURCE_WRITEFD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_writefd_get_type(), XferSourceWritefdClass) #define IS_XFER_SOURCE_WRITEFD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_writefd_get_type ()) #define XFER_SOURCE_WRITEFD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_writefd_get_type(), XferSourceWritefdClass) typedef struct XferSourceWritefd { XferElement __parent__; GThread *thread; simpleprng_state_t prng; } XferSourceWritefd; typedef struct { XferElementClass __parent__; } XferSourceWritefdClass; static gpointer source_writefd_thread( gpointer data) { XferSourceWritefd *self = XFER_SOURCE_WRITEFD(data); XferElement *elt = XFER_ELEMENT(data); char buf[TEST_XFER_SIZE]; int fd = xfer_element_swap_input_fd(elt->downstream, -1); /* this shouldn't happen, although non-test elements handle it gracefully */ g_assert(fd != -1); simpleprng_fill_buffer(&self->prng, buf, sizeof(buf)); if (full_write(fd, buf, sizeof(buf)) < sizeof(buf)) { error("error in full_write(): %s", strerror(errno)); } close(fd); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean source_writefd_start_impl( XferElement *elt) { XferSourceWritefd *self = XFER_SOURCE_WRITEFD(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(source_writefd_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void source_writefd_class_init( XferSourceWritefdClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = source_writefd_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_writefd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceWritefdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_writefd_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceWritefd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceWritefd", &info, 0); } return type; } /* PUSH_BUFFER */ static GType xfer_source_push_get_type(void); #define XFER_SOURCE_PUSH_TYPE (xfer_source_push_get_type()) #define XFER_SOURCE_PUSH(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_push_get_type(), XferSourcePush) #define XFER_SOURCE_PUSH_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_push_get_type(), XferSourcePush const) #define XFER_SOURCE_PUSH_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_push_get_type(), XferSourcePushClass) #define IS_XFER_SOURCE_PUSH(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_push_get_type ()) #define XFER_SOURCE_PUSH_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_push_get_type(), XferSourcePushClass) typedef struct XferSourcePush { XferElement __parent__; GThread *thread; simpleprng_state_t prng; } XferSourcePush; typedef struct { XferElementClass __parent__; } XferSourcePushClass; static gpointer source_push_thread( gpointer data) { XferSourcePush *self = XFER_SOURCE_PUSH(data); char *buf; int i; for (i = 0; i < TEST_BLOCK_COUNT; i++) { buf = g_malloc(TEST_BLOCK_SIZE); simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_SIZE); xfer_element_push_buffer(XFER_ELEMENT(self)->downstream, buf, TEST_BLOCK_SIZE); buf = NULL; } /* send a smaller block */ buf = g_malloc(TEST_BLOCK_EXTRA); simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_EXTRA); xfer_element_push_buffer(XFER_ELEMENT(self)->downstream, buf, TEST_BLOCK_EXTRA); buf = NULL; /* send EOF */ xfer_element_push_buffer(XFER_ELEMENT(self)->downstream, NULL, 0); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean source_push_start_impl( XferElement *elt) { XferSourcePush *self = XFER_SOURCE_PUSH(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(source_push_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void source_push_class_init( XferSourcePushClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = source_push_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_push_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourcePushClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_push_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourcePush), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourcePush", &info, 0); } return type; } /* PULL_BUFFER */ static GType xfer_source_pull_get_type(void); #define XFER_SOURCE_PULL_TYPE (xfer_source_pull_get_type()) #define XFER_SOURCE_PULL(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_pull_get_type(), XferSourcePull) #define XFER_SOURCE_PULL_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_pull_get_type(), XferSourcePull const) #define XFER_SOURCE_PULL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_pull_get_type(), XferSourcePullClass) #define IS_XFER_SOURCE_PULL(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_pull_get_type ()) #define XFER_SOURCE_PULL_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_pull_get_type(), XferSourcePullClass) typedef struct XferSourcePull { XferElement __parent__; gint nbuffers; GThread *thread; simpleprng_state_t prng; } XferSourcePull; typedef struct { XferElementClass __parent__; } XferSourcePullClass; static gpointer source_pull_pull_buffer_impl( XferElement *elt, size_t *size) { XferSourcePull *self = XFER_SOURCE_PULL(elt); char *buf; size_t bufsiz; if (self->nbuffers > TEST_BLOCK_COUNT) { *size = 0; return NULL; } bufsiz = (self->nbuffers != TEST_BLOCK_COUNT)? TEST_BLOCK_SIZE : TEST_BLOCK_EXTRA; self->nbuffers++; buf = g_malloc(bufsiz); simpleprng_fill_buffer(&self->prng, buf, bufsiz); *size = bufsiz; return buf; } static gboolean source_pull_setup_impl( XferElement *elt) { XferSourcePull *self = XFER_SOURCE_PULL(elt); simpleprng_seed(&self->prng, RANDOM_SEED); return TRUE; } static void source_pull_class_init( XferSourcePullClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->pull_buffer = source_pull_pull_buffer_impl; xec->setup = source_pull_setup_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_pull_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourcePullClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_pull_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourcePull), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourcePull", &info, 0); } return type; } /* LISTEN */ static GType xfer_source_listen_get_type(void); #define XFER_SOURCE_LISTEN_TYPE (xfer_source_listen_get_type()) #define XFER_SOURCE_LISTEN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_listen_get_type(), XferSourceListen) #define XFER_SOURCE_LISTEN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_listen_get_type(), XferSourceListen const) #define XFER_SOURCE_LISTEN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_listen_get_type(), XferSourceListenClass) #define IS_XFER_SOURCE_LISTEN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_listen_get_type ()) #define XFER_SOURCE_LISTEN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_listen_get_type(), XferSourceListenClass) typedef struct XferSourceListen { XferElement __parent__; GThread *thread; simpleprng_state_t prng; } XferSourceListen; typedef struct { XferElementClass __parent__; } XferSourceListenClass; static gpointer source_listen_thread( gpointer data) { XferSourceListen *self = XFER_SOURCE_LISTEN(data); XferElement *elt = XFER_ELEMENT(self); DirectTCPAddr *addrs; int sock; char *buf; int i; /* set up the sockaddr -- IPv4 only */ addrs = elt->downstream->input_listen_addrs; g_assert(addrs != NULL); tu_dbg("making data connection to %s\n", str_sockaddr(addrs)); sock = socket(SU_GET_FAMILY(addrs), SOCK_STREAM, 0); if (sock < 0) { error("socket(): %s", strerror(errno)); } if (connect(sock, (struct sockaddr *)addrs, SS_LEN(addrs)) < 0) { error("connect(): %s", strerror(errno)); } tu_dbg("connected to %s\n", str_sockaddr(addrs)); buf = g_malloc(TEST_BLOCK_SIZE); for (i = 0; i < TEST_BLOCK_COUNT; i++) { simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_SIZE); if (full_write(sock, buf, TEST_BLOCK_SIZE) < TEST_BLOCK_SIZE) { error("error in full_write(): %s", strerror(errno)); } } /* send a smaller block */ simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_EXTRA); if (full_write(sock, buf, TEST_BLOCK_EXTRA) < TEST_BLOCK_EXTRA) { error("error in full_write(): %s", strerror(errno)); } g_free(buf); /* send EOF by closing the socket */ close(sock); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean source_listen_start_impl( XferElement *elt) { XferSourceListen *self = XFER_SOURCE_LISTEN(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(source_listen_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void source_listen_class_init( XferSourceListenClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = source_listen_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_listen_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceListenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_listen_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceListen), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceListen", &info, 0); } return type; } /* CONNECT */ static GType xfer_source_connect_get_type(void); #define XFER_SOURCE_CONNECT_TYPE (xfer_source_connect_get_type()) #define XFER_SOURCE_CONNECT(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_connect_get_type(), XferSourceConnect) #define XFER_SOURCE_CONNECT_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_connect_get_type(), XferSourceConnect const) #define XFER_SOURCE_CONNECT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_connect_get_type(), XferSourceConnectClass) #define IS_XFER_SOURCE_CONNECT(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_connect_get_type ()) #define XFER_SOURCE_CONNECT_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_connect_get_type(), XferSourceConnectClass) typedef struct XferSourceConnect { XferElement __parent__; int listen_socket; GThread *thread; simpleprng_state_t prng; } XferSourceConnect; typedef struct { XferElementClass __parent__; } XferSourceConnectClass; static gpointer source_connect_thread( gpointer data) { XferSourceConnect *self = XFER_SOURCE_CONNECT(data); int sock; char *buf; int i; g_assert(self->listen_socket != -1); if ((sock = accept(self->listen_socket, NULL, NULL)) == -1) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Error accepting incoming connection: %s"), strerror(errno)); wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer); return NULL; } /* close the listening socket now, for good measure */ close(self->listen_socket); self->listen_socket = -1; tu_dbg("connection accepted\n"); buf = g_malloc(TEST_BLOCK_SIZE); for (i = 0; i < TEST_BLOCK_COUNT; i++) { simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_SIZE); if (full_write(sock, buf, TEST_BLOCK_SIZE) < TEST_BLOCK_SIZE) { error("error in full_write(): %s", strerror(errno)); } } /* send a smaller block */ simpleprng_fill_buffer(&self->prng, buf, TEST_BLOCK_EXTRA); if (full_write(sock, buf, TEST_BLOCK_EXTRA) < TEST_BLOCK_EXTRA) { error("error in full_write(): %s", strerror(errno)); } g_free(buf); /* send EOF by closing the socket */ close(sock); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean source_connect_setup_impl( XferElement *elt) { XferSourceConnect *self = XFER_SOURCE_CONNECT(elt); sockaddr_union addr; DirectTCPAddr *addrs; socklen_t len; int sock; /* set up self->listen_socket and set elt->output_listen_addrs */ sock = self->listen_socket = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) error("socket(): %s", strerror(errno)); if (listen(sock, 1) < 0) error("listen(): %s", strerror(errno)); len = sizeof(addr); if (getsockname(sock, (struct sockaddr *)&addr, &len) < 0) error("getsockname(): %s", strerror(errno)); g_assert(SU_GET_FAMILY(&addr) == AF_INET); addrs = g_new0(DirectTCPAddr, 2); copy_sockaddr(&addrs[0], &addr); elt->output_listen_addrs = addrs; return TRUE; } static gboolean source_connect_start_impl( XferElement *elt) { XferSourceConnect *self = XFER_SOURCE_CONNECT(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(source_connect_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void source_connect_class_init( XferSourceConnectClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->setup = source_connect_setup_impl; xec->start = source_connect_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_source_connect_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceConnectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) source_connect_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceConnect), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceConnect", &info, 0); } return type; } /* READFD */ static GType xfer_dest_readfd_get_type(void); #define XFER_DEST_READFD_TYPE (xfer_dest_readfd_get_type()) #define XFER_DEST_READFD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_readfd_get_type(), XferDestReadfd) #define XFER_DEST_READFD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_readfd_get_type(), XferDestReadfd const) #define XFER_DEST_READFD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_readfd_get_type(), XferDestReadfdClass) #define IS_XFER_DEST_READFD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_readfd_get_type ()) #define XFER_DEST_READFD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_readfd_get_type(), XferDestReadfdClass) typedef struct XferDestReadfd { XferElement __parent__; GThread *thread; simpleprng_state_t prng; } XferDestReadfd; typedef struct { XferElementClass __parent__; } XferDestReadfdClass; static gpointer dest_readfd_thread( gpointer data) { XferDestReadfd *self = XFER_DEST_READFD(data); XferElement *elt = XFER_ELEMENT(data); char buf[TEST_XFER_SIZE]; size_t remaining; int fd = xfer_element_swap_output_fd(elt->upstream, -1); /* this shouldn't happen, although non-test elements handle it gracefully */ g_assert(fd != -1); remaining = sizeof(buf); while (remaining) { ssize_t nread; if ((nread = read(fd, buf+sizeof(buf)-remaining, remaining)) <= 0) { error("error in read(): %s", strerror(errno)); } remaining -= nread; } /* we should be at EOF here */ if (read(fd, buf, 10) != 0) g_critical("too much data entering XferDestReadfd"); if (!simpleprng_verify_buffer(&self->prng, buf, TEST_XFER_SIZE)) g_critical("data entering XferDestReadfd does not match"); close(fd); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean dest_readfd_start_impl( XferElement *elt) { XferDestReadfd *self = XFER_DEST_READFD(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(dest_readfd_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void dest_readfd_class_init( XferDestReadfdClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_READFD, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = dest_readfd_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_readfd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestReadfdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_readfd_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestReadfd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestReadfd", &info, 0); } return type; } /* WRITEFD */ static GType xfer_dest_writefd_get_type(void); #define XFER_DEST_WRITEFD_TYPE (xfer_dest_writefd_get_type()) #define XFER_DEST_WRITEFD(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_writefd_get_type(), XferDestWritefd) #define XFER_DEST_WRITEFD_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_writefd_get_type(), XferDestWritefd const) #define XFER_DEST_WRITEFD_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_writefd_get_type(), XferDestWritefdClass) #define IS_XFER_DEST_WRITEFD(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_writefd_get_type ()) #define XFER_DEST_WRITEFD_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_writefd_get_type(), XferDestWritefdClass) typedef struct XferDestWritefd { XferElement __parent__; int read_fd; GThread *thread; simpleprng_state_t prng; } XferDestWritefd; typedef struct { XferElementClass __parent__; } XferDestWritefdClass; static gpointer dest_writefd_thread( gpointer data) { XferDestWritefd *self = XFER_DEST_WRITEFD(data); char buf[TEST_XFER_SIZE]; size_t remaining; int fd = self->read_fd; remaining = sizeof(buf); while (remaining) { ssize_t nwrite; if ((nwrite = read(fd, buf+sizeof(buf)-remaining, remaining)) <= 0) { error("error in read(): %s", strerror(errno)); } remaining -= nwrite; } /* we should be at EOF here */ if (read(fd, buf, 10) != 0) g_critical("too much data entering XferDestWritefd"); if (!simpleprng_verify_buffer(&self->prng, buf, TEST_XFER_SIZE)) g_critical("data entering XferDestWritefd does not match"); close(fd); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean dest_writefd_setup_impl( XferElement *elt) { XferDestWritefd *self = XFER_DEST_WRITEFD(elt); int p[2]; simpleprng_seed(&self->prng, RANDOM_SEED); if (pipe(p) < 0) g_critical("Error from pipe(): %s", strerror(errno)); self->read_fd = p[0]; g_assert(xfer_element_swap_input_fd(elt, p[1]) == -1); return TRUE; } static gboolean dest_writefd_start_impl( XferElement *elt) { XferDestWritefd *self = XFER_DEST_WRITEFD(elt); self->thread = g_thread_create(dest_writefd_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void dest_writefd_class_init( XferDestWritefdClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_WRITEFD, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->setup = dest_writefd_setup_impl; xec->start = dest_writefd_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_writefd_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestWritefdClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_writefd_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestWritefd), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestWritefd", &info, 0); } return type; } /* PUSH_BUFFER */ static GType xfer_dest_push_get_type(void); #define XFER_DEST_PUSH_TYPE (xfer_dest_push_get_type()) #define XFER_DEST_PUSH(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_push_get_type(), XferDestPush) #define XFER_DEST_PUSH_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_push_get_type(), XferDestPush const) #define XFER_DEST_PUSH_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_push_get_type(), XferDestPushClass) #define IS_XFER_DEST_PUSH(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_push_get_type ()) #define XFER_DEST_PUSH_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_push_get_type(), XferDestPushClass) typedef struct XferDestPush { XferElement __parent__; char *buf; size_t bufpos; GThread *thread; simpleprng_state_t prng; } XferDestPush; typedef struct { XferElementClass __parent__; } XferDestPushClass; static void dest_push_push_buffer_impl( XferElement *elt, gpointer buf, size_t size) { XferDestPush *self = XFER_DEST_PUSH(elt); if (buf == NULL) { /* if we're at EOF, verify we got the right bytes */ g_assert(self->bufpos == TEST_XFER_SIZE); if (!simpleprng_verify_buffer(&self->prng, self->buf, TEST_XFER_SIZE)) g_critical("data entering XferDestPush does not match"); g_free(self->buf); return; } g_assert(self->bufpos + size <= TEST_XFER_SIZE); memcpy(self->buf + self->bufpos, buf, size); self->bufpos += size; } static gboolean dest_push_setup_impl( XferElement *elt) { XferDestPush *self = XFER_DEST_PUSH(elt); self->buf = g_malloc(TEST_XFER_SIZE); simpleprng_seed(&self->prng, RANDOM_SEED); return TRUE; } static void dest_push_class_init( XferDestPushClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->push_buffer = dest_push_push_buffer_impl; xec->setup = dest_push_setup_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_push_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestPushClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_push_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestPush), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestPush", &info, 0); } return type; } /* PULL_BUFFER */ static GType xfer_dest_pull_get_type(void); #define XFER_DEST_PULL_TYPE (xfer_dest_pull_get_type()) #define XFER_DEST_PULL(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_pull_get_type(), XferDestPull) #define XFER_DEST_PULL_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_pull_get_type(), XferDestPull const) #define XFER_DEST_PULL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_pull_get_type(), XferDestPullClass) #define IS_XFER_DEST_PULL(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_pull_get_type ()) #define XFER_DEST_PULL_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_pull_get_type(), XferDestPullClass) typedef struct XferDestPull { XferElement __parent__; GThread *thread; simpleprng_state_t prng; } XferDestPull; typedef struct { XferElementClass __parent__; } XferDestPullClass; static gpointer dest_pull_thread( gpointer data) { XferDestPull *self = XFER_DEST_PULL(data); char fullbuf[TEST_XFER_SIZE]; char *buf; size_t bufpos = 0; size_t size; while ((buf = xfer_element_pull_buffer(XFER_ELEMENT(self)->upstream, &size))) { g_assert(bufpos + size <= TEST_XFER_SIZE); memcpy(fullbuf + bufpos, buf, size); bufpos += size; } /* we're at EOF, so verify we got the right bytes */ g_assert(bufpos == TEST_XFER_SIZE); if (!simpleprng_verify_buffer(&self->prng, fullbuf, TEST_XFER_SIZE)) g_critical("data entering XferDestPull does not match"); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean dest_pull_start_impl( XferElement *elt) { XferDestPull *self = XFER_DEST_PULL(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(dest_pull_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void dest_pull_class_init( XferDestPullClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PULL_BUFFER, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = dest_pull_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_pull_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestPullClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_pull_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestPull), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestPull", &info, 0); } return type; } /* LISTEN */ static GType xfer_dest_listen_get_type(void); #define XFER_DEST_LISTEN_TYPE (xfer_dest_listen_get_type()) #define XFER_DEST_LISTEN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_listen_get_type(), XferDestListen) #define XFER_DEST_LISTEN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_listen_get_type(), XferDestListen const) #define XFER_DEST_LISTEN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_listen_get_type(), XferDestListenClass) #define IS_XFER_DEST_LISTEN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_listen_get_type ()) #define XFER_DEST_LISTEN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_listen_get_type(), XferDestListenClass) typedef struct XferDestListen { XferElement __parent__; int listen_socket; GThread *thread; simpleprng_state_t prng; } XferDestListen; typedef struct { XferElementClass __parent__; } XferDestListenClass; static gpointer dest_listen_thread( gpointer data) { XferDestListen *self = XFER_DEST_LISTEN(data); char *buf; size_t bytes = 0; int sock; g_assert(self->listen_socket != -1); if ((sock = accept(self->listen_socket, NULL, NULL)) == -1) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Error accepting incoming connection: %s"), strerror(errno)); wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer); return NULL; } /* close the listening socket now, for good measure */ close(self->listen_socket); self->listen_socket = -1; /* read from the socket until EOF or all of the data is read. We try to * read one extra byte - if we get it, then upstream sent too much data */ buf = g_malloc(TEST_XFER_SIZE+1); bytes = full_read(sock, buf, TEST_XFER_SIZE+1); g_assert(bytes == TEST_XFER_SIZE); close(sock); /* we're at EOF, so verify we got the right bytes */ g_assert(bytes == TEST_XFER_SIZE); if (!simpleprng_verify_buffer(&self->prng, buf, TEST_XFER_SIZE)) g_critical("data entering XferDestListen does not match"); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean dest_listen_setup_impl( XferElement *elt) { XferDestListen *self = XFER_DEST_LISTEN(elt); sockaddr_union addr; DirectTCPAddr *addrs; socklen_t len; int sock; /* set up self->listen_socket and set elt->input_listen_addrs */ sock = self->listen_socket = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) error("socket(): %s", strerror(errno)); if (listen(sock, 1) < 0) error("listen(): %s", strerror(errno)); len = sizeof(addr); if (getsockname(sock, (struct sockaddr *)&addr, &len) < 0) error("getsockname(): %s", strerror(errno)); g_assert(SU_GET_FAMILY(&addr) == AF_INET); addrs = g_new0(DirectTCPAddr, 2); copy_sockaddr(&addrs[0], &addr); elt->input_listen_addrs = addrs; return TRUE; } static gboolean dest_listen_start_impl( XferElement *elt) { XferDestListen *self = XFER_DEST_LISTEN(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(dest_listen_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void dest_listen_class_init( XferDestListenClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->setup = dest_listen_setup_impl; xec->start = dest_listen_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_listen_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestListenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_listen_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestListen), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestListen", &info, 0); } return type; } /* CONNET */ static GType xfer_dest_connect_get_type(void); #define XFER_DEST_CONNECT_TYPE (xfer_dest_connect_get_type()) #define XFER_DEST_CONNECT(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_connect_get_type(), XferDestConnect) #define XFER_DEST_CONNECT_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_connect_get_type(), XferDestConnect const) #define XFER_DEST_CONNECT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_connect_get_type(), XferDestConnectClass) #define IS_XFER_DEST_CONNECT(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_connect_get_type ()) #define XFER_DEST_CONNECT_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_connect_get_type(), XferDestConnectClass) typedef struct XferDestConnect { XferElement __parent__; int connect_socket; GThread *thread; simpleprng_state_t prng; } XferDestConnect; typedef struct { XferElementClass __parent__; } XferDestConnectClass; static gpointer dest_connect_thread( gpointer data) { XferDestConnect *self = XFER_DEST_CONNECT(data); XferElement *elt = XFER_ELEMENT(self); DirectTCPAddr *addrs; sockaddr_union addr; char *buf; size_t bytes = 0; int sock; /* set up the sockaddr -- IPv4 only */ SU_INIT(&addr, AF_INET); addrs = elt->upstream->output_listen_addrs; g_assert(addrs != NULL); copy_sockaddr(&addr, addrs); tu_dbg("making data connection to %s\n", str_sockaddr(&addr)); sock = socket(SU_GET_FAMILY(&addr), SOCK_STREAM, 0); if (sock < 0) { error("socket(): %s", strerror(errno)); } if (connect(sock, (struct sockaddr *)&addr, SS_LEN(&addr)) < 0) { error("connect(): %s", strerror(errno)); } tu_dbg("connected to %s\n", str_sockaddr(&addr)); /* read from the socket until EOF or all of the data is read. We try to * read one extra byte - if we get it, then upstream sent too much data */ buf = g_malloc(TEST_XFER_SIZE+1); bytes = full_read(sock, buf, TEST_XFER_SIZE+1); g_assert(bytes == TEST_XFER_SIZE); close(sock); /* we're at EOF, so verify we got the right bytes */ g_assert(bytes == TEST_XFER_SIZE); if (!simpleprng_verify_buffer(&self->prng, buf, TEST_XFER_SIZE)) g_critical("data entering XferDestConnect does not match"); xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } static gboolean dest_connect_start_impl( XferElement *elt) { XferDestConnect *self = XFER_DEST_CONNECT(elt); simpleprng_seed(&self->prng, RANDOM_SEED); self->thread = g_thread_create(dest_connect_thread, (gpointer)self, FALSE, NULL); return TRUE; } static void dest_connect_class_init( XferDestConnectClass * klass) { XferElementClass *xec = XFER_ELEMENT_CLASS(klass); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xec->start = dest_connect_start_impl; xec->mech_pairs = mech_pairs; } GType xfer_dest_connect_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestConnectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dest_connect_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestConnect), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestConnect", &info, 0); } return type; } /* * Tests */ static void test_xfer_generic_callback( gpointer data G_GNUC_UNUSED, XMsg *msg, Xfer *xfer) { tu_dbg("Received message %s\n", xmsg_repr(msg)); switch (msg->type) { case XMSG_DONE: /* are we done? */ if (xfer->status == XFER_DONE) { tu_dbg("all elements are done!\n"); g_main_loop_quit(default_main_loop()); } break; default: break; } } /**** * Run a simple transfer with some xor filters */ static int test_xfer_simple(void) { unsigned int i; GSource *src; XferElement *elements[] = { xfer_source_random(100*1024, RANDOM_SEED), xfer_filter_xor('d'), xfer_filter_xor('d'), xfer_dest_null(RANDOM_SEED), }; Xfer *xfer = xfer_new(elements, sizeof(elements)/sizeof(*elements)); src = xfer_get_source(xfer); g_source_set_callback(src, (GSourceFunc)test_xfer_generic_callback, NULL, NULL); g_source_attach(src, NULL); tu_dbg("Transfer: %s\n", xfer_repr(xfer)); /* unreference the elements */ for (i = 0; i < sizeof(elements)/sizeof(*elements); i++) { g_object_unref(elements[i]); g_assert(G_OBJECT(elements[i])->ref_count == 1); elements[i] = NULL; } xfer_start(xfer, 0, 0); g_main_loop_run(default_main_loop()); g_assert(xfer->status == XFER_DONE); xfer_unref(xfer); return 1; } /**** * Run a transfer between two files, with or without filters */ static int test_xfer_files(gboolean add_filters) { unsigned int i; unsigned int elts; GSource *src; char *in_filename = __FILE__; char *out_filename = "xfer-test.tmp"; /* current directory is writeable */ int rfd, wfd; Xfer *xfer; XferElement *elements[4]; rfd = open(in_filename, O_RDONLY, 0); if (rfd < 0) g_critical("Could not open '%s': %s", in_filename, strerror(errno)); wfd = open(out_filename, O_WRONLY|O_CREAT, 0777); if (wfd < 0) g_critical("Could not open '%s': %s", out_filename, strerror(errno)); elts = 0; elements[elts++] = xfer_source_fd(rfd); if (add_filters) { elements[elts++] = xfer_filter_xor(0xab); elements[elts++] = xfer_filter_xor(0xab); } elements[elts++] = xfer_dest_fd(wfd); xfer = xfer_new(elements, elts); src = xfer_get_source(xfer); g_source_set_callback(src, (GSourceFunc)test_xfer_generic_callback, NULL, NULL); g_source_attach(src, NULL); tu_dbg("Transfer: %s\n", xfer_repr(xfer)); /* unreference the elements */ for (i = 0; i < elts; i++) { g_object_unref(elements[i]); g_assert(G_OBJECT(elements[i])->ref_count == 1); elements[i] = NULL; } xfer_start(xfer, 0, 0); g_main_loop_run(default_main_loop()); g_assert(xfer->status == XFER_DONE); xfer_unref(xfer); unlink(out_filename); /* ignore any errors */ return 1; } static int test_xfer_files_simple(void) { return test_xfer_files(FALSE); } static int test_xfer_files_filter(void) { return test_xfer_files(TRUE); } /***** * test each possible combination of source and destination mechansim */ static int test_glue_combo( XferElement *source, XferElement *dest) { unsigned int i; GSource *src; XferElement *elements[] = { source, dest }; Xfer *xfer = xfer_new(elements, sizeof(elements)/sizeof(*elements)); src = xfer_get_source(xfer); g_source_set_callback(src, (GSourceFunc)test_xfer_generic_callback, NULL, NULL); g_source_attach(src, NULL); /* unreference the elements */ for (i = 0; i < sizeof(elements)/sizeof(*elements); i++) { g_object_unref(elements[i]); g_assert(G_OBJECT(elements[i])->ref_count == 1); elements[i] = NULL; } xfer_start(xfer, 0, 0); g_main_loop_run(default_main_loop()); g_assert(xfer->status == XFER_DONE); xfer_unref(xfer); return 1; } #define make_test_glue(n, s, d) static int n(void) \ {\ return test_glue_combo((XferElement *)g_object_new(s, NULL), \ (XferElement *)g_object_new(d, NULL)); \ } make_test_glue(test_glue_READFD_READFD, XFER_SOURCE_READFD_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_READFD_WRITEFD, XFER_SOURCE_READFD_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_READFD_PUSH, XFER_SOURCE_READFD_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_READFD_PULL, XFER_SOURCE_READFD_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_READFD_LISTEN, XFER_SOURCE_READFD_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_READFD_CONNECT, XFER_SOURCE_READFD_TYPE, XFER_DEST_CONNECT_TYPE) make_test_glue(test_glue_WRITEFD_READFD, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_WRITEFD_WRITEFD, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_WRITEFD_PUSH, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_WRITEFD_PULL, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_WRITEFD_LISTEN, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_WRITEFD_CONNECT, XFER_SOURCE_WRITEFD_TYPE, XFER_DEST_CONNECT_TYPE) make_test_glue(test_glue_PUSH_READFD, XFER_SOURCE_PUSH_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_PUSH_WRITEFD, XFER_SOURCE_PUSH_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_PUSH_PUSH, XFER_SOURCE_PUSH_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_PUSH_PULL, XFER_SOURCE_PUSH_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_PUSH_LISTEN, XFER_SOURCE_PUSH_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_PUSH_CONNECT, XFER_SOURCE_PUSH_TYPE, XFER_DEST_CONNECT_TYPE) make_test_glue(test_glue_PULL_READFD, XFER_SOURCE_PULL_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_PULL_WRITEFD, XFER_SOURCE_PULL_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_PULL_PUSH, XFER_SOURCE_PULL_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_PULL_PULL, XFER_SOURCE_PULL_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_PULL_LISTEN, XFER_SOURCE_PULL_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_PULL_CONNECT, XFER_SOURCE_PULL_TYPE, XFER_DEST_CONNECT_TYPE) make_test_glue(test_glue_LISTEN_READFD, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_LISTEN_WRITEFD, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_LISTEN_PUSH, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_LISTEN_PULL, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_LISTEN_LISTEN, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_LISTEN_CONNECT, XFER_SOURCE_LISTEN_TYPE, XFER_DEST_CONNECT_TYPE) make_test_glue(test_glue_CONNECT_READFD, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_READFD_TYPE) make_test_glue(test_glue_CONNECT_WRITEFD, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_WRITEFD_TYPE) make_test_glue(test_glue_CONNECT_PUSH, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_PUSH_TYPE) make_test_glue(test_glue_CONNECT_PULL, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_PULL_TYPE) make_test_glue(test_glue_CONNECT_LISTEN, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_LISTEN_TYPE) make_test_glue(test_glue_CONNECT_CONNECT, XFER_SOURCE_CONNECT_TYPE, XFER_DEST_CONNECT_TYPE) /* * Main driver */ int main(int argc, char **argv) { static TestUtilsTest tests[] = { TU_TEST(test_xfer_simple, 90), TU_TEST(test_xfer_files_simple, 90), TU_TEST(test_xfer_files_filter, 90), TU_TEST(test_glue_READFD_READFD, 90), TU_TEST(test_glue_READFD_WRITEFD, 90), TU_TEST(test_glue_READFD_PUSH, 90), TU_TEST(test_glue_READFD_PULL, 90), TU_TEST(test_glue_READFD_LISTEN, 90), TU_TEST(test_glue_READFD_CONNECT, 90), TU_TEST(test_glue_WRITEFD_READFD, 90), TU_TEST(test_glue_WRITEFD_WRITEFD, 90), TU_TEST(test_glue_WRITEFD_PUSH, 90), TU_TEST(test_glue_WRITEFD_PULL, 90), TU_TEST(test_glue_WRITEFD_LISTEN, 90), TU_TEST(test_glue_WRITEFD_CONNECT, 90), TU_TEST(test_glue_PUSH_READFD, 90), TU_TEST(test_glue_PUSH_WRITEFD, 90), TU_TEST(test_glue_PUSH_PUSH, 90), TU_TEST(test_glue_PUSH_PULL, 90), TU_TEST(test_glue_PUSH_LISTEN, 90), TU_TEST(test_glue_PUSH_CONNECT, 90), TU_TEST(test_glue_PULL_READFD, 90), TU_TEST(test_glue_PULL_WRITEFD, 90), TU_TEST(test_glue_PULL_PUSH, 90), TU_TEST(test_glue_PULL_PULL, 90), TU_TEST(test_glue_PULL_LISTEN, 90), TU_TEST(test_glue_PULL_CONNECT, 90), TU_TEST(test_glue_LISTEN_READFD, 90), TU_TEST(test_glue_LISTEN_WRITEFD, 90), TU_TEST(test_glue_LISTEN_PUSH, 90), TU_TEST(test_glue_LISTEN_PULL, 90), TU_TEST(test_glue_LISTEN_LISTEN, 90), TU_TEST(test_glue_LISTEN_CONNECT, 90), TU_TEST(test_glue_CONNECT_READFD, 90), TU_TEST(test_glue_CONNECT_WRITEFD, 90), TU_TEST(test_glue_CONNECT_PUSH, 90), TU_TEST(test_glue_CONNECT_PULL, 90), TU_TEST(test_glue_CONNECT_LISTEN, 90), TU_TEST(test_glue_CONNECT_CONNECT, 90), TU_END() }; glib_init(); return testutils_run_tests(argc, argv, tests); } amanda-3.3.6/xfer-src/element-glue.c0000664000076400007640000011657712357250004020737 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "element-glue.h" #include "directtcp.h" #include "util.h" #include "sockaddr-util.h" #include "stream.h" #include "debug.h" /* * Instance definition */ typedef struct XferElementGlue_ { XferElement __parent__; /* instructions to push_buffer_impl */ enum { PUSH_TO_RING_BUFFER, PUSH_TO_FD, /* write to write_fd */ PUSH_INVALID, PUSH_ACCEPT_FIRST = (1 << 16), PUSH_CONNECT_FIRST = (2 << 16), } on_push; /* instructions to pull_buffer_impl */ enum { PULL_FROM_RING_BUFFER, PULL_FROM_FD, /* read from read_fd */ PULL_INVALID, PULL_ACCEPT_FIRST = (1 << 16), PULL_CONNECT_FIRST = (2 << 16), } on_pull; int *write_fdp; int *read_fdp; gboolean need_thread; /* the stuff we might use, depending on what flavor of glue we're * providing.. */ int pipe[2]; int input_listen_socket, output_listen_socket; int input_data_socket, output_data_socket; int read_fd, write_fd; /* a ring buffer of ptr/size pairs with semaphores */ struct { gpointer buf; size_t size; } *ring; amsemaphore_t *ring_used_sem, *ring_free_sem; gint ring_head, ring_tail; GThread *thread; GThreadFunc threadfunc; } XferElementGlue; /* * Class definition */ typedef struct XferElementGlueClass_ { XferElementClass __parent__; } XferElementGlueClass; static GObjectClass *parent_class = NULL; /* * Utility functions, etc. */ static void make_pipe( XferElementGlue *self) { if (pipe(self->pipe) < 0) g_critical(_("Could not create pipe: %s"), strerror(errno)); } static void send_xfer_done( XferElementGlue *self) { xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new((XferElement *)self, XMSG_DONE, 0)); } static gboolean do_directtcp_listen( XferElement *elt, int *sockp, DirectTCPAddr **addrsp) { int sock; sockaddr_union data_addr; DirectTCPAddr *addrs; socklen_t len; struct addrinfo *res; struct addrinfo *res_addr; sockaddr_union *addr = NULL; if (resolve_hostname("localhost", 0, &res, NULL) != 0) { xfer_cancel_with_error(elt, "resolve_hostname(): %s", strerror(errno)); return FALSE; } for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { if (res_addr->ai_family == AF_INET) { addr = (sockaddr_union *)res_addr->ai_addr; break; } } if (!addr) { addr = (sockaddr_union *)res->ai_addr; } sock = *sockp = socket(SU_GET_FAMILY(addr), SOCK_STREAM, 0); if (sock < 0) { xfer_cancel_with_error(elt, "socket(): %s", strerror(errno)); return FALSE; } len = SS_LEN(addr); if (bind(sock, (struct sockaddr *)addr, len) != 0) { xfer_cancel_with_error(elt, "bind(): %s", strerror(errno)); freeaddrinfo(res); return FALSE; } if (listen(sock, 1) < 0) { xfer_cancel_with_error(elt, "listen(): %s", strerror(errno)); return FALSE; } /* TODO: which addresses should this display? all ifaces? localhost? */ len = sizeof(data_addr); if (getsockname(sock, (struct sockaddr *)&data_addr, &len) < 0) error("getsockname(): %s", strerror(errno)); addrs = g_new0(DirectTCPAddr, 2); copy_sockaddr(&addrs[0], &data_addr); *addrsp = addrs; return TRUE; } static gboolean prolong_accept( gpointer data) { return !XFER_ELEMENT(data)->cancelled; } static int do_directtcp_accept( XferElementGlue *self, int *socketp) { int sock; g_assert(*socketp != -1); if ((sock = interruptible_accept(*socketp, NULL, NULL, prolong_accept, self)) == -1) { /* if the accept was interrupted due to a cancellation, then do not * add a further error message */ if (errno == 0 && XFER_ELEMENT(self)->cancelled) return -1; xfer_cancel_with_error(XFER_ELEMENT(self), _("Error accepting incoming connection: %s"), strerror(errno)); wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer); return -1; } /* close the listening socket now, for good measure */ close(*socketp); *socketp = -1; g_debug("do_directtcp_accept: %d", sock); return sock; } static int do_directtcp_connect( XferElementGlue *self, DirectTCPAddr *addrs) { XferElement *elt = XFER_ELEMENT(self); sockaddr_union addr; int sock; #ifdef WORKING_IPV6 char strsockaddr[INET6_ADDRSTRLEN + 20]; #else char strsockaddr[INET_ADDRSTRLEN + 20]; #endif if (!addrs) { g_debug("element-glue got no directtcp addresses to connect to!"); if (!elt->cancelled) { xfer_cancel_with_error(elt, "%s got no directtcp addresses to connect to", xfer_element_repr(elt)); } goto cancel_wait; } /* set up the sockaddr -- IPv4 only */ copy_sockaddr(&addr, addrs); str_sockaddr_r(&addr, strsockaddr, sizeof(strsockaddr)); if (strncmp(strsockaddr,"255.255.255.255:", 16) == 0) { char buffer[32770]; char *s; int size; char *data_host; int data_port; g_debug("do_directtcp_connect making indirect data connection to %s", strsockaddr); data_port = SU_GET_PORT(&addr); sock = stream_client("localhost", data_port, STREAM_BUFSIZE, 0, NULL, 0); if (sock < 0) { xfer_cancel_with_error(elt, "stream_client(): %s", strerror(errno)); goto cancel_wait; } size = full_read(sock, buffer, 32768); if (size < 0 ) { xfer_cancel_with_error(elt, "failed to read from indirecttcp: %s", strerror(errno)); goto cancel_wait; } close(sock); buffer[size++] = ' '; buffer[size] = '\0'; if ((s = strchr(buffer, ':')) == NULL) { xfer_cancel_with_error(elt, "Failed to parse indirect data stream: %s", buffer); goto cancel_wait; } *s++ = '\0'; data_host = buffer; data_port = atoi(s); str_to_sockaddr(data_host, &addr); SU_SET_PORT(&addr, data_port); str_sockaddr_r(&addr, strsockaddr, sizeof(strsockaddr)); } sock = socket(SU_GET_FAMILY(&addr), SOCK_STREAM, 0); g_debug("do_directtcp_connect making data connection to %s", strsockaddr); if (sock < 0) { xfer_cancel_with_error(elt, "socket(): %s", strerror(errno)); goto cancel_wait; } if (connect(sock, (struct sockaddr *)&addr, SS_LEN(&addr)) < 0) { xfer_cancel_with_error(elt, "connect(): %s", strerror(errno)); goto cancel_wait; } g_debug("do_directtcp_connect: connected to %s, fd %d", strsockaddr, sock); return sock; cancel_wait: wait_until_xfer_cancelled(elt->xfer); return -1; } #define GLUE_BUFFER_SIZE 32768 #define GLUE_RING_BUFFER_SIZE 32 #define mech_pair(IN,OUT) ((IN)*XFER_MECH_MAX+(OUT)) /* * fd handling */ /* if self->read_fdp or self->write_fdp are pointing to this integer, then they * should be redirected to point to the upstream's output_fd or downstream's * input_fd, respectively, at the first call to get_read_fd or get_write_fd, * respectively. */ static int neighboring_element_fd = -1; #define get_read_fd(self) (((self)->read_fd == -1)? _get_read_fd((self)) : (self)->read_fd) static int _get_read_fd(XferElementGlue *self) { if (!self->read_fdp) return -1; /* shouldn't happen.. */ if (self->read_fdp == &neighboring_element_fd) { XferElement *elt = XFER_ELEMENT(self); self->read_fd = xfer_element_swap_output_fd(elt->upstream, -1); } else { self->read_fd = *self->read_fdp; *self->read_fdp = -1; } self->read_fdp = NULL; return self->read_fd; } #define get_write_fd(self) (((self)->write_fd == -1)? _get_write_fd((self)) : (self)->write_fd) static int _get_write_fd(XferElementGlue *self) { if (!self->write_fdp) return -1; /* shouldn't happen.. */ if (self->write_fdp == &neighboring_element_fd) { XferElement *elt = XFER_ELEMENT(self); self->write_fd = xfer_element_swap_input_fd(elt->downstream, -1); } else { self->write_fd = *self->write_fdp; *self->write_fdp = -1; } self->write_fdp = NULL; return self->write_fd; } static int close_read_fd(XferElementGlue *self) { int fd = get_read_fd(self); self->read_fd = -1; return close(fd); } static int close_write_fd(XferElementGlue *self) { int fd = get_write_fd(self); self->write_fd = -1; return close(fd); } /* * Worker thread utility functions */ static void pull_and_write(XferElementGlue *self) { XferElement *elt = XFER_ELEMENT(self); int fd = get_write_fd(self); self->write_fdp = NULL; while (!elt->cancelled) { size_t len; char *buf; /* get a buffer from upstream */ buf = xfer_element_pull_buffer(elt->upstream, &len); if (!buf) break; /* write it */ if (!elt->downstream->drain_mode && full_write(fd, buf, len) < len) { if (elt->downstream->must_drain) { g_debug("Error writing to fd %d: %s", fd, strerror(errno)); } else if (elt->downstream->ignore_broken_pipe && errno == EPIPE) { } else { if (!elt->cancelled) { xfer_cancel_with_error(elt, _("Error writing to fd %d: %s"), fd, strerror(errno)); xfer_cancel(elt->xfer); wait_until_xfer_cancelled(elt->xfer); } amfree(buf); break; } elt->downstream->drain_mode = TRUE; } amfree(buf); } if (elt->cancelled && elt->expect_eof) xfer_element_drain_buffers(elt->upstream); /* close the fd we've been writing, as an EOF signal to downstream, and * set it to -1 to avoid accidental re-use */ close_write_fd(self); } static void read_and_write(XferElementGlue *self) { XferElement *elt = XFER_ELEMENT(self); /* dynamically allocate a buffer, in case this thread has * a limited amount of stack allocated */ char *buf = g_malloc(GLUE_BUFFER_SIZE); int rfd = get_read_fd(self); int wfd = get_write_fd(self); g_debug("read_and_write: read from %d, write to %d", rfd, wfd); while (!elt->cancelled) { size_t len; /* read from upstream */ len = full_read(rfd, buf, GLUE_BUFFER_SIZE); if (len < GLUE_BUFFER_SIZE) { if (errno) { if (!elt->cancelled) { xfer_cancel_with_error(elt, _("Error reading from fd %d: %s"), rfd, strerror(errno)); wait_until_xfer_cancelled(elt->xfer); } break; } else if (len == 0) { /* we only count a zero-length read as EOF */ break; } } /* write the buffer fully */ if (!elt->downstream->drain_mode && full_write(wfd, buf, len) < len) { if (elt->downstream->must_drain) { g_debug("Could not write to fd %d: %s", wfd, strerror(errno)); } else if (elt->downstream->ignore_broken_pipe && errno == EPIPE) { } else { if (!elt->cancelled) { xfer_cancel_with_error(elt, _("Could not write to fd %d: %s"), wfd, strerror(errno)); wait_until_xfer_cancelled(elt->xfer); } break; } } } if (elt->cancelled && elt->expect_eof) xfer_element_drain_fd(rfd); /* close the read fd. If it's not at EOF, then upstream will get EPIPE, which will hopefully * kill it and complete the cancellation */ close_read_fd(self); /* close the fd we've been writing, as an EOF signal to downstream */ close_write_fd(self); amfree(buf); } static void read_and_push( XferElementGlue *self) { XferElement *elt = XFER_ELEMENT(self); int fd = get_read_fd(self); while (!elt->cancelled) { char *buf = g_malloc(GLUE_BUFFER_SIZE); size_t len; /* read a buffer from upstream */ len = full_read(fd, buf, GLUE_BUFFER_SIZE); if (len < GLUE_BUFFER_SIZE) { if (errno) { if (!elt->cancelled) { int saved_errno = errno; xfer_cancel_with_error(elt, _("Error reading from fd %d: %s"), fd, strerror(saved_errno)); g_debug("element-glue: error reading from fd %d: %s", fd, strerror(saved_errno)); wait_until_xfer_cancelled(elt->xfer); } amfree(buf); break; } else if (len == 0) { /* we only count a zero-length read as EOF */ amfree(buf); break; } } xfer_element_push_buffer(elt->downstream, buf, len); } if (elt->cancelled && elt->expect_eof) xfer_element_drain_fd(fd); /* send an EOF indication downstream */ xfer_element_push_buffer(elt->downstream, NULL, 0); /* close the read fd, since it's at EOF */ close_read_fd(self); } static void pull_and_push(XferElementGlue *self) { XferElement *elt = XFER_ELEMENT(self); gboolean eof_sent = FALSE; while (!elt->cancelled) { char *buf; size_t len; /* get a buffer from upstream */ buf = xfer_element_pull_buffer(elt->upstream, &len); /* and push it downstream */ xfer_element_push_buffer(elt->downstream, buf, len); if (!buf) { eof_sent = TRUE; break; } } if (elt->cancelled && elt->expect_eof) xfer_element_drain_buffers(elt->upstream); if (!eof_sent) xfer_element_push_buffer(elt->downstream, NULL, 0); } static gpointer worker_thread( gpointer data) { XferElement *elt = XFER_ELEMENT(data); XferElementGlue *self = XFER_ELEMENT_GLUE(data); switch (mech_pair(elt->input_mech, elt->output_mech)) { case mech_pair(XFER_MECH_READFD, XFER_MECH_WRITEFD): read_and_write(self); break; case mech_pair(XFER_MECH_READFD, XFER_MECH_PUSH_BUFFER): case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER): read_and_push(self); break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_READFD): case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_WRITEFD): pull_and_write(self); break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_PUSH_BUFFER): pull_and_push(self); break; case mech_pair(XFER_MECH_READFD, XFER_MECH_DIRECTTCP_LISTEN): case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN): if ((self->output_data_socket = do_directtcp_connect(self, elt->downstream->input_listen_addrs)) == -1) break; self->write_fdp = &self->output_data_socket; read_and_write(self); break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_LISTEN): if ((self->output_data_socket = do_directtcp_connect(self, elt->downstream->input_listen_addrs)) == -1) break; self->write_fdp = &self->output_data_socket; pull_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD): case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_WRITEFD): if ((self->input_data_socket = do_directtcp_accept(self, &self->input_listen_socket)) == -1) break; self->read_fdp = &self->input_data_socket; read_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PUSH_BUFFER): if ((self->input_data_socket = do_directtcp_accept(self, &self->input_listen_socket)) == -1) break; self->read_fdp = &self->input_data_socket; read_and_push(self); break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PULL_BUFFER): case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PULL_BUFFER): case mech_pair(XFER_MECH_READFD, XFER_MECH_PULL_BUFFER): case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_READFD): case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER): case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD): case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_WRITEFD): case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_PULL_BUFFER): case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_LISTEN): case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_CONNECT): default: g_assert_not_reached(); break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT): case mech_pair(XFER_MECH_READFD, XFER_MECH_DIRECTTCP_CONNECT): if ((self->output_data_socket = do_directtcp_accept(self, &self->output_listen_socket)) == -1) break; self->write_fdp = &self->output_data_socket; read_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_WRITEFD): case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD): if ((self->input_data_socket = do_directtcp_connect(self, elt->upstream->output_listen_addrs)) == -1) break; self->read_fdp = &self->input_data_socket; read_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PUSH_BUFFER): if ((self->input_data_socket = do_directtcp_connect(self, elt->upstream->output_listen_addrs)) == -1) break; self->read_fdp = &self->input_data_socket; read_and_push(self); break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_CONNECT): if ((self->output_data_socket = do_directtcp_accept(self, &self->output_listen_socket)) == -1) break; self->write_fdp = &self->output_data_socket; pull_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_DIRECTTCP_CONNECT): /* TODO: use async accept's here to avoid order dependency */ if ((self->output_data_socket = do_directtcp_accept(self, &self->output_listen_socket)) == -1) break; self->write_fdp = &self->output_data_socket; if ((self->input_data_socket = do_directtcp_accept(self, &self->input_listen_socket)) == -1) break; self->read_fdp = &self->input_data_socket; read_and_write(self); break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_DIRECTTCP_LISTEN): /* TODO: use async connects and select() to avoid order dependency here */ if ((self->input_data_socket = do_directtcp_connect(self, elt->upstream->output_listen_addrs)) == -1) break; self->read_fdp = &self->input_data_socket; if ((self->output_data_socket = do_directtcp_connect(self, elt->downstream->input_listen_addrs)) == -1) break; self->write_fdp = &self->output_data_socket; read_and_write(self); break; } send_xfer_done(self); return NULL; } /* * Implementation */ static gboolean setup_impl( XferElement *elt) { XferElementGlue *self = (XferElementGlue *)elt; gboolean need_ring = FALSE; gboolean need_listen_input = FALSE; gboolean need_listen_output = FALSE; g_assert(elt->input_mech != XFER_MECH_NONE); g_assert(elt->output_mech != XFER_MECH_NONE); g_assert(elt->input_mech != elt->output_mech); self->read_fdp = NULL; self->write_fdp = NULL; self->on_push = PUSH_INVALID; self->on_pull = PULL_INVALID; self->need_thread = FALSE; switch (mech_pair(elt->input_mech, elt->output_mech)) { case mech_pair(XFER_MECH_READFD, XFER_MECH_WRITEFD): /* thread will read from one fd and write to the other */ self->read_fdp = &neighboring_element_fd; self->write_fdp = &neighboring_element_fd; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_READFD, XFER_MECH_PUSH_BUFFER): /* thread will read from one fd and call push_buffer downstream */ self->read_fdp = &neighboring_element_fd; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_READFD, XFER_MECH_PULL_BUFFER): self->read_fdp = &neighboring_element_fd; self->on_pull = PULL_FROM_FD; break; case mech_pair(XFER_MECH_READFD, XFER_MECH_DIRECTTCP_LISTEN): /* thread will connect for output, then read from fd and write to the * socket. */ self->read_fdp = &neighboring_element_fd; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_READFD, XFER_MECH_DIRECTTCP_CONNECT): /* thread will accept output conn, then read from upstream and write to socket */ self->read_fdp = &neighboring_element_fd; self->need_thread = TRUE; need_listen_output = TRUE; break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_READFD): make_pipe(self); g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1); self->pipe[1] = -1; /* upstream will close this for us */ g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1); self->pipe[0] = -1; /* downstream will close this for us */ break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER): /* thread will read from pipe and call downstream's push_buffer */ make_pipe(self); g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1); self->pipe[1] = -1; /* upstream will close this for us */ self->read_fdp = &self->pipe[0]; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER): make_pipe(self); g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1); self->pipe[1] = -1; /* upstream will close this for us */ self->on_pull = PULL_FROM_FD; self->read_fdp = &self->pipe[0]; break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN): /* thread will connect for output, then read from pipe and write to socket */ make_pipe(self); g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1); self->pipe[1] = -1; /* upstream will close this for us */ self->read_fdp = &self->pipe[0]; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT): /* thread will accept output conn, then read from pipe and write to socket */ make_pipe(self); g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1); self->pipe[1] = -1; /* upstream will close this for us */ self->read_fdp = &self->pipe[0]; self->need_thread = TRUE; need_listen_output = TRUE; break; case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD): make_pipe(self); g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1); self->pipe[0] = -1; /* downstream will close this for us */ self->on_push = PUSH_TO_FD; self->write_fdp = &self->pipe[1]; break; case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_WRITEFD): self->on_push = PUSH_TO_FD; self->write_fdp = &neighboring_element_fd; break; case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_PULL_BUFFER): self->on_push = PUSH_TO_RING_BUFFER; self->on_pull = PULL_FROM_RING_BUFFER; need_ring = TRUE; break; case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_LISTEN): /* push will connect for output first */ self->on_push = PUSH_TO_FD | PUSH_CONNECT_FIRST; break; case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_CONNECT): /* push will accept for output first */ self->on_push = PUSH_TO_FD | PUSH_ACCEPT_FIRST; need_listen_output = TRUE; break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_READFD): /* thread will pull from upstream and write to pipe */ make_pipe(self); g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1); self->pipe[0] = -1; /* downstream will close this for us */ self->write_fdp = &self->pipe[1]; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_WRITEFD): /* thread will pull from upstream and write to downstream */ self->write_fdp = &neighboring_element_fd; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_PUSH_BUFFER): /* thread will pull from upstream and push to downstream */ self->need_thread = TRUE; break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_LISTEN): /* thread will connect for output, then pull from upstream and write to socket */ self->need_thread = TRUE; break; case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_CONNECT): /* thread will accept for output, then pull from upstream and write to socket */ self->need_thread = TRUE; need_listen_output = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD): /* thread will accept for input, then read from socket and write to pipe */ make_pipe(self); g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1); self->pipe[0] = -1; /* downstream will close this for us */ self->write_fdp = &self->pipe[1]; self->need_thread = TRUE; need_listen_input = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_WRITEFD): /* thread will accept for input, then read from socket and write to downstream */ self->write_fdp = &neighboring_element_fd; self->need_thread = TRUE; need_listen_input = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PUSH_BUFFER): /* thread will accept for input, then read from socket and push downstream */ self->need_thread = TRUE; need_listen_input = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PULL_BUFFER): /* first pull will accept for input, then read from socket */ self->on_pull = PULL_FROM_FD | PULL_ACCEPT_FIRST; need_listen_input = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_DIRECTTCP_CONNECT): /* thread will accept on both sides, then copy from socket to socket */ self->need_thread = TRUE; need_listen_input = TRUE; need_listen_output = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD): /* thread will connect for input, then read from socket and write to pipe */ make_pipe(self); g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1); self->pipe[0] = -1; /* downstream will close this for us */ self->write_fdp = &self->pipe[1]; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_WRITEFD): /* thread will connect for input, then read from socket and write to downstream */ self->write_fdp = &neighboring_element_fd; self->need_thread = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PUSH_BUFFER): /* thread will connect for input, then read from socket and push downstream */ self->need_thread = TRUE; break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PULL_BUFFER): /* first pull will connect for input, then read from socket */ self->on_pull = PULL_FROM_FD | PULL_CONNECT_FIRST; break; case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_DIRECTTCP_LISTEN): /* thread will connect on both sides, then copy from socket to socket */ self->on_pull = PULL_FROM_FD | PULL_ACCEPT_FIRST; self->need_thread = TRUE; break; default: g_assert_not_reached(); break; } /* set up ring if desired */ if (need_ring) { self->ring = g_try_malloc(sizeof(*self->ring) * GLUE_RING_BUFFER_SIZE); if (self->ring == NULL) { xfer_cancel_with_error(elt, "Can't allocate memory for ring"); return FALSE; } self->ring_used_sem = amsemaphore_new_with_value(0); self->ring_free_sem = amsemaphore_new_with_value(GLUE_RING_BUFFER_SIZE); } if (need_listen_input) { if (!do_directtcp_listen(elt, &self->input_listen_socket, &elt->input_listen_addrs)) return FALSE; } if (need_listen_output) { if (!do_directtcp_listen(elt, &self->output_listen_socket, &elt->output_listen_addrs)) return FALSE; } return TRUE; } static gboolean start_impl( XferElement *elt) { XferElementGlue *self = (XferElementGlue *)elt; if (self->need_thread) self->thread = g_thread_create(worker_thread, (gpointer)self, TRUE, NULL); /* we're active if we have a thread that will eventually die */ return self->need_thread; } static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferElementGlue *self = XFER_ELEMENT_GLUE(elt); /* accept first, if required */ if (self->on_pull & PULL_ACCEPT_FIRST) { /* don't accept the next time around */ self->on_pull &= ~PULL_ACCEPT_FIRST; if (elt->cancelled) { *size = 0; return NULL; } if ((self->input_data_socket = do_directtcp_accept(self, &self->input_listen_socket)) == -1) { /* do_directtcp_accept already signalled an error; xfer * is cancelled */ *size = 0; return NULL; } /* read from this new socket */ self->read_fdp = &self->input_data_socket; } /* or connect first, if required */ if (self->on_pull & PULL_CONNECT_FIRST) { /* don't connect the next time around */ self->on_pull &= ~PULL_CONNECT_FIRST; if (elt->cancelled) { *size = 0; return NULL; } if ((self->input_data_socket = do_directtcp_connect(self, elt->upstream->output_listen_addrs)) == -1) { /* do_directtcp_connect already signalled an error; xfer * is cancelled */ *size = 0; return NULL; } /* read from this new socket */ self->read_fdp = &self->input_data_socket; } switch (self->on_pull) { case PULL_FROM_RING_BUFFER: { gpointer buf; if (elt->cancelled) { /* the finalize method will empty the ring buffer */ *size = 0; return NULL; } /* make sure there's at least one element available */ amsemaphore_down(self->ring_used_sem); /* get it */ buf = self->ring[self->ring_tail].buf; *size = self->ring[self->ring_tail].size; self->ring_tail = (self->ring_tail + 1) % GLUE_RING_BUFFER_SIZE; /* and mark this element as free to be overwritten */ amsemaphore_up(self->ring_free_sem); return buf; } case PULL_FROM_FD: { int fd = get_read_fd(self); char *buf; ssize_t len; /* if the fd is already closed, it's possible upstream bailed out * so quickly that we didn't even get a look at the fd */ if (elt->cancelled || fd == -1) { if (fd != -1) { if (elt->expect_eof) xfer_element_drain_fd(fd); close_read_fd(self); } *size = 0; return NULL; } buf = g_malloc(GLUE_BUFFER_SIZE); /* read from upstream */ len = full_read(fd, buf, GLUE_BUFFER_SIZE); if (len < GLUE_BUFFER_SIZE) { if (errno) { if (!elt->cancelled) { xfer_cancel_with_error(elt, _("Error reading from fd %d: %s"), fd, strerror(errno)); wait_until_xfer_cancelled(elt->xfer); } /* return an EOF */ amfree(buf); len = 0; /* and finish off the upstream */ if (elt->expect_eof) { xfer_element_drain_fd(fd); } close_read_fd(self); } else if (len == 0) { /* EOF */ g_free(buf); buf = NULL; *size = 0; /* signal EOF to downstream */ close_read_fd(self); } } *size = (size_t)len; return buf; } default: case PULL_INVALID: g_assert_not_reached(); return NULL; } } static void push_buffer_impl( XferElement *elt, gpointer buf, size_t len) { XferElementGlue *self = (XferElementGlue *)elt; /* accept first, if required */ if (self->on_push & PUSH_ACCEPT_FIRST) { /* don't accept the next time around */ self->on_push &= ~PUSH_ACCEPT_FIRST; if (elt->cancelled) { return; } if ((self->output_data_socket = do_directtcp_accept(self, &self->output_listen_socket)) == -1) { /* do_directtcp_accept already signalled an error; xfer * is cancelled */ return; } /* write to this new socket */ self->write_fdp = &self->output_data_socket; } /* or connect first, if required */ if (self->on_push & PUSH_CONNECT_FIRST) { /* don't accept the next time around */ self->on_push &= ~PUSH_CONNECT_FIRST; if (elt->cancelled) { return; } if ((self->output_data_socket = do_directtcp_connect(self, elt->downstream->input_listen_addrs)) == -1) { /* do_directtcp_connect already signalled an error; xfer * is cancelled */ return; } /* read from this new socket */ self->write_fdp = &self->output_data_socket; } switch (self->on_push) { case PUSH_TO_RING_BUFFER: /* just drop packets if the transfer has been cancelled */ if (elt->cancelled) { amfree(buf); return; } /* make sure there's at least one element free */ amsemaphore_down(self->ring_free_sem); /* set it */ self->ring[self->ring_head].buf = buf; self->ring[self->ring_head].size = len; self->ring_head = (self->ring_head + 1) % GLUE_RING_BUFFER_SIZE; /* and mark this element as available for reading */ amsemaphore_up(self->ring_used_sem); return; case PUSH_TO_FD: { int fd = get_write_fd(self); /* if the fd is already closed, it's possible upstream bailed out * so quickly that we didn't even get a look at the fd. In this * case we can assume the xfer has been cancelled and just discard * the data. */ if (fd == -1) return; if (elt->cancelled) { if (!elt->expect_eof || !buf) { close_write_fd(self); /* hack to ensure we won't close the fd again, if we get another push */ elt->expect_eof = TRUE; } amfree(buf); return; } /* write the full buffer to the fd, or close on EOF */ if (buf) { if (!elt->downstream->drain_mode && full_write(fd, buf, len) < len) { if (elt->downstream->must_drain) { g_debug("Error writing to fd %d: %s", fd, strerror(errno)); } else if (elt->downstream->ignore_broken_pipe && errno == EPIPE) { } else { if (!elt->cancelled) { xfer_cancel_with_error(elt, _("Error writing to fd %d: %s"), fd, strerror(errno)); wait_until_xfer_cancelled(elt->xfer); } /* nothing special to do to handle a cancellation */ } elt->downstream->drain_mode = TRUE; } amfree(buf); } else { close_write_fd(self); } return; } default: case PUSH_INVALID: g_assert_not_reached(); break; } } static void instance_init( XferElementGlue *self) { XferElement *elt = (XferElement *)self; elt->can_generate_eof = TRUE; self->pipe[0] = self->pipe[1] = -1; self->input_listen_socket = -1; self->output_listen_socket = -1; self->input_data_socket = -1; self->output_data_socket = -1; self->read_fd = -1; self->write_fd = -1; } static void finalize_impl( GObject * obj_self) { XferElementGlue *self = XFER_ELEMENT_GLUE(obj_self); /* first make sure the worker thread has finished up */ if (self->thread) g_thread_join(self->thread); /* close our pipes and fd's if they're still open */ if (self->pipe[0] != -1) close(self->pipe[0]); if (self->pipe[1] != -1) close(self->pipe[1]); if (self->input_data_socket != -1) close(self->input_data_socket); if (self->output_data_socket != -1) close(self->output_data_socket); if (self->input_listen_socket != -1) close(self->input_listen_socket); if (self->output_listen_socket != -1) close(self->output_listen_socket); if (self->read_fd != -1) close(self->read_fd); if (self->write_fd != -1) close(self->write_fd); if (self->ring) { /* empty the ring buffer, ignoring syncronization issues */ while (self->ring_used_sem->value) { if (self->ring[self->ring_tail].buf) amfree(self->ring[self->ring_tail].buf); self->ring_tail = (self->ring_tail + 1) % GLUE_RING_BUFFER_SIZE; } amfree(self->ring); amsemaphore_free(self->ring_used_sem); amsemaphore_free(self->ring_free_sem); } /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static xfer_element_mech_pair_t _pairs[] = { { XFER_MECH_READFD, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ { XFER_MECH_READFD, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */ { XFER_MECH_READFD, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */ { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ { XFER_MECH_WRITEFD, XFER_MECH_READFD, XFER_NROPS(0), XFER_NTHREADS(0) }, /* pipe */ { XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* pipe + read and call*/ { XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* pipe + read on demand */ { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* pipe + splice or copy*/ { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */ { XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand + pipe */ { XFER_MECH_PUSH_BUFFER, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */ { XFER_MECH_PUSH_BUFFER, XFER_MECH_PULL_BUFFER, XFER_NROPS(0), XFER_NTHREADS(0) }, /* async queue */ { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */ { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */ { XFER_MECH_PULL_BUFFER, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write + pipe */ { XFER_MECH_PULL_BUFFER, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */ { XFER_MECH_PULL_BUFFER, XFER_MECH_PUSH_BUFFER, XFER_NROPS(0), XFER_NTHREADS(1) }, /* call and call */ { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */ { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */ { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */ { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */ { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */ { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */ { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */ { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */ { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */ { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */ /* terminator */ { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; xfer_element_mech_pair_t *xfer_element_glue_mech_pairs = _pairs; static void class_init( XferElementGlueClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); klass->setup = setup_impl; klass->start = start_impl; klass->push_buffer = push_buffer_impl; klass->pull_buffer = pull_buffer_impl; klass->perl_class = "Amanda::Xfer::Element::Glue"; klass->mech_pairs = xfer_element_glue_mech_pairs; goc->finalize = finalize_impl; parent_class = g_type_class_peek_parent(selfc); } GType xfer_element_glue_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferElementGlueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferElementGlue), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferElementGlue", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_element_glue(void) { XferElementGlue *self = (XferElementGlue *)g_object_new(XFER_ELEMENT_GLUE_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); return elt; } amanda-3.3.6/xfer-src/source-pattern.c0000664000076400007640000001307012357250004021307 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "simpleprng.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_pattern() references * it directly. */ GType xfer_source_pattern_get_type(void); #define XFER_SOURCE_PATTERN_TYPE (xfer_source_pattern_get_type()) #define XFER_SOURCE_PATTERN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_pattern_get_type(), XferSourcePattern) #define XFER_SOURCE_PATTERN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_pattern_get_type(), XferSourcePattern const) #define XFER_SOURCE_PATTERN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_pattern_get_type(), XferSourcePatternClass) #define IS_XFER_SOURCE_PATTERN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_pattern_get_type ()) #define XFER_SOURCE_PATTERN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_pattern_get_type(), XferSourcePatternClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourcePattern { XferElement __parent__; gboolean limited_length; guint64 length; size_t pattern_buffer_length; size_t current_offset; char * pattern; } XferSourcePattern; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferSourcePatternClass; /* * Implementation */ /* * Utility function to fill a buffer buf of size len with the pattern defined * for this instance. We start each copying from the offset where we left the * previous one. * * Note that performance is important: amtapetype uses this very source and * source-random.c to determine whether a tape device uses compression, and * expects the two to run about the same speed. This is why this is a byte * loop and does not use mempcy() and friends: the random source is also byte * per byte. */ static void fill_buffer_with_pattern(XferSourcePattern *self, char *buf, size_t len) { char *src = self->pattern, *dst = buf; size_t plen = self->pattern_buffer_length, offset = self->current_offset; size_t pos = 0; src += offset; while (pos < len) { *dst++ = *src++; pos++, offset++; if (G_LIKELY(offset < plen)) continue; offset = 0; src = self->pattern; } self->current_offset = offset; } static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferSourcePattern *self = (XferSourcePattern *)elt; char *rval; /* indicate EOF on an cancel */ if (elt->cancelled) { *size = 0; return NULL; } if (self->limited_length) { if (self->length == 0) { *size = 0; return NULL; } *size = MIN(10240, self->length); self->length -= *size; } else { *size = 10240; } rval = malloc(*size); fill_buffer_with_pattern(self, rval, *size); return rval; } static void instance_init( XferElement *elt) { elt->can_generate_eof = TRUE; } static void class_init( XferSourcePatternClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->pull_buffer = pull_buffer_impl; klass->perl_class = "Amanda::Xfer::Source::Pattern"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_pattern_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourcePatternClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourcePattern), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourcePattern", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_source_pattern(guint64 length, void * pattern, size_t pattern_length) { XferSourcePattern *xsp = (XferSourcePattern *)g_object_new(XFER_SOURCE_PATTERN_TYPE, NULL); XferElement *elt = XFER_ELEMENT(xsp); xsp->length = length; xsp->limited_length = (length > 0); xsp->pattern = g_memdup(pattern, pattern_length); xsp->pattern_buffer_length = pattern_length; xsp->current_offset = 0; return elt; } amanda-3.3.6/xfer-src/dest-null.c0000664000076400007640000001064612357250004020251 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "simpleprng.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_null() references * it directly. */ GType xfer_dest_null_get_type(void); #define XFER_DEST_NULL_TYPE (xfer_dest_null_get_type()) #define XFER_DEST_NULL(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_null_get_type(), XferDestNull) #define XFER_DEST_NULL_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_null_get_type(), XferDestNull const) #define XFER_DEST_NULL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_null_get_type(), XferDestNullClass) #define IS_XFER_DEST_NULL(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_null_get_type ()) #define XFER_DEST_NULL_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_null_get_type(), XferDestNullClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestNull { XferElement __parent__; gboolean sent_info; gboolean do_verify; simpleprng_state_t prng; guint64 byte_position; } XferDestNull; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferDestNullClass; /* * Implementation */ static void push_buffer_impl( XferElement *elt, gpointer buf, size_t len) { XferDestNull *self = (XferDestNull *)elt; if (!buf) return; if (self->do_verify && !elt->cancelled) { if (!simpleprng_verify_buffer(&self->prng, buf, len)) { xfer_cancel_with_error(elt, "verification of incoming bytestream failed; see stderr for details"), wait_until_xfer_cancelled(elt->xfer); amfree(buf); return; } } self->byte_position += len; if (!self->sent_info) { /* send a superfluous message (this is a testing XferElement, * after all) */ XMsg *msg = xmsg_new((XferElement *)self, XMSG_INFO, 0); msg->message = stralloc("Is this thing on?"); xfer_queue_message(XFER_ELEMENT(self)->xfer, msg); self->sent_info = TRUE; } amfree(buf); } static void class_init( XferDestNullClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->push_buffer = push_buffer_impl; klass->perl_class = "Amanda::Xfer::Dest::Null"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_null_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestNullClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestNull), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestNull", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_dest_null( guint32 prng_seed) { XferDestNull *self = (XferDestNull *)g_object_new(XFER_DEST_NULL_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); if (prng_seed) { self->do_verify = TRUE; simpleprng_seed(&self->prng, prng_seed); } else { self->do_verify = FALSE; } return elt; } amanda-3.3.6/xfer-src/dest-directtcp-connect.c0000664000076400007640000001116012357250004022677 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "sockaddr-util.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_directtcp_connect() references * it directly. */ GType xfer_dest_directtcp_connect_get_type(void); #define XFER_DEST_DIRECTTCP_CONNECT_TYPE (xfer_dest_directtcp_connect_get_type()) #define XFER_DEST_DIRECTTCP_CONNECT(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_connect_get_type(), XferDestDirectTCPConnect) #define XFER_DEST_DIRECTTCP_CONNECT_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_connect_get_type(), XferDestDirectTCPConnect const) #define XFER_DEST_DIRECTTCP_CONNECT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_directtcp_connect_get_type(), XferDestDirectTCPConnectClass) #define IS_XFER_DEST_DIRECTTCP_CONNECT(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_directtcp_connect_get_type ()) #define XFER_DEST_DIRECTTCP_CONNECT_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_directtcp_connect_get_type(), XferDestDirectTCPConnectClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestDirectTCPConnect { XferElement __parent__; /* addresses to connect to (copied locally) */ DirectTCPAddr *addrs; } XferDestDirectTCPConnect; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferDestDirectTCPConnectClass; /* * Implementation */ static gboolean setup_impl( XferElement *elt) { XferDestDirectTCPConnect *self = (XferDestDirectTCPConnect *)elt; g_assert(self->addrs && SU_GET_FAMILY(self->addrs) != 0); elt->input_listen_addrs = self->addrs; return TRUE; } static void finalize_impl( GObject * obj_self) { XferDestDirectTCPConnect *self = XFER_DEST_DIRECTTCP_CONNECT(obj_self); if (self->addrs) g_free(self->addrs); self->addrs = NULL; /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferDestDirectTCPConnectClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) }, }; klass->setup = setup_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Dest::DirectTCPConnect"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_directtcp_connect_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestDirectTCPConnectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestDirectTCPConnect), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestDirectTCPConnect", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-element.h */ XferElement * xfer_dest_directtcp_connect( DirectTCPAddr *addrs) { XferDestDirectTCPConnect *self = (XferDestDirectTCPConnect *) g_object_new(XFER_DEST_DIRECTTCP_CONNECT_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); int i; g_assert(addrs != NULL); for (i = 0; SU_GET_FAMILY(&addrs[i]) != 0; i++); self->addrs = g_memdup(addrs, (i+1) * sizeof(*addrs)); return elt; } amanda-3.3.6/xfer-src/amxfer.h0000664000076400007640000000211212357250004017616 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* Public header file for libamxfer */ #ifndef AMXFER_H #define AMXFER_H #include "xfer.h" #include "xfer-element.h" #include "element-glue.h" #include "xmsg.h" #endif /* AMXFER_H */ amanda-3.3.6/Makefile.am0000664000076400007640000000570012357250010016471 0ustar00martineamartinea00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.10 foreign include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am ACLOCAL_AMFLAGS = --force -I config -I . -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive if WANT_CLIENT CLIENT_SUBDIRS = client-src application-src endif if WANT_SERVER SERVER_SUBDIRS = device-src server-src changer-src endif if WANT_RECOVER RECOVER_SUBDIRS = recover-src oldrecover-src endif if WANT_AMPLOT PLOT_SUBDIRS = amplot endif if WANT_NDMP NDMP_SUBDIRS = ndmp-src endif # order is significant, don't change it arbitrarily SUBDIRS = . \ gnulib \ config \ common-src \ amar-src \ amandad-src \ xfer-src \ $(NDMP_SUBDIRS) \ $(TAPE_SUBDIRS) \ $(CLIENT_SUBDIRS) \ $(SERVER_SUBDIRS) \ $(RESTORE_SUBDIRS) \ $(RECOVER_SUBDIRS) \ $(PLOT_SUBDIRS) \ perl \ po \ man \ example \ packaging \ installcheck pkgdata_DATA = \ ReleaseNotes \ COPYRIGHT \ NEWS \ ChangeLog EXTRA_DIST += $(SNAPSHOT_STAMP) \ $(pkgdata_DATA) \ autogen \ contrib/README \ contrib/dbbackup.README \ contrib/dbbackup.ksh \ contrib/dbbackup.sql \ contrib/dbbackup.tcl \ contrib/mkamandisk \ contrib/set_prod_link.pl \ contrib/gsc/README \ contrib/gsc/cfggsc.c \ contrib/gsc/defgsc.c \ contrib/gsc/gsc.add \ contrib/gsc/gscdd.c \ contrib/gsc/gscdds.h \ contrib/gsc/makefile \ contrib/gsc/tstinq.c \ contrib/gsc/ucfggsc.c \ patches/regex-3.6alpha.patch \ patches/samba-largefs.patch \ patches/tar-1.12.patch \ UPGRADING \ DEVELOPING \ VERSION \ FULL_VERSION FULL_VERSION: VERSION $(srcdir)/config/set_full_version $(top_srcdir) config.status: FULL_VERSION libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck # empty out the installperms manifest file when we start install-exec-local: installperms-init install-data-local: installperms-init ## This is only meaningful for snapshots, but it won't hurt releases. CONFIG_STATUS = config.status $(CONFIG_STATUS): $(SNAPSHOT_STAMP) SNAPSHOT: : SNAPSHOT file was removed, will reconfigure... lint: (cd amandad-src; make lint) (cd changer-src; make lint) (cd client-src; make lint) (cd common-src; make lint) (cd oldrecover-src; make lint) (cd recover-src; make lint) (cd server-src; make lint) (cd xfer-src; make lint) ## Do not release the *.test.c sources. They get built on the fly and ## would contain a path from the distribution machine, which will just ## confuse the target user. dist-hook: find $(distdir)/. -name '*.test.c' -exec rm {} \; # ensure that configure gets the right arguments for distcheck; this keeps the # user/group through to the distcheck, rather than defaulting back to 'amanda'. DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-amperldir --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes CLOBBER_MY_CONFIG=OK amanda-3.3.6/contrib/0000775000076400007640000000000012357750426016113 5ustar00martineamartinea00000000000000amanda-3.3.6/contrib/set_prod_link.pl0000664000076400007640000001257412357250005021301 0ustar00martineamartinea00000000000000#!/usr/local/bin/perl # ======================================================================== # @(#) $Id: set_prod_link.pl,v 1.3 2006/05/25 01:47:13 johnfranks Exp $ # ------------------------------------------------------------------------ # $Source: /cvsroot/amanda/amanda/contrib/set_prod_link.pl,v $ # ------------------------------------------------------------------------ # Description: # # When installing AMANDA with the option --with-suffix you can use this # script to set the a symbolic link from the productive name of the # files to this special version. # This way you can switch on the fly, from one version to an other. # # Actually I would advice to use the option --prefix and install the # the whole software in different paths. # # But if you want for example install a new version in the same # directory you can use it. # # ----------------------------------------------------------------------- # Author: Ricardo Malta, rmalta@bigfoot.com # ----------------------------------------------------------------------- # History: # # Revision 1.3 2006/05/25 01:47:13 johnfranks # Allow spaces and arbitrary binary characters in file names # and configuration files. # # 64-bit / type portability clean code. # # Add 'make lint' options to appropriate Makefiles. # # Fully lint clean code using Sun's lint, and splint code checkers. # # Various bug fixes that have not been pushed. # # Modified Files: # Modified most of the files... # # Revision 1.2 1999/11/02 21:30:10 oliva # * contrib/set_prod_link.pl: Create the links for a configuration # with --with-suffix. # # # ======================================================================== $debug = 0; if ($ARGV[0] ne "doit") { print <<"EOD"; usage: $0 doit Go to the directory where you have compiled AMANDA. Call this programm with the parameter \"doit\". EOD exit 1; } # ------------------------------------------------------------------------ # Open the Makefile and search for the entries we need for doing the job. # ------------------------------------------------------------------------ open(FD,") { $suffix = (split(/\s*,\s*/))[2] if /^\s*transform\s*=/; $rootdir = (split(/=\s*/))[1] if /^\s*prefix\s*=/; last if $suffix && $suffix; } close(FD); chomp $rootdir; die "Cannot find line containing \"transform =\" in Makefile.\n" if (!$suffix); die "Cannot find line containing \"prefix =\" in Makefile.\n" if (!$rootdir); # ------------------------------------------------------------------------ # Last chance .... # ------------------------------------------------------------------------ print "Starting setting the links to productive version: Directory: $rootdir Suffix : $suffix Confirm with : "; chomp($dummy = ); die "\nAborting ...\n" if ($dummy ne "yes"); print "\n"; # ------------------------------------------------------------------------ # Now do the job # ------------------------------------------------------------------------ $CUR_DIR = "$rootdir"; Make_Prod_Link($rootdir,$suffix) || die "Cannot create links under $rootdir\n"; # ------------------------------------------------------------------------ # We are done ... get out of here # ------------------------------------------------------------------------ exit 0; # ************************************************************************ # F U N C T I O N S # ************************************************************************ # ------------------------------------------------------------------------ # Scan the directory for AMANDA-Entries # ------------------------------------------------------------------------ sub Make_Prod_Link { my ($prefix,$suffix) = @_; # -------------------------------------------------- # Just for info # -------------------------------------------------- my $cur_dir = $CUR_DIR; print "-> $CUR_DIR\n"; # -------------------------------------------------- # Change to given directory and read the inodes # -------------------------------------------------- chdir $prefix or do { warn "$CUR_DIR: $!\n"; return; }; opendir(DIR,".") or do { warn "$CUR_DIR: $!\n"; return; }; my @inodes = grep(!/^\.$|^\.\.$/,readdir(DIR)); # -------------------------------------------------- # For each inode check if it is a directory or an # amanda file # -------------------------------------------------- foreach my $inode (@inodes) { if (-d $inode) { # ---------------------------------- # For a directory -> recursion # ---------------------------------- $CUR_DIR .= "/".$inode; Make_Prod_Link($inode,$suffix) or return; chdir ".." or do { warn "Cannot get back from $inode: $!\n"; return; }; $CUR_DIR = $cur_dir; } # ----------------------------------------------------- # Create a symbolic link unless the file already exists # ----------------------------------------------------- if (substr($inode,-length($suffix)) eq $suffix) { my $prog_name = substr($inode,0,-length($suffix)); if (-e $prog_name && ! -l $prog_name) { warn "Unexpected real file found: $CUR_DIR/$prog_name\n"; return; } unlink $prog_name; symlink($inode,$prog_name) or do { warn "Cannot create symbolical link for $prog_name -> $inode: $!\n"; return; }; print " $prog_name -> $inode\n"; } else { print "let it untouched: $inode\n" if $debug; } } 1; } amanda-3.3.6/contrib/dbbackup.sql0000775000076400007640000000137512357250005020404 0ustar00martineamartinea00000000000000-- ==================================================== -- -- dbbackup.sql -- -- -- -- This script is run as user "sys" -- -- -- -- creates user "backup" identified externally -- -- creates role "backup_role" with permisssions -- -- grants role "backup_role" to user "backup" -- -- -- -- ==================================================== -- connect internal create role backup_role; grant create session to backup_role; grant alter system to backup_role; grant alter database to backup_role; grant manage tablespace to backup_role; grant select on dba_tablespaces to backup_role; grant select on dba_data_files to backup_role; grant select on v_$log to backup_role; create user backup identified externally; grant backup_role to backup; amanda-3.3.6/contrib/dbbackup.tcl0000775000076400007640000001676412357250005020377 0ustar00martineamartinea00000000000000#!/opt/tcl8.3.0/bin/tclsh8.3 # .-------------.------------------------------------------------------. # | module | dbbackup.tcl | # `-------------^------------------------------------------------------' # .--------------------------------------------------------------------. # | Revisions | # |--------------------------------------------------------------------| # | 07/25/96 (TMH) eliminated the need for a library file. | # | 02/10/97 (TMH) converted to tcl7.6, oratcl 2.4. | # | 12/02/98 (TMH) eliminate all pipes to /bin/sh for final release | # `--------------------------------------------------------------------' # .--------------------------------------------------------------------. # | Copyright (c) 1998, Purdue University | # | All rights reserved. | # `--------------------------------------------------------------------' # .--------------------------------------------------------------------. # | Redistribution and use in source and binary forms are permitted | # | provided that: | # | | # | (1) source distributions retain this entire copyright notice and | # | comment, and | # | (2) distributions including binaries display the following | # | acknowledgement: | # | | # | "This product includes software developed by Purdue University." | # | in the documentation or other materials provided with the | # | distribution and in all advertising materials mentioning features | # | or use of this software. | # | | # | The name of the University may not be used to endorse or promote | # | products derived from this software without specific prior written | # | permission. | # | | # | THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | # | IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | # | WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR | # | PURPOSE. | # `--------------------------------------------------------------------' package require -exact Oratcl 2.7 set uidpswd / set df_dest /opt/oracle/backup set cf_dest [file join $df_dest "ctl$env(ORACLE_SID).ctl"] set cur {} set lda {} # .--------------------------------------------------------------------. # | sysdate | # `--------------------------------------------------------------------' proc sysdate {} { return [clock format [clock seconds] -format {%c}] } # .-------------.------------------------------------------------------. # | procedure | ora_Connect | # | date | (09/02/94) | # `-------------^------------------------------------------------------' proc ora_Connect {} { global uidpswd global cur global lda set retcode [catch {set lda [oralogon ${uidpswd}]}] if {$retcode == 0} { set cur [oraopen $lda] } return $retcode } # .-------------.------------------------------------------------------. # | procedure | ora_Disconnect | # | author | Todd M. Helfter | # | date | (09/02/94) | # `-------------^------------------------------------------------------' proc ora_Disconnect {} { global lda return [catch {oralogoff $lda }] } # .-------------.------------------------------------------------------. # | procedure | print_log | # `-------------^------------------------------------------------------' proc print_log {} { global cur oramsg set log_min {} set log_max {} set sql {select min(sequence#), max(sequence#) from v$log} if {[catch {orasql $cur $sql}] == 0} { orafetch $cur "set log_min @1; set log_max @2" } puts stdout [format "\nOldest online log sequence\t%s" $log_min] puts stdout [format "Current log sequence\t\t%s\n" $log_max] flush stdout } # .-------------.------------------------------------------------------. # | procedure | ora_SQL | # `-------------^------------------------------------------------------' proc ora_SQL {sql_str} { global cur oramsg set dbret [catch {orasql $cur $sql_str}] if {$dbret != 0} { puts stdout $oramsg(errortxt) flush stdout } else { orafetch $cur { puts stdout @0 flush stdout } } } # .--------------------------------------------------------------------. # | query_info | # `--------------------------------------------------------------------' proc query_info {} { global cur ts_list df_list oramsg uidpswd set ts_list {} if {[ora_Connect] == 0} { set sql0 "SELECT tablespace_name FROM sys.dba_tablespaces" if {[catch {orasql $cur $sql0}] == 0} { orafetch $cur {lappend ts_list @0} } } else { puts stdout $oramsg(errortxt) flush stdout exit 1 } foreach ts_name $ts_list { set df_list($ts_name) {} set sql1 "SELECT file_name FROM sys.dba_data_files \ where tablespace_name = '$ts_name'" if {[catch {orasql $cur $sql1}] == 0} { orafetch $cur {lappend df_list($ts_name) @0} } else { puts stdout $oramsg(errortxt) flush stdout exit 1 } } } # .--------------------------------------------------------------------. # | print_info | # `--------------------------------------------------------------------' proc print_info {} { global ts_list df_list foreach ts_name $ts_list { puts stdout "ts_name : $ts_name" flush stdout foreach df_name $df_list($ts_name) { puts stdout " df_name : $df_name" flush stdout } } } # .--------------------------------------------------------------------. # | ora_Backup | # `--------------------------------------------------------------------' proc ora_Backup {} { global ts_list df_list df_dest cf_dest print_log foreach ts_name $ts_list { puts stdout "[sysdate] | begin online backup for : $ts_name" flush stdout ora_SQL "alter tablespace $ts_name begin backup" foreach df_name $df_list($ts_name) { puts stdout "[sysdate] | copying $df_name to $df_dest." flush stdout file copy -force -- $df_name $df_dest } puts stdout "[sysdate] | end online backup for : $ts_name" flush stdout ora_SQL "alter tablespace $ts_name end backup" } puts stdout "[sysdate] | switching logfile." flush stdout ora_SQL {alter system switch logfile} print_log puts stdout "[sysdate] | copying control file to $cf_dest." flush stdout ora_SQL "alter database backup controlfile to '$cf_dest' reuse" } # .-------------.------------------------------------------------------. # | procedure | main | # | purpose | scan database and report results to parent window | # | author | Todd M. Helfter | # | date | (10/13/94) | # `-------------^------------------------------------------------------' proc main {} { global cur uidpswd oramsg ts_list df_list query_info print_info ora_Backup ora_Disconnect } main exit 0 amanda-3.3.6/contrib/dbbackup.README0000775000076400007640000000506312357250005020540 0ustar00martineamartinea00000000000000 dbbackup dbbackup is a set of scripts to automate Oracle hot backups using tcl via oratcl. It is currently used on 24x7 systems on several platforms, including Solaris2.5/2.6 and AIX. It has been tested and used with both Oracle 7 and Oracle 8. I recommend the most stable release of Tcl (currently 8.0p2) and Oratcl 2.5 In our oracle implementation, we have a single disk '/opt/oracle/backup' who's sole purpose is to hold the database backups. We point our archive log destination there, so all archived redo logs are in one spot and we run a hot backup nightly to copy all the datafiles and the control file there as well. Necessarily, the /opt/oracle/backup disk must be big enough to hold all of this. We use the Amanda backup system (www.amanda.org) to handle backing up the disk to tape. Simply put, the ksh script sets up environment for the tcl script, which does the following: - for each tablespace in the database - identify all datafiles belonging to that tablespace - set the tablespace to backup mode - copy the datafiles to the backup location - set the tablespace to regular mode - switch the log file so any changes made during backup get archived - back up the control file There are no fancy installation scripts as of yet. Here is a short summary of what is needed. 1. Root user creates a system backup account. 2. Oracle DBA runs dbbackup.sql as oracle user "sys" to: - create a role "backup_role" - grant minimal system privileges to backup_role (i.e. manage tablespace) *NOTE* these are powerful privileges. but necessary - grant minimal necessary table privileges to backup_role (i.e. dba_tablespace) - create the backup user from step 1 - grant backup_role to the backup user 3. configure - change dbbackup.ksh to find the oracle script "dbhome", set ORACLE_SID and optionally set the dbbackup administration area (location of logs and dbbackup.ksh) and user who will get the E-mail reports. - change dbbackup.tcl to find the backup destination (variables df_dest and cf_dest) 4. Root user needs to install dbbackup.ksh. The dbbackup.tcl script must be installed in $adm/dbbackup.tcl (adm is defined in dbbackup.ksh). 5. Root user needs to add a cron job to trim old archive logs (6 days worth). 'dbbackup.cron' is a sample cron entry *NOTE* failure to add crontab fills the disk real fast. *NOTE* our archive logs are [sid]####.dbf 6. Root user needs to configure the backup system to call 'dbbackup.ksh' as the backup user. Todd M. Helfter Purdue University Computing Center tmh@purdue.edu amanda-3.3.6/contrib/mkamandisk0000664000076400007640000000305512357250005020144 0ustar00martineamartinea00000000000000#!/bin/bash # This script prepares an IOmega disk for use with amanda. # More precisely, it # - formats the disk, checking for bad sectors # - mounts the disk and adds a data subdirectory # - makes user amanda owner of this data sub directory # - calls amlabel to label the disk # - unmounts and ejects the disk. # # This shell script is not generally usable as is, # because it is relying on a couple of settings of personal taste, such as # - IOmega disks are partitioned and the fourth primary partition # is taking the whole disk. So the disk is visible as /dev/sda4. # - I am preferring to use an ext2 filesystem on the disk # (rather then a dos or vfat file system) # - I am doing a chown of the data sub directory such that - depending # on the umask setting - only user amanda and root can see # the files written to the disk. # It has to be called as root if [ "$#" -lt "2" ] then echo "Usage : $0 " exit 1 fi backup="$1" label="$2" echo "insert tape $2 into slot and press return" read ANSWER mkfs.ext2 -c -L $label /dev/iomega echo "mounting disk ..." mount /dev/iomega if [ ! -d /mnt/iomega/lost+found ] then echo "mount did not work properly - please investigate" exit 1 fi echo "adding data subdirectory ..." cd /mnt/iomega mkdir data chown -R amanda:disk . if [ -n "$label" ] then echo "attempting to write amanda disk label" su - amanda -c "/usr/sbin/amlabel $backup $label" fi echo "preparing to eject disk ..." cd >/dev/null 2>&1 eject /mnt/iomega echo "please don't forget to label with $backup $label" amanda-3.3.6/contrib/README0000664000076400007640000000067012357250005016762 0ustar00martineamartinea00000000000000This directory contains odds and ends that have been contributed by other Amanda users. They are made available on a completely "as-is" basis for the benefit of the Amanda community. ======== dbbackup ======== The dbbackup.* files provide a "hot" backup system for an Oracle database to a disk partition, which can then be backed up with Amanda. Author: Todd M. Helfter Purdue University Computing Center tmh@purdue.edu amanda-3.3.6/contrib/gsc/0000775000076400007640000000000012357750426016667 5ustar00martineamartinea00000000000000amanda-3.3.6/contrib/gsc/tstinq.c0000664000076400007640000000406412357250005020345 0ustar00martineamartinea00000000000000/* * %W% %G% * $Id: tstinq.c,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #include #include #include "gscdds.h" static void process(char *, int); int main(int a, char **v) { int fd; while (*++v) { fd = open(*v, 0); if (fd < 0) { perror(*v); continue; } process(*v, fd); (void) close(fd); } return (0); } static void process(char *name, int fd) { scmd_t scmd; char sb[32], iqd[256], sbyte, c, dt; static char cdb[6] = { 0x12, 0, 0, 0, 255, 0 }; scmd.cdb = cdb; scmd.cdblen = sizeof (cdb); scmd.data_buf = iqd; scmd.datalen = 255; scmd.sense_buf = sb; scmd.senselen = sizeof (sb); scmd.statusp = &sbyte; scmd.rw = 1; scmd.timeval = 5; if (ioctl(fd, GSC_CMD, (caddr_t) &scmd) < 0) { perror("GSC_CMD"); return; } dt = iqd[0] & 0x1f; c = iqd[8+28]; iqd[8+28] = 0; (void) fprintf(stdout, "%s:%-28s|Device Type %d\n", name, &iqd[8], dt); } /* * mode: c * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/gsc/ucfggsc.c0000664000076400007640000001124412357250005020442 0ustar00martineamartinea00000000000000/* * %W% %G% * $Id: ucfggsc.c,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #include #include #include #include #include #include #include #include #include #include "gscdds.h" #define vprintf if (verbose) printf extern mid_t loadext(char *, int, int); static void err_exit(char exitcode) { odm_close_class(CuDv_CLASS); odm_close_class(PdDv_CLASS); odm_terminate(); exit(exitcode); } int main(int argc, char **argv) { char *logical_name, *ptr; char sstring[256]; struct CuDv cudvobj; struct PdDv pddvobj; int rc, how_many, errflg, c, majorno, minorno, unit, verbose; struct cfg_dd cfg; struct cfg_load load; int *minor_list; extern int optind; extern char *optarg; verbose = errflg = 0; logical_name = NULL; while ((c = getopt(argc,argv,"vl:")) != EOF) { switch (c) { case 'v': verbose++; break; case 'l': if (logical_name != NULL) errflg++; logical_name = optarg; break; default: errflg++; } } if (errflg) exit(E_ARGS); if (logical_name == NULL) exit(E_LNAME); if (odm_initialize() == -1) exit(E_ODMINIT); /* Get Customized Device Object for this device */ sprintf(sstring,"name = '%s'",logical_name); rc = (int) odm_get_first(CuDv_CLASS, sstring, &cudvobj); if (rc == 0) { err_exit(E_NOCuDv); } else if (rc == -1) { err_exit(E_ODMGET); } if (cudvobj.status == DEFINED) err_exit(E_OK); /* already unconf'd */ /* get device's predefined object */ sprintf(sstring,"uniquetype = '%s'", cudvobj.PdDvLn_Lvalue); rc = (int) odm_get_first(PdDv_CLASS, sstring, &pddvobj); if (rc == 0) err_exit(E_NOPdDv); else if (rc == -1) err_exit(E_ODMGET); /* * Call sysconfig() to "terminate" the device. * If fails with EBUSY, then device instance is "open", * and device cannot be "unconfigured". Any other errno * returned will be ignored since we MUST unconfigure the * device even if it reports some other error. */ /* get major number of device */ majorno = genmajor(pddvobj.DvDr); if (majorno == -1) { return(E_MAJORNO); } /* get minor number */ minor_list = getminor(majorno, &how_many, pddvobj.DvDr); if (minor_list == NULL || how_many == 0) err_exit (E_MINORNO); vprintf("how_many=%d\n", how_many); ptr = logical_name; ptr += strlen(pddvobj.prefix); unit = atoi(ptr); if (unit >= how_many) { err_exit (E_MINORNO); } minorno = minor_list[unit]; vprintf("unit %d minorno %d\n", unit, minorno); /* create devno for this device */ cfg.devno = makedev(majorno, minorno); cfg.kmid = 0; cfg.ddsptr = (caddr_t) NULL; cfg.ddslen = (int) 0; cfg.cmd = CFG_TERM; if (sysconfig(SYS_CFGDD, &cfg, sizeof(struct cfg_dd)) == -1) { if (errno == EBUSY) err_exit(E_BUSY); } cfg.kmid = loadext(pddvobj.DvDr, FALSE, FALSE); if (cfg.kmid == NULL) err_exit(E_UNLOADEXT); /* Change the status field of device to "DEFINED" */ cudvobj.status = DEFINED; if (odm_change_obj(CuDv_CLASS, &cudvobj) == -1) err_exit(E_ODMUPDATE); /* * Terminate ODM */ odm_terminate(); return (E_OK); } /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically * adjust the settings for this buffer only. This must remain at the end * of the file. * --------------------------------------------------------------------------- * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/gsc/gsc.add0000664000076400007640000000262712357250005020110 0ustar00martineamartinea00000000000000* * $Id: gsc.add,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 PdDv: class = "generic" subclass = "scsi" type = "gsc" prefix = "gsc" devid = "" base = 1 has_vpd = 0 detectable = 1 chgstatus = 0 bus_ext = 0 fru = 1 led = 1234 catalog = "gsc.cat" setno = 1 msgno = 1 DvDr = "gscdd" Define = "/usr/lib/methods/defgsc" Configure = "/usr/lib/methods/cfggsc" Change = "" Unconfigure = "/usr/lib/methods/ucfggsc" Undefine = "/usr/lib/methods/undefine" Start = "" Stop = "" uniquetype = "generic/scsi/gsc" amanda-3.3.6/contrib/gsc/makefile0000664000076400007640000000355412357250005020362 0ustar00martineamartinea00000000000000# # $Id: makefile,v 1.2 2001/08/10 17:12:22 ant Exp $ # Copyright (c) 1997 by Matthew Jacob # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2. # # This software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this software; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # The author may be reached via electronic communications at # # mjacob@feral.com # # or, via United States Postal Address # # Matthew Jacob # 1831 Castro Street # San Francisco, CA, 94131 #CC = cc -qextchk -qlanglvl=ansi -qproto -qmaxmem=3000 CC = gcc RM = rm -f DEBUG_FLAG = KCFLAGS = $(DEBUG_FLAG) -O CFLAGS = $(DEBUG_FLAG) -O LDF1 = -bI:/lib/kernex.exp -bI:/usr/lib/lowsys.exp #LDF2 = -lsys -lcsys BINS = gscdd defgsc cfggsc ucfggsc tstinq DATA = gsc.cat all: ${BINS} ${DATA} gscdd: gscdd.o ${LD} -bl:$@.map -o $@ $@.o -e gsc_config ${LDF1} ${LDF2} gscdd.o: gscdd.c gscdds.h $(CC) $(KCFLAGS) -c gscdd.c -DKERNEL -D_KERNEL -D_IBMR2 cfggsc: cfggsc.c $(CC) $(CFLAGS) -o $@ -lodm -lcfg $@.c ucfggsc: ucfggsc.c $(CC) $(CFLAGS) -o $@ -lodm -lcfg $@.c defgsc: defgsc.c $(CC) $(CFLAGS) -o $@ -lodm -lcfg $@.c tstinq: tstinq.c $(CC) $(CFLAGS) -o $@ $@.c gsc.cat: makefile ${RM} /tmp/catalog_tmp echo '$$set 1 Feral Software Generic SCSI Messages' > /tmp/catalog_tmp echo "1 Feral Software Generic SCSI Release 1.0" >> /tmp/catalog_tmp gencat $@ /tmp/catalog_tmp ${RM} /tmp/catalog_tmp clean: @${RM} ${BINS} ${DATA} *.map *.o amanda-3.3.6/contrib/gsc/gscdds.h0000664000076400007640000000416212357250005020276 0ustar00martineamartinea00000000000000/* * $Id: gscdds.h,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1996, 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #ifndef _gscdds_h #define _gscdds_h #ifdef __cplusplus extern "C" { #endif #define MAX_UNITS 64 struct gsc_ddsinfo { dev_t busid; /* dev_t for SCSI adapter */ char target; /* target */ char lun; /* logical unit */ }; /* * Structure used to convey a scsi command to the driver */ typedef struct { char * cdb; /* SCSI command block */ int cdblen; /* length of SCSI command block */ char * data_buf; /* pointer to data area */ int datalen; /* length of data area. Zero implies none */ char * sense_buf; /* pointer to SENSE DATA area */ int senselen; /* length of sense area. Zero implies none */ char * statusp; /* pointer to SCSI status byte */ int rw; /* direction of data transfer- 1 means read */ int timeval; /* secs to complete cmd- 0 means infinite */ } scmd_t; #define GSC_CMD (('G' << 8) | 0) #define GSC_SETDBG (('G' << 8) | 1) #ifdef __cplusplus } #endif #endif /* ! _gscdds_h */ /* * mode: c * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/gsc/README0000664000076400007640000000303712357250005017536 0ustar00martineamartinea00000000000000# $Id: README,v 1.1 2001/04/15 11:12:37 ant Exp $ # Copyright (c) 1997 by Matthew Jacob # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2. # # This software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this software; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # The author may be reached via electronic communications at # # mjacob@feral.com # # or, via United States Postal Address # # Matthew Jacob # 1831 Castro Street # San Francisco, CA, 94131 I. Installation Steps 1. cfggsc, defgsc, ucfggsc, gsc.cat go into /usr/lib/methods 2. gscdd goes into /usr/lib/drivers 3. As root, do: odmadd gsc.add II. Configuration Steps mkdev -c generic -s scsi -t gsc -pscsiN -wT,L where N is the Nth scsi bus, T is target, L is lun. This should create a /dev/gscM for this device. You can use tstinq to run a test inquiry command. Use lsdev -C to see what gets configured. III. Removal steps 1. Do rmdev -d -l gscM for M = 0..M-1 to remove and undefine all gsc devices. 2. Do, as root, odmdelete -o PdDv -q uniquetype=generic/scsi/gsc 3. Remove files installed in I. above. amanda-3.3.6/contrib/gsc/cfggsc.c0000664000076400007640000002361212357250005020257 0ustar00martineamartinea00000000000000/* * $Id: cfggsc.c,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gscdds.h" extern mid_t loadext(char *, int, int); static int verbose; static struct gsc_ddsinfo ddsinfo; int main(int a, char **v); static void check_add_sockets(dev_t, int, char *, char *); static int has_driver_get_vpd(char *, int, char *); #define MKNOD_MODE S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH #define vprintf if (verbose) printf static void err_exit(char exitcode) { odm_close_class(CuDv_CLASS); odm_close_class(PdDv_CLASS); odm_terminate(); exit(exitcode); } int main(int a, char **v) { extern char *optarg; char sstring[256], bufname[256], conns[NAMESIZE], *ptr, *lname; struct Class *cprp, *cusdev, *predev; struct CuDvDr dpr, *dprp; struct CuDv parobj, cusobj, hdobj, *xprp; struct PdDv preobj; struct CuAt *attrobj; int rc, c, errflg, ipl_phase, unit, munit, howmany, lun, domake; dev_t ctl; long major; int *mlist; mid_t kmid; struct cfg_dd dd; lname = NULL; errflg = 0; ipl_phase = RUNTIME_CFG; (void) memset((void *) &ddsinfo, 0, sizeof ddsinfo); while ((c = getopt(a, v, "l:12v")) != EOF) { switch (c) { case 'l': if (lname != NULL) errflg++; lname = optarg; break; case 'v': verbose++; break; case '1': if (ipl_phase != RUNTIME_CFG) errflg++; ipl_phase = PHASE1; break; case '2': if (ipl_phase != RUNTIME_CFG) errflg++; ipl_phase = PHASE2; break; default: errflg++; } } if (errflg) exit (E_ARGS); if (lname == NULL) exit(E_LNAME); if (odm_initialize() == -1) { return (E_ODMINIT); } /* lock the database */ if (odm_lock("/etc/objrepos/config_lock",0) == -1) err_exit(E_ODMLOCK); /* open customized devices object class */ if ((int)(cusdev = odm_open_class(CuDv_CLASS)) == -1) err_exit(E_ODMOPEN); /* search for customized object with this logical name */ sprintf(sstring, "name = '%s'", lname); rc = (int) odm_get_first(cusdev, sstring, &cusobj); if (rc == 0) { /* No CuDv object with this name */ err_exit(E_NOCuDv); } else if (rc == -1) { /* ODM failure */ err_exit(E_ODMGET); } /* open predefined devices object class */ if ((int)(predev = odm_open_class(PdDv_CLASS)) == -1) err_exit(E_ODMOPEN); /* get predefined device object for this logical name */ sprintf(sstring, "uniquetype = '%s'", cusobj.PdDvLn_Lvalue); rc = (int)odm_get_first(predev, sstring, &preobj); if (rc == 0) { /* No PdDv object for this device */ err_exit(E_NOPdDv); } else if (rc == -1) { /* ODM failure */ err_exit(E_ODMGET); } /* close predefined device object class */ if (odm_close_class(predev) == -1) err_exit(E_ODMCLOSE); if (ipl_phase != RUNTIME_CFG) setleds(preobj.led); /* * Now, if the device is already configured, we're * pretty much done. */ if (cusobj.status == AVAILABLE) { /* close customized device object class */ if (odm_close_class(cusdev) == -1) err_exit(E_ODMCLOSE); odm_terminate(); return(E_OK); } if (cusobj.status != DEFINED) { vprintf("bad state: %d\n", cusobj.status); err_exit(E_DEVSTATE); } /* get the device's parent object */ sprintf(sstring, "name = '%s'", cusobj.parent); rc = (int) odm_get_first(cusdev, sstring, &parobj); if (rc == 0) { /* Parent device not in CuDv */ err_exit(E_NOCuDvPARENT); } else if (rc == -1) { /* ODM failure */ err_exit(E_ODMGET); } /* Parent MUST be available to continue */ if (parobj.status != AVAILABLE) err_exit(E_PARENTSTATE); /* make sure that no other devices are configured */ /* at this location */ sprintf(sstring, "parent = '%s' AND location='%s' AND status=%d", cusobj.parent, cusobj.location, AVAILABLE); rc = (int) odm_get_first(cusdev, sstring, &cusobj); if (rc == -1) { /* odm failure */ err_exit(E_ODMGET); } else if (rc) { /* Error: device config'd at this location */ err_exit(E_AVAILCONNECT); } memcpy(conns, cusobj.location, NAMESIZE); vprintf("now fool with luns: location is %s\n", conns); ptr = conns; while (*ptr && ptr < &conns[NAMESIZE]) ptr++; ptr--; if (ptr < &conns[1]) { err_exit(E_BADATTR); } lun = *ptr - '0'; vprintf("I see lun %d\n", lun); if (lun < 0 || lun >= 8) err_exit(E_INVCONNECT); ddsinfo.lun = lun; /* * Generate Target */ if (ptr[-1] == ',') { *(--ptr) = 0; } else { *ptr = 0; } while (ptr > conns && *ptr != '-') ptr--; if (*ptr == '-') ptr++; ddsinfo.target = strtol(ptr, (char **) NULL, 0); vprintf("I see tgt %d ptr = %d\n", ddsinfo.target, ptr - conns); /* * Generate dev_t for adapter */ cprp = odm_open_class(CuDvDr_CLASS) ; sprintf(sstring, "value3 = %s", cusobj.parent); rc = (int) odm_get_obj(cprp, sstring, &dpr, TRUE); if (rc == 0) { err_exit(E_NOCuDvPARENT); } else if (rc == -1) { err_exit(E_ODMGET); } ddsinfo.busid = (dev_t) makedev(atoi(dpr.value1), atoi(dpr.value2)); vprintf("I see %d.%d for connecting adapter\n", major(ddsinfo.busid), minor(ddsinfo.busid)); /* * Get unit number out of logical name */ ptr = lname; ptr += strlen(preobj.prefix); unit = atoi(ptr); vprintf("I see %d as unit\n", unit); /* * Okay, now that we have the pertinent information that we'll * need (adapter dev_t, device type, target, lbits, shareable, * unit number), we can look into actually loading/configuring the * current driver. */ (void) sprintf(bufname, "/dev/%s", lname); /* * Get or generate major number.. */ if ((major = (long) genmajor(preobj.DvDr)) == -1) { odm_terminate(); return (E_MAJORNO); } vprintf("major is %d\n", major); /* * Let's see if this is the first time through. If it's * the first time through, getminor will return NULL * or won't have any minors in the list. */ mlist = getminor(major, &howmany, preobj.DvDr); vprintf("getminor: %x and howmany %d for %s\n", mlist, howmany, preobj.DvDr); domake = 1; if (mlist != NULL && howmany != 0) { /* * We have a list of minors already. * See if we already have the minor * we want defined. */ for (c = 0; c < howmany; c++) { if (mlist[c] == unit) { vprintf("unit %d already has minor\n", unit); domake = 0; break; } } } if (domake) { (void) unlink(bufname); /* * Now create the minor number that will match the unit number. * We really don't care whether genminor succeeds, since * we've alreay unlinked the device node. */ mlist = genminor(preobj.DvDr, major, unit, 1, 1, 1); if (mlist == (long *) NULL) { err_exit(E_MINORNO); } vprintf("making %s as %d.%d with minor returned as %d\n", bufname, major, unit, *mlist); if (mknod(bufname, MKNOD_MODE, makedev(major, unit))) { err_exit(E_MKSPECIAL); } } else { (void) mknod(bufname, MKNOD_MODE, makedev(major, unit)); } /* * Load the driver.... */ kmid = loadext(preobj.DvDr, TRUE, FALSE); if (!kmid) { err_exit(E_LOADEXT); } /* * And configure the driver... */ dd.kmid = kmid; dd.devno = makedev(major, unit); dd.cmd = CFG_INIT; dd.ddsptr = (caddr_t) &ddsinfo; dd.ddslen = sizeof (ddsinfo); if (sysconfig(SYS_CFGDD, &dd, sizeof (dd)) == CONF_FAIL) { int saverr = errno; /* * Unload driver... */ (void) loadext(preobj.DvDr, FALSE, FALSE); switch(saverr) { case ENODEV: err_exit(E_WRONGDEVICE); /* NOTREACHED */ break; case EBUSY: err_exit(E_AVAILCONNECT); /* NOTREACHED */ break; case EINVAL: default: err_exit(E_CFGINIT); /* NOTREACHED */ break; } } /* now mark the device as available */ cusobj.status = AVAILABLE; if (odm_change_obj(CuDv_CLASS, &cusobj) == -1) { /* * Unconfigure driver (for this instance)... */ dd.kmid = 0; dd.ddsptr = (caddr_t) NULL; dd.ddslen = (int ) 0; dd.cmd = CFG_TERM; (void) sysconfig(SYS_CFGDD, &dd, sizeof (dd)); /* * Unload driver... */ (void) loadext(preobj.DvDr, FALSE, FALSE); err_exit (E_ODMUPDATE); } (void) odm_terminate(); return (E_OK); } /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically * adjust the settings for this buffer only. This must remain at the end * of the file. * --------------------------------------------------------------------------- * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/gsc/gscdd.c0000664000076400007640000004770112357250005020114 0ustar00martineamartinea00000000000000/* * $Id: gscdd.c,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1996, 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define DD_LOCK 37 #include "gscdds.h" static int strlen(char *s) { char *p = s; while (*p) p++; return p - s; } static void memset(void *x, int val, size_t amt) { char *p = (char *)x; while (--amt) *p++ = (char) val; } static void memcpy(void *dst, void *src, size_t amt) { char *dest = dst, *source = src; while (--amt) *dest++ = *source++; } #define bcopy(src, dst, nbytes) memcpy(dst, src, nbytes) /* * Local Definitions */ #define HKWD_GSC_DD 0x66600000 #define _COM_TRACE(b, var) \ var = strlen(b); trcgenk(0, HKWD_GSC_DD, var, var, b) #define Trace0(val, str) \ if (scudebug >= val) { \ int icxq; \ _COM_TRACE(str, icxq); \ } #define Trace1(val, fmt, arg1) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1); \ _COM_TRACE(buf, icxq); \ } #define Trace2(val, fmt, arg1, arg2) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1, arg2); \ _COM_TRACE(buf, icxq); \ } #define Trace3(val, fmt, arg1, arg2, arg3) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1, arg2, arg3); \ _COM_TRACE(buf, icxq); \ } #define Trace4(val, fmt, arg1, arg2, arg3, arg4) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1, arg2, arg3, arg4); \ _COM_TRACE(buf, icxq); \ } #define Trace5(val, fmt, arg1, arg2, arg3, arg4, arg5) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1, arg2, arg3, arg4, arg5); \ _COM_TRACE(buf, icxq); \ } #define Trace6(val, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ if (scudebug >= val) { \ int icxq; char buf[256]; \ (void) sprintf(buf, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \ _COM_TRACE(buf, icxq); \ } #define MJ_RTN(VAL) simple_unlock(&sp->dd_lock); return (VAL) typedef struct { struct sc_buf scsibuf; uint index; } gsc_buf_t; typedef struct { Simple_lock dd_lock; Simple_lock buf_lock; struct file *fp; /* file pointer */ gsc_buf_t cbuf; #define cmdbuf cbuf.scsibuf /* buffer for command */ gsc_buf_t rbuf; #define rqsbuf rbuf.scsibuf /* buffer for request sense */ dev_t dev; /* Adapter dev */ u_char tgt; /* target ID */ u_char lun; /* logical unit */ u_char isopen; /* device is open */ u_char iscfg; /* non-zero to show this as configured */ u_char unstart; /* stop device on unconfigure */ u_char needresume; /* needs an SC_RESUME with next command */ } gsc_softc_t; /* * External References */ extern int copyin(void *, void *, int); extern int copyout(void *, void *, int); extern int devstrat(struct buf *); extern int nodev(void); extern void setuerror(int); /* * Device Driver Entry Points */ int gsc_config(dev_t, int, struct uio *); static int gsc_open(dev_t); static int gsc_close(dev_t); static int gsc_ioctl(dev_t, int, void *, ulong); static void gscdd_intr(struct buf *); /* * Static Data */ static int scudebug = 10; static int nunits = 0; static gsc_softc_t softinfo[MAX_UNITS] = { 0 }; lock_t config_lock = { LOCK_AVAIL }; /* * Local Function Prototypes */ static int gsopen(gsc_softc_t *); static void gsclose(gsc_softc_t *, dev_t); static int gsccmd(dev_t, scmd_t *, ulong); static int make_rqs(gsc_softc_t *, char, char *, int, int); /* * Configuration Routines */ int gsc_config(dev_t devno, int cmd, struct uio * uiop) { struct gsc_ddsinfo ddsinfo; gsc_softc_t *sp; int result, i, unit; extern int nodev(); static struct devsw gsc_dsw = { gsc_open, /* entry point for open routine */ gsc_close, /* entry point for close routine */ nodev, /* entry point for read routine */ nodev, /* entry point for write routine */ gsc_ioctl, /* entry point for ioctl routine */ nodev, /* entry point for strategy routine */ 0, /* pointer to tty device structure */ nodev, /* entry point for select routine */ gsc_config, /* entry point for config routine */ nodev, /* entry point for print routine */ nodev, /* entry point for dump routine */ nodev, /* entry point for mpx routine */ nodev, /* entry point for revoke routine */ NULL, /* pointer to device specific data */ NULL, /* select pointer */ DEV_MPSAFE }; if (lockl(&config_lock, LOCK_SHORT) != LOCK_SUCC) { return (EINVAL); } unit = minor(devno); if (unit < 0 || unit >= MAX_UNITS) { Trace2(0, "%d: bad unit %d", __LINE__, unit); result = EINVAL; unlockl(&config_lock); return (result); } switch (cmd) { case CFG_INIT: Trace2(2, "CFG_INIT: unit %d nunit %d\n", unit, nunits); /* * Initialize softinfo, first time around. */ if (nunits == 0) { memset(softinfo, 0, sizeof (softinfo)); } /* * Copy in DDS information */ uiomove((caddr_t) &ddsinfo, sizeof ddsinfo, UIO_WRITE, uiop); sp = &softinfo[unit]; if (sp->iscfg) { Trace1(0, "CFG_INIT: unit %d already configd", unit); result = EBUSY; break; } lock_alloc(&sp->dd_lock, LOCK_ALLOC_PIN, DD_LOCK, -1); lock_alloc(&sp->buf_lock, LOCK_ALLOC_PIN, DD_LOCK, -1); simple_lock_init(&sp->dd_lock); sp->dev = ddsinfo.busid; sp->tgt = ddsinfo.target; sp->lun = ddsinfo.lun; sp->cbuf.index = sp->rbuf.index = unit; /* * If this is the first time through: * Add entry to the device switch table to call this driver * Pin driver code. */ if (nunits == 0) { result = devswadd(devno, &gsc_dsw); if (result != 0) { Trace1(0, "CFG_INIT: devswadd result: %d", result); break; } result = pincode((int (*) ()) gscdd_intr); if (result) { Trace1(0, "CFG_INIT: pincode result: %d", result); devswdel(devno); break; } } sp->iscfg = 1; result = gsopen(sp); if (result) { Trace2(0, "CFG_INIT: gsopen returns %d for unit %d", result, unit); sp->iscfg = 0; gsclose(sp, devno); break; } if (nunits <= unit) nunits = unit + 1; sp->iscfg = 1; break; case CFG_TERM: Trace1(2, "CFG_TERM unit %d", unit); result = 0; sp = &softinfo[unit]; if (sp->iscfg == 0) { Trace1(0, "CFG_TERM: unit %d not already configd", unit); result = ENXIO; break; } else if (sp->isopen) { Trace1(0, "CFG_TERM: unit %d open", unit); result = EBUSY; break; } sp->iscfg = 0; /* block further actions */ gsclose(sp, devno); break; default: result = EINVAL; break; } unlockl(&config_lock); return (result); } /* * Validate that devno is indeed for a SCSI adapter, and set up stuff for it. */ static int gsopen(gsc_softc_t * sp) { struct file *fp; int r; struct devinfo di; Trace2(2, "gsopen: %d.%d", major(sp->dev), minor(sp->dev)); sp->fp = NULL; r = fp_opendev(sp->dev, DREAD|DWRITE|DKERNEL, NULL, 0, &fp); if (r) { Trace3(0, "%d: fp_opendev unit %d=%d", __LINE__, sp->cbuf.index, r); return (r); } r = fp_ioctl(fp, IOCINFO, (caddr_t) &di, NULL); if (r) { Trace3(0, "%d: fp_ioctl unit %d=%d", __LINE__, sp->cbuf.index, r); (void) fp_close(fp); return (r); } if (di.devtype != DD_BUS || di.devsubtype != DS_SCSI) { Trace2(0, "%d: not SCSI bus on unit %d", __LINE__, sp->cbuf.index); (void) fp_close(fp); return (r); } sp->fp = fp; sp->unstart = 1; if (fp_ioctl(sp->fp, SCIOSTART, (caddr_t) IDLUN(sp->tgt, sp->lun), NULL)) { sp->unstart = 0; } return (0); } /* * Shut down a device */ static void gsclose(gsc_softc_t *sp, dev_t devno) { int i; if (sp->fp != NULL && sp->unstart) { (void) fp_ioctl(sp->fp, SCIOSTOP, (caddr_t) IDLUN(sp->tgt, sp->lun), NULL); sp->unstart = 0; } if (sp->fp) { (void) fp_close(sp->fp); sp->fp = NULL; } for (i = 0; i < MAX_UNITS; i++) { if (softinfo[i].iscfg) { Trace1(0, "gsclose: unit %d still confd", i); break; } } if (i == MAX_UNITS) { Trace0(0, "gsclose: All unconfigured now"); (void) devswdel(devno); unpincode((int (*) ()) gscdd_intr); } } /* * VFS entry points */ static int gsc_open(dev_t devno) { gsc_softc_t *sp; int unit = minor(devno); Trace1(2, "gsc_open: open unit %d", unit); if (unit < 0 || unit >= MAX_UNITS) { return (ENODEV); } sp = &softinfo[unit]; if (sp->iscfg == 0 || sp->fp == NULL) { Trace2(0, "%d: bad unit (%d)", __LINE__, unit); return (ENODEV); } simple_lock(&sp->dd_lock); if (sp->isopen) { simple_unlock(&sp->dd_lock); return (EBUSY); } sp->isopen = 1; simple_unlock(&sp->dd_lock); return (0); } static int gsc_close(dev_t dev) { gsc_softc_t *sp; int unit = minor(dev); Trace1(2, "gsc_close: close unit %d", unit); if (unit < 0 || unit >= MAX_UNITS) { return (ENODEV); } sp = &softinfo[unit]; if (sp->iscfg == 0) { return (ENODEV); } simple_lock(&sp->dd_lock); sp->isopen = 0; simple_unlock(&sp->dd_lock); return (0); } static int gsc_ioctl(dev_t dev, int cmd, void *arg, ulong dflag) { switch (cmd) { case GSC_CMD: return (gsccmd(dev, arg, dflag)); case GSC_SETDBG: { int i; cmd = copyin(arg, (caddr_t) &i, sizeof (int)); if (cmd != 0) { return (cmd); } cmd = scudebug; scudebug = i; return (copyout((caddr_t) &cmd, arg, sizeof (int))); } default: return (ENOTTY); } } /****************************************************************************/ static int gsccmd(dev_t dev, scmd_t *argcmd, ulong dflag) { gsc_softc_t *sp; scmd_t local, *l; char sbyte, albits; struct sc_buf *usc; struct buf *Ubp; int r, r2, ival, upin, unit, rqvalid, once; unit = minor(dev); Trace2(1, "%d: cmd for unit %d", __LINE__, minor(dev)); if (unit < 0 || unit >= MAX_UNITS) { setuerror(ENXIO); return (ENXIO); } sp = &softinfo[unit]; if (sp->iscfg == 0 || sp->fp == NULL) { Trace2(0, "gsccmd: bad unit %d (cfg=%d)", unit, sp->iscfg); r = ENODEV; setuerror(r); return (r); } simple_lock(&sp->dd_lock); l = &local; if (dflag & DKERNEL) { l = argcmd; } else { r = copyin((caddr_t) argcmd, (caddr_t) l, sizeof (scmd_t)); if (r != 0) { Trace2(0, "%d: copyin=%d", __LINE__, r); setuerror(r); MJ_RTN (r); } } Trace6(1, "%d: cdblen%d datalen%d snslen%d rw=%d tv=%d", __LINE__, l->cdblen, l->datalen, l->senselen, l->rw, l->timeval); sbyte = 0; rqvalid = upin = r = r2 = 0; usc = &sp->cmdbuf; Ubp = &usc->bufstruct; memset(usc, 0, sizeof (struct sc_buf)); /* * Check some parameters... */ if (l->cdblen > sizeof (struct sc_cmd)) { r = EINVAL; goto out; } /* * Setup sc_buf structure */ Ubp->b_iodone = gscdd_intr; Ubp->b_dev = sp->dev; Ubp->b_flags = B_BUSY | B_MPSAFE; Ubp->b_resid = Ubp->b_bcount = l->datalen; Ubp->b_xmemd.aspace_id = XMEM_INVAL; Ubp->b_event = EVENT_NULL; if (l->datalen) { Ubp->b_un.b_addr = l->data_buf; if (l->rw) { Ubp->b_flags |= B_READ; } if (dflag & DKERNEL) { r = pinu(l->data_buf, l->datalen, UIO_SYSSPACE); } else { r = pinu(l->data_buf, l->datalen, UIO_USERSPACE); } if (r) { Trace2(0, "%d: pinu buf %d", __LINE__, r); goto out; } upin++; if (dflag & DKERNEL) { r = xmattach(l->data_buf, l->datalen, &Ubp->b_xmemd, SYS_ADSPACE); } else { r = xmattach(l->data_buf, l->datalen, &Ubp->b_xmemd, USER_ADSPACE); } if (r != XMEM_SUCC) { Trace2(0, "%d: xmattach %d", __LINE__, r); r = EFAULT; goto out; } upin++; r = xmemdma(&Ubp->b_xmemd, l->data_buf, XMEM_UNHIDE); if (r == XMEM_FAIL) { Trace2(0, "%d: xmemdma %d", __LINE__, r); r = EFAULT; goto out; } r = 0; } usc->scsi_command.scsi_id = sp->tgt; usc->scsi_command.scsi_length = l->cdblen; if (dflag & DKERNEL) { bcopy(l->cdb, (caddr_t)&usc->scsi_command.scsi_cmd, l->cdblen); } else { r = copyin(l->cdb, (caddr_t) & usc->scsi_command.scsi_cmd, l->cdblen); if (r != 0) { goto out; } } /* Setting lun in SCSI CDB as well as sc_buf structure */ usc->lun = sp->lun; usc->scsi_command.scsi_cmd.lun &= 0x1F; usc->scsi_command.scsi_cmd.lun |= (sp->lun << 5) & 0xE0; albits = usc->scsi_command.scsi_cmd.lun; usc->timeout_value = l->timeval; if (sp->needresume) { usc->flags |= SC_RESUME; sp->needresume = 0; } if (scudebug > 1) { char *c = (char *) &usc->scsi_command.scsi_cmd; char cdbuf[64]; (void) sprintf(cdbuf, "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x " "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x", c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10], c[11]); Trace2(0, "%d: cdb=%s", __LINE__, cdbuf); } once = 0; again: Ubp->b_flags &= ~B_DONE; r = devstrat(Ubp); if (r == 0) { ival = disable_lock(INTCLASS1, &sp->buf_lock); while ((Ubp->b_flags & B_DONE) == 0) { e_sleep_thread(&Ubp->b_event, &sp->buf_lock, LOCK_HANDLER); } unlock_enable(ival, &sp->buf_lock); } else { /* * If ENXIO, We never actually got started. */ if (r == ENXIO && once == 0) { once++; usc->flags |= SC_RESUME|SC_DELAY_CMD; goto again; } sp->needresume = 1; Trace2(1, "%d: devstrat=%d", __LINE__, r); goto out; } Trace4(1, "%d: b_flags %x b_error %d b_resid %d", __LINE__, Ubp->b_flags, Ubp->b_error, Ubp->b_resid); Trace5(1, "%d: sv %x st %x gc %x as %x", __LINE__, usc->status_validity, usc->scsi_status, usc->general_card_status, usc->adap_q_status); if (Ubp->b_flags & B_ERROR) { r = Ubp->b_error; sp->needresume = 1; } if (usc->status_validity & SC_SCSI_ERROR) { sbyte = (usc->scsi_status & SCSI_STATUS_MASK); sp->needresume = 1; if (sbyte == SC_CHECK_CONDITION && l->senselen) { struct sc_buf *usl; struct buf *Sbp; r = make_rqs(sp, albits, l->sense_buf, l->senselen, (dflag & DKERNEL) != 0); if (r) { Trace2(0, "%d: make_rqs=%d", __LINE__, r); goto out; } usl = &sp->rqsbuf; Sbp = &usl->bufstruct; r = devstrat(Sbp); if (r == 0) { ival = disable_lock(INTCLASS1, &sp->buf_lock); while ((Sbp->b_flags & B_DONE) == 0) { e_sleep_thread(&Sbp->b_event, &sp->buf_lock, LOCK_HANDLER); } unlock_enable(ival, &sp->buf_lock); } else { Trace2(0, "%d:ds=%d for rqs", __LINE__, r); goto out; } xmdetach(&Sbp->b_xmemd); if (dflag & DKERNEL) { (void) unpinu(l->sense_buf, l->senselen, UIO_SYSSPACE); } else { (void) unpinu(l->sense_buf, l->senselen, UIO_USERSPACE); } Trace4(1, "%d SENSE: b_flags %x b_error %d b_resid %d", __LINE__, Sbp->b_flags, Sbp->b_error, Sbp->b_resid); Trace5(1, "%d: sv %x st %x gc %x as %x", __LINE__, usl->status_validity, usl->scsi_status, usl->general_card_status, usl->adap_q_status); if (usl->scsi_status || usl->general_card_status) { r = EIO; } else { rqvalid = 1; } } } if (usc->status_validity & SC_ADAPTER_ERROR) { sp->needresume = 1; Trace2(0, "%d: adapter error 0x%x", __LINE__, usc->general_card_status); Ubp->b_flags |= B_ERROR; switch (usc->general_card_status) { case SC_NO_DEVICE_RESPONSE: case SC_HOST_IO_BUS_ERR: case SC_SCSI_BUS_FAULT: case SC_CMD_TIMEOUT: case SC_ADAPTER_HDW_FAILURE: case SC_ADAPTER_SFW_FAILURE: case SC_FUSE_OR_TERMINAL_PWR: case SC_SCSI_BUS_RESET: default: r = EIO; break; } } /* * Log errors through errsave function */ if (usc->status_validity & (SC_SCSI_ERROR|SC_ADAPTER_ERROR)) { struct sc_error_log_df log; memset(&log, 0, sizeof (log)); /* * All errors are 'temporary unknown driver error' */ log.error_id = ERRID_SCSI_ERR6; (void) sprintf(log.resource_name, "gsc%d", unit); memcpy(&log.scsi_command, &usc->scsi_command, sizeof (struct scsi)); log.status_validity = usc->status_validity; log.scsi_status = usc->scsi_status; log.general_card_status = usc->general_card_status; if (rqvalid) { int amt; if (l->senselen > 128) amt = 128; else amt = l->senselen; (void) copyin(l->sense_buf, log.req_sense_data, amt); } errsave(&log, sizeof (struct sc_error_log_df)); } if (dflag & DKERNEL) { *l->statusp = sbyte; } else { r2 = copyout(&sbyte, l->statusp, 1); if (r2 != 0) { if (r == 0) r = r2; goto out; } } out: if (l->datalen) { if (upin > 1) { xmdetach(&Ubp->b_xmemd); upin--; } if (upin > 0) { if (dflag & DKERNEL) { (void) unpinu(l->data_buf, l->datalen, UIO_SYSSPACE); } else { (void) unpinu(l->data_buf, l->datalen, UIO_USERSPACE); } upin--; } } Trace2(1, "%d: returning %d", __LINE__, r); if (r) setuerror(r); MJ_RTN (r); } static int make_rqs(gsc_softc_t * sp, char albits, char *uaddr, int ulen, int isk) { struct sc_buf *usl; struct buf *Sbp; int err, upin; if (ulen > 255) ulen = 255; upin = err = 0; usl = &sp->rqsbuf; Sbp = &usl->bufstruct; memset(usl, 0, sizeof (struct sc_buf)); Sbp->b_un.b_addr = uaddr; Sbp->b_resid = Sbp->b_bcount = ulen; Sbp->b_iodone = gscdd_intr; Sbp->b_dev = sp->dev; Sbp->b_flags = B_BUSY | B_READ | B_MPSAFE; Sbp->b_event = EVENT_NULL; Sbp->b_xmemd.aspace_id = XMEM_INVAL; if (isk) err = pinu(uaddr, ulen, UIO_SYSSPACE); else err = pinu(uaddr, ulen, UIO_USERSPACE); if (err) goto out; upin++; if (isk) err = xmattach(uaddr, ulen, &Sbp->b_xmemd, SYS_ADSPACE); else err = xmattach(uaddr, ulen, &Sbp->b_xmemd, USER_ADSPACE); if (err != XMEM_SUCC) { err = EFAULT; goto out; } upin++; err = xmemdma(&Sbp->b_xmemd, Sbp->b_un.b_addr, XMEM_UNHIDE); if (err == XMEM_FAIL) { err = EFAULT; (void) xmdetach(&Sbp->b_xmemd); goto out; } err = 0; usl->lun = sp->lun; /* Setting lun in sc_buf structure */ usl->scsi_command.scsi_id = sp->tgt; usl->scsi_command.scsi_length = 6; usl->scsi_command.scsi_cmd.scsi_op_code = 0x3; usl->scsi_command.scsi_cmd.lun = albits & 0xE0; /*ONLY copy the lun bits*/ usl->scsi_command.scsi_cmd.scsi_bytes[2] = ulen; usl->timeout_value = 2; usl->flags = SC_RESUME; sp->needresume = 0; out: if (err) { if (upin > 1) { xmdetach(&Sbp->b_xmemd); upin--; } if (upin > 0) { if (isk) (void) unpinu(uaddr, ulen, UIO_SYSSPACE); else (void) unpinu(uaddr, ulen, UIO_USERSPACE); upin--; } } return (err); } void gscdd_intr(struct buf * bp) { int lv; gsc_softc_t *sp = &softinfo[((gsc_buf_t *)bp)->index]; lv = disable_lock(INTIODONE, &sp->buf_lock); bp->b_flags |= B_DONE; unlock_enable(lv, &sp->buf_lock); e_wakeup(&bp->b_event); } /* * mode: c * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/gsc/defgsc.c0000664000076400007640000001540512357250005020257 0ustar00martineamartinea00000000000000/* * $Id: defgsc.c,v 1.1 2001/04/15 11:12:37 ant Exp $ * Copyright (c) 1997 by Matthew Jacob * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; version 2. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The author may be reached via electronic communications at * * mjacob@feral.com * * or, via United States Postal Address * * Matthew Jacob * 1831 Castro Street * San Francisco, CA, 94131 */ #include #include #include #include #include static const char *triple = "type = '%s' AND class = '%s' AND subclass = '%s'"; static const char *utype = "uniquetype = '%s' and connkey = '%s' and connwhere = '%s'"; static void err_exit(char exitcode) { odm_close_class(CuDv_CLASS); odm_close_class(PdDv_CLASS); odm_terminate(); exit(exitcode); } int main(int a, char **v) { extern int optind; extern char *optarg; char *class, *subclass, *type, *parent, *connect; char sstring[256], lname[256]; char parent_loc[LOCSIZE]; struct Class *cusdev; struct PdDv PdDv; struct PdCn PdCn; struct CuDv CuDv; int seqno, rc, errflg, c; errflg = 0; class = subclass = type = NULL; parent = connect = NULL; while ((c = getopt(a, v, "p:w:c:s:t:")) != EOF) { switch (c) { case 'c': if (class != NULL) errflg++; class = optarg; break; case 's': if (subclass != NULL) errflg++; subclass = optarg; break; case 't': if (type != NULL) errflg++; type = optarg; break; case 'w': if (connect != NULL) errflg++; connect = optarg; break; case 'p': if (parent != NULL) errflg++; parent = optarg; break; default: errflg++; } } if (errflg) { exit(E_ARGS); } /* * Verify that we have the right triple and all of it specified. */ if (class == NULL || subclass == NULL || type == NULL) { exit(E_TYPE); } if (strcmp(class, "generic") || strcmp(subclass, "scsi") || strcmp(type, "gsc")) { exit(E_TYPE); } /* * Verify that a parent and a connection address was specified */ if (parent == NULL || connect == NULL) { exit(E_PARENT); } /* * Open up ODM. */ if (odm_initialize() == -1) { exit(E_ODMINIT); } if (odm_lock("/etc/objrepos/config_lock", 0) == -1) { err_exit(E_ODMLOCK); } /* * Get the PreDefined Device Object */ (void) sprintf(sstring, triple, type, class, subclass); rc = (int) odm_get_first(PdDv_CLASS, sstring, &PdDv); if (rc == 0) { err_exit(E_NOPdDv); } else if (rc == -1) { err_exit(E_ODMGET); } /* * Open the Customized Device data base */ if ((int) (cusdev = odm_open_class(CuDv_CLASS)) == -1) { err_exit(E_ODMOPEN); } /* * Check parent device */ (void) sprintf(sstring, "name = '%s'", parent); rc = (int) odm_get_first(cusdev, sstring, &CuDv); if (rc == 0) { err_exit(E_NOCuDvPARENT); } else if (rc == -1) { err_exit(E_ODMGET); } (void) memset(parent_loc, 0, sizeof parent_loc); (void) strncpy(parent_loc, CuDv.location, sizeof CuDv.location); (void) sprintf(sstring, utype, CuDv.PdDvLn_Lvalue, subclass , connect); rc = (int) odm_get_first(PdCn_CLASS, sstring, &PdCn); if (rc == 0) { err_exit(E_INVCONNECT); } else if (rc == -1) { err_exit(E_ODMGET); } /* * Generate a name. */ /* generate logical name for device */ if ((seqno = genseq(PdDv.prefix)) < 0) { err_exit(E_MAKENAME); } (void) sprintf(lname, "%s%d", PdDv.prefix, seqno); (void) sprintf(sstring, "name = '%s'", lname); rc = (int) odm_get_first(cusdev, sstring, &CuDv); if (rc == -1) { err_exit(E_ODMGET); } else if (rc != 0) { /* * Name already exists */ err_exit(E_LNAME); } /* Put device name into new CuDv object */ (void) strcpy(CuDv.name, lname); /* * Fill in remainder of new customized device object */ /* * Location codes for SCSI devices consists of 4 pairs of * digits separated by hyphens. The first two pairs of digits * identify the adapter's slot number. The last two pairs of * digits identify the adapter connector number and the scsi * connection address. As far as I can tell, there never * is a non-zero value on the connector number for SCSI * adapters. * * This is further complicated by a slight difference in * this naming convention where Model 320 and Model 220 * machines define the parent (adapter) location as 00-00-0S, * so we'll detect that variant. * * This can also be further complicated by the fact that * connection addresses changed between AIX Release 3.2.X * and AIX Release 4.X, where the trailing digit pair went * from a simple two digits (Target ID adjacent to Logical * Unit Number) to two digits separated by a comma. However, * since that is an argument passed in via the command line, * we can say, "Not our problem," and drive onwards. */ if (strlen(parent_loc) <= 5) { (void) sprintf(CuDv.location, "%s-00-%s", parent_loc, connect); } else { (void) sprintf(CuDv.location, "%s-%s", parent_loc, connect); } CuDv.status = DEFINED; CuDv.chgstatus = PdDv.chgstatus; strcpy(CuDv.ddins, PdDv.DvDr); strcpy(CuDv.PdDvLn_Lvalue, PdDv.uniquetype); strcpy(CuDv.parent, parent); strcpy(CuDv.connwhere, connect); if (odm_add_obj(cusdev, &CuDv) == -1) { err_exit(E_ODMADD); } if (odm_close_class(CuDv_CLASS) == -1) { err_exit(E_ODMCLOSE); } odm_terminate(); /* * Device defined successfully. * Print device name to stdout with a space appended. */ fprintf(stdout, "%s ", CuDv.name); exit(E_OK); } /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically * adjust the settings for this buffer only. This must remain at the end * of the file. * --------------------------------------------------------------------------- n * Local variables: * c-indent-level: 4 * c-brace-imaginary-offset: 0 * c-brace-offset: -4 * c-argdecl-indent: 4 * c-label-offset: -4 * c-continued-statement-offset: 4 * c-continued-brace-offset: 0 * End: */ amanda-3.3.6/contrib/dbbackup.ksh0000775000076400007640000000226012357250005020364 0ustar00martineamartinea00000000000000#!/bin/ksh # # Wrapper script to set environment and run dbbackup.tcl. # # user defined variables below adm=/var/backup mailuser=backup dbhomescript=/opt/oracle/bin/dbhome export ORACLE_SID=cc # no need to change anything below here pgm=${0##*/} if [[ ! -x ${adm}/dbbackup.tcl ]] then msg="${pgm}: cannot execute ${adm}/dbbackup.tcl" /usr/bin/mailx -s "${msg}" ${mailuser} < /dev/null print -u2 ${msg} exit 1 fi if [[ ! -x $dbhomescript ]] then msg="${pgm}: cannot execute $dbhomescript" /usr/bin/mailx -s "${msg}" ${mailuser} < /dev/null print -u2 ${msg} exit 1 fi timestamp=$(date "+%Y-%m-%d.%T") log=${adm}/dbbackup.log.${timestamp} err=${adm}/dbbackup.err.${timestamp} rm -f ${log} ${err} find ${adm}/. -name "dbbackup.log.*" -mtime +30 -print | xargs rm -f find ${adm}/. -name "dbbackup.err.*" -mtime +30 -print | xargs rm -f export ORACLE_HOME=$($dbhomescript "$ORACLE_SID") export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib ( ${adm}/dbbackup.tcl 2>&1 || touch ${err} 2>&1 ) | tee $log if [[ -f ${err} ]] then msg="${pgm}: dbbackup.tcl failed" /usr/bin/mailx -s "${msg}" ${mailuser} < ${log} print -u2 ${msg} exit 1 fi exit 0 amanda-3.3.6/device-src/0000775000076400007640000000000012357750427016500 5ustar00martineamartinea00000000000000amanda-3.3.6/device-src/Makefile.in0000664000076400007640000023226112357750240020544 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda tape library. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(aminclude_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am # ndmp-device.c includes files with old-skool prototypes, so: @GCC_COMPILER_TRUE@am__append_1 = -Wno-strict-prototypes sbin_PROGRAMS = $(am__EXEEXT_2) @WANT_TAPE_DEVICE_TRUE@am__append_2 = tape-device.c @WANT_S3_DEVICE_TRUE@am__append_3 = s3-device.c s3.c s3-util.c @WANT_DVDRW_DEVICE_TRUE@am__append_4 = dvdrw-device.c @WANT_NDMP_DEVICE_TRUE@am__append_5 = ndmp-device.c @WANT_NDMP_DEVICE_TRUE@am__append_6 = ../ndmp-src/libndmlib.la TESTS = noinst_PROGRAMS = $(am__EXEEXT_1) @WANT_S3_DEVICE_TRUE@am__append_7 = activate-devpay subdir = device-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibdir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)" LTLIBRARIES = $(amlib_LTLIBRARIES) libamdevice_la_DEPENDENCIES = ../common-src/libamanda.la \ ../xfer-src/libamxfer.la $(am__append_6) am__libamdevice_la_SOURCES_DIST = property.c device.c \ directtcp-connection.c null-device.c rait-device.c \ vfs-device.c xfer-source-device.c xfer-dest-device.c \ xfer-dest-taper.c xfer-dest-taper-cacher.c \ xfer-dest-taper-directtcp.c xfer-dest-taper-splitter.c \ xfer-source-recovery.c tape-device.c s3-device.c s3.c \ s3-util.c dvdrw-device.c ndmp-device.c @WANT_TAPE_DEVICE_TRUE@am__objects_1 = tape-device.lo @WANT_S3_DEVICE_TRUE@am__objects_2 = s3-device.lo s3.lo s3-util.lo @WANT_DVDRW_DEVICE_TRUE@am__objects_3 = dvdrw-device.lo @WANT_NDMP_DEVICE_TRUE@am__objects_4 = ndmp-device.lo am_libamdevice_la_OBJECTS = property.lo device.lo \ directtcp-connection.lo null-device.lo rait-device.lo \ vfs-device.lo xfer-source-device.lo xfer-dest-device.lo \ xfer-dest-taper.lo xfer-dest-taper-cacher.lo \ xfer-dest-taper-directtcp.lo xfer-dest-taper-splitter.lo \ xfer-source-recovery.lo $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) libamdevice_la_OBJECTS = $(am_libamdevice_la_OBJECTS) libamdevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamdevice_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = @WANT_S3_DEVICE_TRUE@am__EXEEXT_2 = activate-devpay$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__activate_devpay_SOURCES_DIST = activate-devpay.c @WANT_S3_DEVICE_TRUE@am_activate_devpay_OBJECTS = \ @WANT_S3_DEVICE_TRUE@ activate-devpay.$(OBJEXT) activate_devpay_OBJECTS = $(am_activate_devpay_OBJECTS) @WANT_S3_DEVICE_TRUE@activate_devpay_DEPENDENCIES = \ @WANT_S3_DEVICE_TRUE@ ../gnulib/libgnu.la SCRIPTS = $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES) DIST_SOURCES = $(am__libamdevice_la_SOURCES_DIST) \ $(am__activate_devpay_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(aminclude_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ $(SCRIPTS_INCLUDE) MAINTAINERCLEANFILES = INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/xfer-src \ -I$(top_srcdir)/ndmp-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) $(am__append_1) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) SCRIPTS_PERL = \ amdevcheck \ amtapetype sbin_SCRIPTS = $(SCRIPTS_PERL) amlib_LTLIBRARIES = libamdevice.la libamdevice_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamdevice_la_SOURCES = property.c device.c directtcp-connection.c \ null-device.c rait-device.c vfs-device.c xfer-source-device.c \ xfer-dest-device.c xfer-dest-taper.c xfer-dest-taper-cacher.c \ xfer-dest-taper-directtcp.c xfer-dest-taper-splitter.c \ xfer-source-recovery.c $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_5) libamdevice_la_LIBADD = ../common-src/libamanda.la \ ../xfer-src/libamxfer.la $(am__append_6) @WANT_S3_DEVICE_TRUE@activate_devpay_LDADD = \ @WANT_S3_DEVICE_TRUE@ ../gnulib/libgnu.la @WANT_S3_DEVICE_TRUE@activate_devpay_SOURCES = activate-devpay.c noinst_HEADERS = \ device.h \ directtcp-connection.h \ property.h \ s3.h \ s3-util.h \ xfer-device.h \ xfer-dest-taper.h \ vfs-device.h aminclude_HEADERS = all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu device-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu device-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/precompile.am: $(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-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || 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)$(amlibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \ } uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \ done clean-amlibLTLIBRARIES: -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libamdevice.la: $(libamdevice_la_OBJECTS) $(libamdevice_la_DEPENDENCIES) $(EXTRA_libamdevice_la_DEPENDENCIES) $(libamdevice_la_LINK) -rpath $(amlibdir) $(libamdevice_la_OBJECTS) $(libamdevice_la_LIBADD) $(LIBS) 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 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 activate-devpay$(EXEEXT): $(activate_devpay_OBJECTS) $(activate_devpay_DEPENDENCIES) $(EXTRA_activate_devpay_DEPENDENCIES) @rm -f activate-devpay$(EXEEXT) $(LINK) $(activate_devpay_OBJECTS) $(activate_devpay_LDADD) $(LIBS) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; 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 \ 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)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activate-devpay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directtcp-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvdrw-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndmp-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rait-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-cacher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-directtcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-splitter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-source-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-source-recovery.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-amincludeHEADERS: $(aminclude_HEADERS) @$(NORMAL_INSTALL) @list='$(aminclude_HEADERS)'; test -n "$(amincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amincludedir)" || 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)$(amincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(amincludedir)" || exit $$?; \ done uninstall-amincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(aminclude_HEADERS)'; test -n "$(amincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(amincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @SYNTAX_CHECKS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-amincludeHEADERS install-amlibLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-local \ clean clean-amlibLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS clean-sbinPROGRAMS ctags dist-hook \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am \ install-amincludeHEADERS install-amlibLTLIBRARIES install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-amincludeHEADERS \ uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS \ uninstall-sbinSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ @SYNTAX_CHECKS_TRUE@ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ @SYNTAX_CHECKS_TRUE@ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ @SYNTAX_CHECKS_TRUE@ rm $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ else \ @SYNTAX_CHECKS_TRUE@ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ @SYNTAX_CHECKS_TRUE@ fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-perl # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-shell # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< # 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: amanda-3.3.6/device-src/null-device.c0000664000076400007640000002366112357250004021045 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "device.h" #define NULL_DEVICE_MIN_BLOCK_SIZE (1) #define NULL_DEVICE_MAX_BLOCK_SIZE (INT_MAX) #define NULL_DEVICE_DEFAULT_BLOCK_SIZE DISK_BLOCK_BYTES /* * Type checking and casting macros */ #define TYPE_NULL_DEVICE (null_device_get_type()) #define NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice) #define NULL_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice const) #define NULL_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), null_device_get_type(), NullDeviceClass) #define IS_NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), null_device_get_type ()) #define NULL_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), null_device_get_type(), NullDeviceClass) static GType null_device_get_type (void); /* * Main object structure */ typedef struct _NullDevice NullDevice; struct _NullDevice { Device __parent__; }; /* * Class definition */ typedef struct _NullDeviceClass NullDeviceClass; struct _NullDeviceClass { DeviceClass __parent__; }; void null_device_register(void); /* here are local prototypes */ static void null_device_init (NullDevice * o); static void null_device_class_init (NullDeviceClass * c); static void null_device_base_init (NullDeviceClass * c); static DeviceStatusFlags null_device_read_label(Device * dself); static void null_device_open_device(Device * self, char *device_name, char * device_type, char * device_node); static gboolean null_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); static gboolean null_device_finish (Device * pself); static gboolean null_device_start_file(Device * self, dumpfile_t * jobInfo); static gboolean null_device_write_block (Device * self, guint size, gpointer data); static gboolean null_device_finish_file(Device * self); static Device* null_device_factory(char * device_name, char * device_type, char * device_node); /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; void null_device_register(void) { static const char * device_prefix_list[] = { "null", NULL }; register_device(null_device_factory, device_prefix_list); } static GType null_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (NullDeviceClass), (GBaseInitFunc) null_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) null_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (NullDevice), 0 /* n_preallocs */, (GInstanceInitFunc) null_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "NullDevice", &info, (GTypeFlags)0); } return type; } static void null_device_init (NullDevice * self) { Device * dself; GValue response; dself = (Device*)(self); bzero(&response, sizeof(response)); /* Register properties */ g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); device_set_simple_property(dself, PROPERTY_CONCURRENCY, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); device_set_simple_property(dself, PROPERTY_STREAMING, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_APPENDABLE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_FULL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_LEOM, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); /* this device's canonical name is always "null:", regardless of * the name the user supplies; note that we install the simple * getter in null_device_class_init. */ g_value_init(&response, G_TYPE_STRING); g_value_set_static_string(&response, "null:"); device_set_simple_property(dself, PROPERTY_CANONICAL_NAME, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_WRITE_ONLY); device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); } static void null_device_class_init (NullDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->read_label = null_device_read_label; device_class->open_device = null_device_open_device; device_class->start = null_device_start; device_class->finish = null_device_finish; device_class->start_file = null_device_start_file; device_class->write_block = null_device_write_block; device_class->finish_file = null_device_finish_file; } static void null_device_base_init (NullDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; /* Our canonical name is simpler than most devices' */ device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); } static Device* null_device_factory(char * device_name, char * device_type, char * device_node) { Device * device; g_assert(0 == strcmp(device_type, "null")); device = DEVICE(g_object_new(TYPE_NULL_DEVICE, NULL)); device_open_device(device, device_name, device_type, device_node); return device; } /* Begin virtual function overrides */ static DeviceStatusFlags null_device_read_label(Device * dself) { if (device_in_error(dself)) return FALSE; device_set_error(dself, stralloc(_("Can't open NULL device for reading or appending.")), DEVICE_STATUS_VOLUME_UNLABELED | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } static void null_device_open_device(Device * pself, char *device_name, char * device_type, char * device_node) { pself->min_block_size = NULL_DEVICE_MIN_BLOCK_SIZE; pself->max_block_size = NULL_DEVICE_MAX_BLOCK_SIZE; pself->block_size = NULL_DEVICE_DEFAULT_BLOCK_SIZE; if (parent_class->open_device) { parent_class->open_device(pself, device_name, device_type, device_node); } } static gboolean null_device_start (Device * pself, DeviceAccessMode mode, char * label, char * timestamp) { NullDevice * self; self = NULL_DEVICE(pself); if (device_in_error(self)) return FALSE; pself->access_mode = mode; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); if (mode == ACCESS_WRITE) { pself->volume_label = newstralloc(pself->volume_label, label); pself->volume_time = newstralloc(pself->volume_time, timestamp); pself->header_block_size = 32768; return TRUE; } else { device_set_error(pself, stralloc(_("Can't open NULL device for reading or appending.")), DEVICE_STATUS_VOLUME_UNLABELED | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } } /* This default implementation does very little. */ static gboolean null_device_finish (Device * pself) { pself->access_mode = ACCESS_NULL; if (device_in_error(pself)) return FALSE; return TRUE; } static gboolean null_device_start_file(Device * d_self, dumpfile_t * jobInfo G_GNUC_UNUSED) { g_mutex_lock(d_self->device_mutex); d_self->in_file = TRUE; g_mutex_unlock(d_self->device_mutex); d_self->is_eom = FALSE; d_self->block = 0; if (d_self->file <= 0) d_self->file = 1; else d_self->file ++; return TRUE; } static gboolean null_device_write_block (Device * pself, guint size G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED) { NullDevice * self; self = NULL_DEVICE(pself); if (device_in_error(self)) return FALSE; pself->block++; return TRUE; } static gboolean null_device_finish_file(Device * pself) { if (!pself->in_file) return TRUE; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); if (device_in_error(pself)) return FALSE; return TRUE; } amanda-3.3.6/device-src/xfer-dest-taper-cacher.c0000664000076400007640000013404412357250004023071 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "xfer-device.h" #include "arglist.h" #include "conffile.h" /* A transfer destination that writes an entire dumpfile to one or more files * on one or more devices, caching each part so that it can be rewritten on a * subsequent volume in the event of an unexpected EOM. This is designed to * work in concert with Amanda::Taper::Scribe. */ /* Future Plans: * - capture EOF early enough to avoid wasting a tape when the part size is an even multiple of the volume size - maybe reader thread can just go back and tag previous slab with EOF in that case? * - use mmap to make the disk-cacher thread unnecessary, if supported, by simply mapping slabs into the disk cache file * - can we find a way to fall back to mem_cache when the disk cache gets ENOSPC? Does it even make sense to try, since this would change the part size? * - distinguish some permanent device errors and do not retry the part? (this will be a change of behavior) */ /* * Slabs * * Slabs are larger than blocks, and are the unit on which the element * operates. They are designed to be a few times larger than a block, to * achieve a corresponding reduction in the number of locks and unlocks used * per block, and similar reduction in the the amount of memory overhead * required. */ typedef struct Slab { struct Slab *next; /* counts incoming pointers: the preceding slab's 'next' pointer, and pointers * from any processes operating on the slab */ gint refcount; /* number of this slab in the sequence, global to this element's lifetime. * Since this counts slabs, which are about 1M, this can address 16 * yottabytes of data before wrapping. */ guint64 serial; /* slab size; this is only less than the element's slab size if the * transfer is at EOF. */ gsize size; /* base of the slab_size buffer */ gpointer base; } Slab; /* * Xfer Dest Taper */ static GObjectClass *parent_class = NULL; typedef struct XferDestTaperCacher { XferDestTaper __parent__; /* object parameters * * These values are supplied to the constructor, and can be assumed * constant for the lifetime of the element. */ /* maximum buffer space to use for streaming; this is unrelated to the * fallback_splitsize */ gsize max_memory; /* split buffering info; if we're doing memory buffering, use_mem_cache is * true; if we're doing disk buffering, disk_cache_dirname is non-NULL and * contains the (allocated) filename of the cache file. In any * case, part_size gives the desired part size. If part_size is zero, then * no splitting takes place (so part_size is effectively infinite). */ gboolean use_mem_cache; char *disk_cache_dirname; guint64 part_size; /* (bytes) */ /* * threads */ /* The thread doing the actual writes to tape; this also handles buffering * for streaming */ GThread *device_thread; /* The thread writing slabs to the disk cache, if any */ GThread *disk_cache_thread; /* slab train * * All in-memory data is contained in a linked list called the "slab * train". Various components are operating simultaneously at different * points in this train. Data from the upstream XferElement is appended to * the head of the train, and the device thread follows along behind, * writing data to the device. When caching parts in memory, the slab * train just grows to eventually contain the whole part. When using an * on-disk cache, the disk cache thread writes the tail of the train to * disk, freeing slabs to be re-used at the head of the train. Some * careful coordination of these components allows them to operate as * independently as possible within the limits of the user's configuration. * * Slabs are rarely, if ever, freed: the oldest_slab reference generally * ensures that all slabs have refcount > 0, and this pointer is only * advanced when re-using slabs that have been flushed to the disk cache or * when freeing slabs after completion of the transfer. */ /* pointers into the slab train are all protected by this mutex. Note that * the slabs themselves can be manipulated without this lock; it's only * when changing the pointers that the mutex must be held. Furthermore, a * foo_slab variable which is not NULL will not be changed except by its * controlling thread (disk_cacher_slab is controlled by disk_cache_thread, * and device_slab is controlled by device_thread). This means that a * controlling thread can drop the slab_mutex once it has ensured its slab * is non-NULL. * * Slab_cond is notified when a new slab is made available from the reader. * Slab_free_cond is notified when a slab becomes available for * reallocation. * * Any thread waiting on either condition variable should also check * elt->cancelled, and act appropriately if awakened in a cancelled state. */ GMutex *slab_mutex; GCond *slab_cond; GCond *slab_free_cond; /* slabs in progress by each thread, or NULL if the thread is waiting on * slab_cond. These can only be changed by their respective threads, except * when they are NULL (in which case the reader will point them to a new * slab and signal the slab_cond). */ Slab *volatile disk_cacher_slab; Slab *volatile mem_cache_slab; Slab *volatile device_slab; /* tail and head of the slab train */ Slab *volatile oldest_slab; Slab *volatile newest_slab; /* thread-specific information * * These values are only used by one thread, and thus are not * subject to any locking or concurrency constraints. */ /* slab in progress by the reader (not in the slab train) */ Slab *reader_slab; /* the serial to be assigned to reader_slab */ guint64 next_serial; /* bytes written to the device in this part */ guint64 bytes_written; /* bytes written to the device in the current slab */ guint64 slab_bytes_written; /* element state * * "state" includes all of the variables below (including device * parameters). Note that the device_thread reads state values when * paused is false without locking the mutex. No other thread should * change state when the element is not paused. * * If there is every any reason to lock both mutexes, acquire this one * first. * * Any thread waiting on this condition variable should also check * elt->cancelled, and act appropriately if awakened in a cancelled state. */ GMutex *state_mutex; GCond *state_cond; volatile gboolean paused; /* The device to write to, and the header to write to it */ Device *volatile device; dumpfile_t *volatile part_header; /* If true, when unpaused, the device should begin at the beginning of the * cache; if false, it should proceed to the next part. */ volatile gboolean retry_part; /* If true, the previous part was completed successfully; only used for * assertions */ volatile gboolean last_part_successful; /* part number in progress */ volatile guint64 partnum; /* if true, the main thread should *not* call start_part */ volatile gboolean no_more_parts; /* the first serial in this part, and the serial to stop at */ volatile guint64 part_first_serial, part_stop_serial; /* read and write file descriptors for the disk cache file, in use by the * disk_cache_thread. If these are -1, wait on state_cond until they are * not; once the value is set, it will not change. */ volatile int disk_cache_read_fd; volatile int disk_cache_write_fd; /* device parameters * * Note that these values aren't known until we begin writing to the * device; if block_size is zero, threads should block on state_cond until * it is nonzero, at which point all of the dependent fields will have * their correct values. Note that, since this value never changes after * it has been set, it is safe to read block_size without acquiring the * mutext first. */ /* this device's need for streaming */ StreamingRequirement streaming; /* block size expected by the target device */ gsize block_size; /* Size of a slab - some multiple of the block size */ gsize slab_size; /* maximum number of slabs allowed, rounded up to the next whole slab. If * using mem cache, this is the equivalent of part_size bytes; otherwise, * it is equivalent to max_memory bytes. */ guint64 max_slabs; /* number of slabs in a part */ guint64 slabs_per_part; } XferDestTaperCacher; static GType xfer_dest_taper_cacher_get_type(void); #define XFER_DEST_TAPER_CACHER_TYPE (xfer_dest_taper_cacher_get_type()) #define XFER_DEST_TAPER_CACHER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacher) #define XFER_DEST_TAPER_CACHER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacher const) #define XFER_DEST_TAPER_CACHER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_cacher_get_type(), XferDestTaperCacherClass) #define IS_XFER_DEST_TAPER_CACHER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_cacher_get_type ()) #define XFER_DEST_TAPER_CACHER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacherClass) typedef struct { XferDestTaperClass __parent__; } XferDestTaperCacherClass; /* * Debug logging */ #define DBG(LEVEL, ...) if (debug_taper >= LEVEL) { _xdt_dbg(__VA_ARGS__); } static void _xdt_dbg(const char *fmt, ...) { va_list argp; char msg[1024]; arglist_start(argp, fmt); g_vsnprintf(msg, sizeof(msg), fmt, argp); arglist_end(argp); g_debug("XDT: %s", msg); } /* * Slab handling */ /* called with the slab_mutex held, this gets a new slab to write into, with * refcount 1. It will block if max_memory slabs are already in use, and mem * caching is not in use, although allocation may be forced with the 'force' * parameter. * * If the memory allocation cannot be satisfied due to system constraints, * this function will send an XMSG_ERROR, wait for the transfer to cancel, and * return NULL. If the transfer is cancelled by some other means while this * function is blocked awaiting a free slab, it will return NULL. * * @param self: the xfer element * @param force: allocate a slab even if it would exceed max_memory * @returns: a new slab, or NULL if the xfer is cancelled */ static Slab * alloc_slab( XferDestTaperCacher *self, gboolean force) { XferElement *elt = XFER_ELEMENT(self); Slab *rv; DBG(8, "alloc_slab(force=%d)", force); if (!force) { /* throttle based on maximum number of extant slabs */ while (G_UNLIKELY( !elt->cancelled && self->oldest_slab && self->newest_slab && self->oldest_slab->refcount > 1 && (self->newest_slab->serial - self->oldest_slab->serial + 1) >= self->max_slabs)) { DBG(9, "waiting for available slab"); g_cond_wait(self->slab_free_cond, self->slab_mutex); } DBG(9, "done waiting"); if (elt->cancelled) return NULL; } /* if the oldest slab doesn't have anything else pointing to it, just use * that */ if (self->oldest_slab && self->oldest_slab->refcount == 1) { rv = self->oldest_slab; self->oldest_slab = rv->next; } else { rv = g_new0(Slab, 1); rv->refcount = 1; rv->base = g_try_malloc(self->slab_size); if (!rv->base) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Could not allocate %zu bytes of memory: %s"), self->slab_size, strerror(errno)); g_free(rv); return NULL; } } rv->next = NULL; rv->size = 0; return rv; } /* called with the slab_mutex held, this frees the given slave entirely. The * reference count is not consulted. * * @param slab: slab to free */ static void free_slab( Slab *slab) { if (slab) { if (slab->base) g_free(slab->base); g_free(slab); } } /* called with the slab_mutex held, this decrements the refcount of the * given slab * * @param self: xfer element * @param slab: slab to free */ static inline void unref_slab( XferDestTaperCacher *self, Slab *slab) { g_assert(slab->refcount > 1); slab->refcount--; if (G_UNLIKELY(slab->refcount == 1 && slab == self->oldest_slab)) { g_cond_broadcast(self->slab_free_cond); } else if (G_UNLIKELY(slab->refcount == 0)) { free_slab(slab); } } /* called with the slab_mutex held, this sets *slabp to *slabp->next, * adjusting refcounts appropriately, and returns the new value * * @param self: xfer element * @param slabp: slab pointer to advance * @returns: new value of *slabp */ static inline Slab * next_slab( XferDestTaperCacher *self, Slab * volatile *slabp) { Slab *next; if (!slabp || !*slabp) return NULL; next = (*slabp)->next; if (next) next->refcount++; if (*slabp) unref_slab(self, *slabp); *slabp = next; return next; } /* * Disk Cache * * The disk cache thread's job is simply to follow along the slab train at * maximum speed, writing slabs to the disk cache file. */ static gboolean open_disk_cache_fds( XferDestTaperCacher *self) { char * filename; g_assert(self->disk_cache_read_fd == -1); g_assert(self->disk_cache_write_fd == -1); g_mutex_lock(self->state_mutex); filename = g_strdup_printf("%s/amanda-split-buffer-XXXXXX", self->disk_cache_dirname); self->disk_cache_write_fd = g_mkstemp(filename); if (self->disk_cache_write_fd < 0) { g_mutex_unlock(self->state_mutex); xfer_cancel_with_error(XFER_ELEMENT(self), _("Error creating cache file in '%s': %s"), self->disk_cache_dirname, strerror(errno)); g_free(filename); return FALSE; } /* open a separate copy of the file for reading */ self->disk_cache_read_fd = open(filename, O_RDONLY); if (self->disk_cache_read_fd < 0) { g_mutex_unlock(self->state_mutex); xfer_cancel_with_error(XFER_ELEMENT(self), _("Error opening cache file in '%s': %s"), self->disk_cache_dirname, strerror(errno)); g_free(filename); return FALSE; } /* signal anyone waiting for this value */ g_cond_broadcast(self->state_cond); g_mutex_unlock(self->state_mutex); /* errors from unlink are not fatal */ if (unlink(filename) < 0) { g_warning("While unlinking '%s': %s (ignored)", filename, strerror(errno)); } g_free(filename); return TRUE; } static gpointer disk_cache_thread( gpointer data) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(data); XferElement *elt = XFER_ELEMENT(self); DBG(1, "(this is the disk cache thread)"); /* open up the disk cache file first */ if (!open_disk_cache_fds(self)) return NULL; while (!elt->cancelled) { gboolean eof, eop; guint64 stop_serial; Slab *slab; /* rewind to the begining of the disk cache file */ if (lseek(self->disk_cache_write_fd, 0, SEEK_SET) == -1) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Error seeking disk cache file in '%s': %s"), self->disk_cache_dirname, strerror(errno)); return NULL; } /* we need to sit and wait for the next part to begin, first making sure * we have a slab .. */ g_mutex_lock(self->slab_mutex); while (!self->disk_cacher_slab && !elt->cancelled) { DBG(9, "waiting for a disk slab"); g_cond_wait(self->slab_cond, self->slab_mutex); } DBG(9, "done waiting"); g_mutex_unlock(self->slab_mutex); if (elt->cancelled) break; /* this slab is now fixed until this thread changes it */ g_assert(self->disk_cacher_slab != NULL); /* and then making sure we're ready to write that slab. */ g_mutex_lock(self->state_mutex); while ((self->paused || (self->disk_cacher_slab && self->disk_cacher_slab->serial > self->part_first_serial)) && !elt->cancelled) { DBG(9, "waiting for the disk slab to become current and un-paused"); g_cond_wait(self->state_cond, self->state_mutex); } DBG(9, "done waiting"); stop_serial = self->part_stop_serial; g_mutex_unlock(self->state_mutex); if (elt->cancelled) break; g_mutex_lock(self->slab_mutex); slab = self->disk_cacher_slab; eop = eof = FALSE; while (!eop && !eof) { /* if we're at the head of the slab train, wait for more data */ while (!self->disk_cacher_slab && !elt->cancelled) { DBG(9, "waiting for the next disk slab"); g_cond_wait(self->slab_cond, self->slab_mutex); } DBG(9, "done waiting"); if (elt->cancelled) break; /* drop the lock long enough to write the slab; the refcount * protects the slab during this time */ slab = self->disk_cacher_slab; g_mutex_unlock(self->slab_mutex); if (full_write(self->disk_cache_write_fd, slab->base, slab->size) < slab->size) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Error writing to disk cache file in '%s': %s"), self->disk_cache_dirname, strerror(errno)); return NULL; } eof = slab->size < self->slab_size; eop = (slab->serial + 1 == stop_serial); g_mutex_lock(self->slab_mutex); next_slab(self, &self->disk_cacher_slab); } g_mutex_unlock(self->slab_mutex); if (eof) { /* this very thread should have just set this value to NULL, and since it's * EOF, there should not be any 'next' slab */ g_assert(self->disk_cacher_slab == NULL); break; } } return NULL; } /* * Device Thread * * The device thread's job is to write slabs to self->device, applying whatever * streaming algorithms are required. It does this by alternately getting the * next slab from a "slab source" and writing that slab to the device. Most of * the slab source functions assume that self->slab_mutex is held, but may * release the mutex (either explicitly or via a g_cond_wait), so it is not * valid to assume that any slab pointers remain unchanged after a slab_source * function invocation. */ /* This struct tracks the current state of the slab source */ typedef struct slab_source_state { /* temporary slab used for reading from disk */ Slab *tmp_slab; /* next serial to read from disk */ guint64 next_serial; } slab_source_state; /* Called with the slab_mutex held, this function pre-buffers enough data into the slab * train to meet the device's streaming needs. */ static gboolean slab_source_prebuffer( XferDestTaperCacher *self) { XferElement *elt = XFER_ELEMENT(self); guint64 prebuffer_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size; guint64 i; Slab *slab; /* always prebuffer at least one slab, even if max_memory is 0 */ if (prebuffer_slabs == 0) prebuffer_slabs = 1; /* pre-buffering is not necessary if we're retrying a part */ if (self->retry_part) return TRUE; /* pre-buffering means waiting until we have at least prebuffer_slabs in the * slab train ahead of the device_slab, or the newest slab is at EOF. */ while (!elt->cancelled) { gboolean eof_or_eop = FALSE; /* see if there's enough data yet */ for (i = 0, slab = self->device_slab; i < prebuffer_slabs && slab != NULL; i++, slab = slab->next) { eof_or_eop = (slab->size < self->slab_size) || (slab->serial + 1 == self->part_stop_serial); } if (i == prebuffer_slabs || eof_or_eop) break; DBG(9, "prebuffering wait"); g_cond_wait(self->slab_cond, self->slab_mutex); } DBG(9, "done waiting"); if (elt->cancelled) { self->last_part_successful = FALSE; self->no_more_parts = TRUE; return FALSE; } return TRUE; } /* Called without the slab_mutex held, this function sets up a new slab_source_state * object based on the configuratino of the Xfer Element. */ static inline gboolean slab_source_setup( XferDestTaperCacher *self, slab_source_state *state) { XferElement *elt = XFER_ELEMENT(self); state->tmp_slab = NULL; state->next_serial = G_MAXUINT64; /* if we're to retry the part, rewind to the beginning */ if (self->retry_part) { if (self->use_mem_cache) { /* rewind device_slab to point to the mem_cache_slab */ g_mutex_lock(self->slab_mutex); if (self->device_slab) unref_slab(self, self->device_slab); self->device_slab = self->mem_cache_slab; if(self->device_slab != NULL) self->device_slab->refcount++; g_mutex_unlock(self->slab_mutex); } else { g_mutex_lock(self->slab_mutex); /* we're going to read from the disk cache until we get to the oldest useful * slab in memory, so it had best exist */ g_assert(self->oldest_slab != NULL); /* point device_slab at the oldest slab we have */ self->oldest_slab->refcount++; if (self->device_slab) unref_slab(self, self->device_slab); self->device_slab = self->oldest_slab; /* and increment it until it is at least the slab we want to start from */ while (self->device_slab->serial < self->part_first_serial) { next_slab(self, &self->device_slab); } /* get a new, temporary slab for use while reading */ state->tmp_slab = alloc_slab(self, TRUE); g_mutex_unlock(self->slab_mutex); if (!state->tmp_slab) { /* if we couldn't allocate a slab, then we're cancelled, so we're done with * this part. */ self->last_part_successful = FALSE; self->no_more_parts = TRUE; return FALSE; } state->tmp_slab->size = self->slab_size; state->next_serial = self->part_first_serial; /* We're reading from the disk cache, so we need a file descriptor * to read from, so wait for disk_cache_thread to open the * disk_cache_read_fd */ g_assert(self->disk_cache_dirname); g_mutex_lock(self->state_mutex); while (self->disk_cache_read_fd == -1 && !elt->cancelled) { DBG(9, "waiting for disk_cache_thread to set disk_cache_read_fd"); g_cond_wait(self->state_cond, self->state_mutex); } DBG(9, "done waiting"); g_mutex_unlock(self->state_mutex); if (elt->cancelled) { self->last_part_successful = FALSE; self->no_more_parts = TRUE; return FALSE; } /* rewind to the beginning */ if (lseek(self->disk_cache_read_fd, 0, SEEK_SET) == -1) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Could not seek disk cache file for reading: %s"), strerror(errno)); self->last_part_successful = FALSE; self->no_more_parts = TRUE; return FALSE; } } } /* if the streaming mode requires it, pre-buffer */ if (self->streaming == STREAMING_REQUIREMENT_DESIRED || self->streaming == STREAMING_REQUIREMENT_REQUIRED) { gboolean prebuffer_ok; g_mutex_lock(self->slab_mutex); prebuffer_ok = slab_source_prebuffer(self); g_mutex_unlock(self->slab_mutex); if (!prebuffer_ok) return FALSE; } return TRUE; } /* Called with the slab_mutex held, this does the work of slab_source_get when * reading from the disk cache. Note that this explicitly releases the * slab_mutex during execution - do not depend on any protected values across a * call to this function. The mutex is held on return. */ static Slab * slab_source_get_from_disk( XferDestTaperCacher *self, slab_source_state *state, guint64 serial) { XferDestTaper *xdt = XFER_DEST_TAPER(self); gsize bytes_read; g_assert(state->next_serial == serial); /* NOTE: slab_mutex is held, but we don't need it here, so release it for the moment */ g_mutex_unlock(self->slab_mutex); bytes_read = full_read(self->disk_cache_read_fd, state->tmp_slab->base, self->slab_size); if ((gsize)bytes_read < self->slab_size) { xfer_cancel_with_error(XFER_ELEMENT(xdt), _("Error reading disk cache: %s"), errno? strerror(errno) : _("Unexpected EOF")); goto fatal_error; } state->tmp_slab->serial = state->next_serial++; g_mutex_lock(self->slab_mutex); return state->tmp_slab; fatal_error: g_mutex_lock(self->slab_mutex); self->last_part_successful = FALSE; self->no_more_parts = TRUE; return NULL; } /* Called with the slab_mutex held, this function gets the slab with the given * serial number, waiting if necessary for that slab to be available. Note * that the slab_mutex may be released during execution, although it is always * held on return. */ static inline Slab * slab_source_get( XferDestTaperCacher *self, slab_source_state *state, guint64 serial) { XferElement *elt = (XferElement *)self; /* device_slab is only NULL if we're following the slab train, so wait for * a new slab */ if (!self->device_slab) { /* if the streaming mode requires it, pre-buffer */ if (self->streaming == STREAMING_REQUIREMENT_DESIRED) { if (!slab_source_prebuffer(self)) return NULL; /* fall through to make sure we have a device_slab; * slab_source_prebuffer doesn't guarantee device_slab != NULL */ } while (self->device_slab == NULL && !elt->cancelled) { DBG(9, "waiting for the next slab"); g_cond_wait(self->slab_cond, self->slab_mutex); } DBG(9, "done waiting"); if (elt->cancelled) goto fatal_error; } /* device slab is now set, and only this thread can change it */ g_assert(self->device_slab); /* if the next item in the device slab is the one we want, then the job is * pretty easy */ if (G_LIKELY(serial == self->device_slab->serial)) return self->device_slab; /* otherwise, we're reading from disk */ g_assert(serial < self->device_slab->serial); return slab_source_get_from_disk(self, state, serial); fatal_error: self->last_part_successful = FALSE; self->no_more_parts = TRUE; return NULL; } /* Called without the slab_mutex held, this frees any resources assigned * to the slab source state */ static inline void slab_source_free( XferDestTaperCacher *self, slab_source_state *state) { if (state->tmp_slab) { g_mutex_lock(self->slab_mutex); free_slab(state->tmp_slab); g_mutex_unlock(self->slab_mutex); } } /* Called without the slab_mutex, this writes the given slab to the device */ static gboolean write_slab_to_device( XferDestTaperCacher *self, Slab *slab) { XferElement *elt = XFER_ELEMENT(self); gpointer buf = slab->base; gsize remaining = slab->size; while (remaining && !elt->cancelled) { gsize write_size = MIN(self->block_size, remaining); gboolean ok; ok = device_write_block(self->device, write_size, buf); if (!ok) { self->bytes_written += slab->size - remaining; /* TODO: handle an error without is_eom * differently/fatally? or at least with a warning? */ self->last_part_successful = FALSE; self->no_more_parts = FALSE; return FALSE; } buf += write_size; self->slab_bytes_written += write_size; remaining -= write_size; } if (elt->cancelled) { self->last_part_successful = FALSE; self->no_more_parts = TRUE; return FALSE; } self->bytes_written += slab->size; self->slab_bytes_written = 0; return TRUE; } static XMsg * device_thread_write_part( XferDestTaperCacher *self) { GTimer *timer = g_timer_new(); XMsg *msg; slab_source_state src_state = {0, 0}; guint64 serial, stop_serial; gboolean eof = FALSE; int fileno = 0; int failed = 0; int slab_source_set = 0; self->last_part_successful = FALSE; self->bytes_written = 0; if (!device_start_file(self->device, self->part_header)) { failed = 1; goto part_done; } dumpfile_free(self->part_header); self->part_header = NULL; fileno = self->device->file; g_assert(fileno > 0); if (!slab_source_setup(self, &src_state)) goto part_done; slab_source_set = 1; g_timer_start(timer); stop_serial = self->part_stop_serial; g_mutex_lock(self->slab_mutex); for (serial = self->part_first_serial; serial < stop_serial && !eof; serial++) { Slab *slab = slab_source_get(self, &src_state, serial); DBG(8, "writing slab %p (serial %ju) to device", slab, serial); g_mutex_unlock(self->slab_mutex); if (!slab) { failed = 1; goto part_done; } eof = slab->size < self->slab_size; if (!write_slab_to_device(self, slab)) { failed = 1; goto part_done; } g_mutex_lock(self->slab_mutex); DBG(8, "wrote slab %p to device", slab); /* if we're reading from the slab train, advance self->device_slab. */ if (slab == self->device_slab) { next_slab(self, &self->device_slab); } } g_mutex_unlock(self->slab_mutex); part_done: /* if we write all of the blocks, but the finish_file fails, then likely * there was some buffering going on in the device driver, and the blocks * did not all make it to permanent storage -- so it's a failed part. */ if (self->device->in_file && !device_finish_file(self->device)) failed = 1; if (slab_source_set) { slab_source_free(self, &src_state); } if (!failed) { self->last_part_successful = TRUE; self->no_more_parts = eof; } g_timer_stop(timer); msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = self->bytes_written; msg->duration = g_timer_elapsed(timer, NULL); msg->partnum = self->partnum; msg->fileno = fileno; msg->successful = self->last_part_successful; msg->eom = !self->last_part_successful; msg->eof = self->no_more_parts; /* time runs backward on some test boxes, so make sure this is positive */ if (msg->duration < 0) msg->duration = 0; if (self->last_part_successful) self->partnum++; g_timer_destroy(timer); return msg; } /* Called with the status_mutex held, this frees any cached data for * a successful part */ static void release_part_cache( XferDestTaperCacher *self) { if (self->use_mem_cache && self->mem_cache_slab) { /* move up the mem_cache_slab to point to the first slab in * the next part (probably NULL at this point), so that the * reader can continue reading data into the new mem cache * immediately. */ g_mutex_lock(self->slab_mutex); unref_slab(self, self->mem_cache_slab); self->mem_cache_slab = self->device_slab; if (self->mem_cache_slab) self->mem_cache_slab->refcount++; g_mutex_unlock(self->slab_mutex); } /* the disk cache gets reused automatically (rewinding to offset 0), so * there's nothing else to do */ } static gpointer device_thread( gpointer data) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(data); XferElement *elt = XFER_ELEMENT(self); XMsg *msg; DBG(1, "(this is the device thread)"); if (self->disk_cache_dirname) { GError *error = NULL; self->disk_cache_thread = g_thread_create(disk_cache_thread, (gpointer)self, TRUE, &error); if (!self->disk_cache_thread) { g_critical(_("Error creating new thread: %s (%s)"), error->message, errno? strerror(errno) : _("no error code")); } } /* This is the outer loop, that loops once for each split part written to * tape. */ g_mutex_lock(self->state_mutex); while (1) { /* wait until the main thread un-pauses us, and check that we have * the relevant device info available (block_size) */ while (self->paused && !elt->cancelled) { DBG(9, "waiting to be unpaused"); g_cond_wait(self->state_cond, self->state_mutex); } DBG(9, "done waiting"); if (elt->cancelled) break; g_mutex_unlock(self->state_mutex); self->slab_bytes_written = 0; DBG(2, "beginning to write part"); msg = device_thread_write_part(self); DBG(2, "done writing part"); g_mutex_lock(self->state_mutex); /* release any cache of a successful part, but don't bother at EOF */ if (msg->successful && !msg->eof) release_part_cache(self); xfer_queue_message(elt->xfer, msg); /* if this is the last part, we're done with the part loop */ if (self->no_more_parts) break; /* pause ourselves and await instructions from the main thread */ self->paused = TRUE; } g_mutex_unlock(self->state_mutex); /* make sure the other thread is done before we send XMSG_DONE */ if (self->disk_cache_thread) g_thread_join(self->disk_cache_thread); /* tell the main thread we're done */ xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } /* * Class mechanics */ /* called with the slab_mutex held, this adds the reader_slab to the head of * the slab train and signals the condition variable. */ static void add_reader_slab_to_train( XferDestTaperCacher *self) { Slab *slab = self->reader_slab; DBG(3, "adding slab of new data to the slab train"); if (self->newest_slab) { self->newest_slab->next = slab; slab->refcount++; self->newest_slab->refcount--; } self->newest_slab = slab; /* steal reader_slab's ref */ self->reader_slab = NULL; /* steal reader_slab's reference for newest_slab */ /* if any of the other pointers are waiting for this slab, update them */ if (self->disk_cache_dirname && !self->disk_cacher_slab) { self->disk_cacher_slab = slab; slab->refcount++; } if (self->use_mem_cache && !self->mem_cache_slab) { self->mem_cache_slab = slab; slab->refcount++; } if (!self->device_slab) { self->device_slab = slab; slab->refcount++; } if (!self->oldest_slab) { self->oldest_slab = slab; slab->refcount++; } g_cond_broadcast(self->slab_cond); } static void push_buffer_impl( XferElement *elt, gpointer buf, size_t size) { XferDestTaperCacher *self = (XferDestTaperCacher *)elt; gpointer p; DBG(3, "push_buffer(%p, %ju)", buf, (uintmax_t)size); /* do nothing if cancelled */ if (G_UNLIKELY(elt->cancelled)) { goto free_and_finish; } /* handle EOF */ if (G_UNLIKELY(buf == NULL)) { /* send off the last, probably partial slab */ g_mutex_lock(self->slab_mutex); /* create a new, empty slab if necessary */ if (!self->reader_slab) { self->reader_slab = alloc_slab(self, FALSE); if (!self->reader_slab) { /* we've been cancelled while waiting for a slab */ g_mutex_unlock(self->slab_mutex); /* wait for the xfer to cancel, so we don't get another buffer * pushed to us (and do so *without* the mutex held) */ wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer); goto free_and_finish; } self->reader_slab->serial = self->next_serial++; } add_reader_slab_to_train(self); g_mutex_unlock(self->slab_mutex); goto free_and_finish; } p = buf; while (1) { gsize copy_size; /* get a fresh slab, if needed */ if (G_UNLIKELY(!self->reader_slab) || self->reader_slab->size == self->slab_size) { g_mutex_lock(self->slab_mutex); if (self->reader_slab) add_reader_slab_to_train(self); self->reader_slab = alloc_slab(self, FALSE); if (!self->reader_slab) { /* we've been cancelled while waiting for a slab */ g_mutex_unlock(self->slab_mutex); /* wait for the xfer to cancel, so we don't get another buffer * pushed to us (and do so *without* the mutex held) */ wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer); goto free_and_finish; } self->reader_slab->serial = self->next_serial++; g_mutex_unlock(self->slab_mutex); } if (size == 0) break; copy_size = MIN(self->slab_size - self->reader_slab->size, size); memcpy(self->reader_slab->base+self->reader_slab->size, p, copy_size); self->reader_slab->size += copy_size; p += copy_size; size -= copy_size; } free_and_finish: if (buf) g_free(buf); } /* * Element mechanics */ static gboolean start_impl( XferElement *elt) { XferDestTaperCacher *self = (XferDestTaperCacher *)elt; GError *error = NULL; self->device_thread = g_thread_create(device_thread, (gpointer)self, FALSE, &error); if (!self->device_thread) { g_critical(_("Error creating new thread: %s (%s)"), error->message, errno? strerror(errno) : _("no error code")); } return TRUE; } static gboolean cancel_impl( XferElement *elt, gboolean expect_eof) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(elt); gboolean rv; /* chain up first */ rv = XFER_ELEMENT_CLASS(parent_class)->cancel(elt, expect_eof); /* then signal all of our condition variables, so that threads waiting on them * wake up and see elt->cancelled. */ g_mutex_lock(self->slab_mutex); g_cond_broadcast(self->slab_cond); g_cond_broadcast(self->slab_free_cond); g_mutex_unlock(self->slab_mutex); g_mutex_lock(self->state_mutex); g_cond_broadcast(self->state_cond); g_mutex_unlock(self->state_mutex); return rv; } static void start_part_impl( XferDestTaper *xdt, gboolean retry_part, dumpfile_t *header) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt); g_assert(self->device != NULL); g_assert(!self->device->in_file); g_assert(header != NULL); DBG(1, "start_part(retry_part=%d)", retry_part); g_mutex_lock(self->state_mutex); g_assert(self->paused); g_assert(!self->no_more_parts); if (self->part_header) dumpfile_free(self->part_header); self->part_header = dumpfile_copy(header); if (retry_part) { g_assert(!self->last_part_successful); self->retry_part = TRUE; } else { g_assert(self->last_part_successful); self->retry_part = FALSE; self->part_first_serial = self->part_stop_serial; if (self->part_size != 0) { self->part_stop_serial = self->part_first_serial + self->slabs_per_part; } else { /* set part_stop_serial to an effectively infinite value */ self->part_stop_serial = G_MAXUINT64; } } DBG(1, "unpausing"); self->paused = FALSE; g_cond_broadcast(self->state_cond); g_mutex_unlock(self->state_mutex); } static void use_device_impl( XferDestTaper *xdt, Device *device) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt); GValue val; /* short-circuit if nothing is changing */ if (self->device == device) return; g_mutex_lock(self->state_mutex); if (self->device) g_object_unref(self->device); self->device = device; g_object_ref(device); /* get this new device's streaming requirements */ bzero(&val, sizeof(val)); if (!device_property_get(self->device, PROPERTY_STREAMING, &val) || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) { g_warning("Couldn't get streaming type for %s", self->device->device_name); self->streaming = STREAMING_REQUIREMENT_REQUIRED; } else { self->streaming = g_value_get_enum(&val); } g_value_unset(&val); /* check that the blocksize hasn't changed */ if (self->block_size != device->block_size) { g_mutex_unlock(self->state_mutex); xfer_cancel_with_error(XFER_ELEMENT(self), _("All devices used by the taper must have the same block size")); return; } g_mutex_unlock(self->state_mutex); } static guint64 get_part_bytes_written_impl( XferDestTaper *xdt) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt); /* NOTE: this access is unsafe and may return inconsistent results (e.g, a * partial write to the 64-bit value on a 32-bit system). This is ok for * the moment, as it's only informational, but be warned. */ if (self->device) { return device_get_bytes_written(self->device); } else { return self->bytes_written + self->slab_bytes_written; } } static void instance_init( XferElement *elt) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(elt); elt->can_generate_eof = FALSE; self->state_mutex = g_mutex_new(); self->state_cond = g_cond_new(); self->slab_mutex = g_mutex_new(); self->slab_cond = g_cond_new(); self->slab_free_cond = g_cond_new(); self->last_part_successful = TRUE; self->paused = TRUE; self->part_stop_serial = 0; self->disk_cache_read_fd = -1; self->disk_cache_write_fd = -1; } static void finalize_impl( GObject * obj_self) { XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(obj_self); Slab *slab, *next_slab; if (self->disk_cache_dirname) g_free(self->disk_cache_dirname); g_mutex_free(self->state_mutex); g_cond_free(self->state_cond); g_mutex_free(self->slab_mutex); g_cond_free(self->slab_cond); g_cond_free(self->slab_free_cond); /* free the slab train, without reference to the refcounts */ for (slab = self->oldest_slab; slab != NULL; slab = next_slab) { next_slab = slab->next; free_slab(slab); } self->disk_cacher_slab = NULL; self->mem_cache_slab = NULL; self->device_slab = NULL; self->oldest_slab = NULL; self->newest_slab = NULL; if (self->reader_slab) { free_slab(self->reader_slab); self->reader_slab = NULL; } if (self->part_header) dumpfile_free(self->part_header); if (self->disk_cache_read_fd != -1) close(self->disk_cache_read_fd); /* ignore error */ if (self->disk_cache_write_fd != -1) close(self->disk_cache_write_fd); /* ignore error */ if (self->device) g_object_unref(self->device); /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferDestTaperCacherClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); XferDestTaperClass *xdt_klass = XFER_DEST_TAPER_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 1, 1}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; klass->start = start_impl; klass->cancel = cancel_impl; klass->push_buffer = push_buffer_impl; xdt_klass->start_part = start_part_impl; xdt_klass->use_device = use_device_impl; xdt_klass->get_part_bytes_written = get_part_bytes_written_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Dest::Taper::Cacher"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } static GType xfer_dest_taper_cacher_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestTaperCacherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestTaperCacher), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_DEST_TAPER_TYPE, "XferDestTaperCacher", &info, 0); } return type; } /* * Constructor */ XferElement * xfer_dest_taper_cacher( Device *first_device, size_t max_memory, guint64 part_size, gboolean use_mem_cache, const char *disk_cache_dirname) { XferDestTaperCacher *self = (XferDestTaperCacher *)g_object_new(XFER_DEST_TAPER_CACHER_TYPE, NULL); self->max_memory = max_memory; self->part_size = part_size; self->partnum = 1; self->device = first_device; g_object_ref(self->device); /* pick only one caching mechanism, caller! */ if (use_mem_cache) g_assert(!disk_cache_dirname); if (disk_cache_dirname) g_assert(!use_mem_cache); /* and if part size is zero, then we don't do any caching */ g_assert(part_size != 0 || (!use_mem_cache && !disk_cache_dirname)); self->use_mem_cache = use_mem_cache; if (disk_cache_dirname) self->disk_cache_dirname = g_strdup(disk_cache_dirname); /* calculate the device-dependent parameters */ self->block_size = first_device->block_size; /* The slab size should be large enough to justify the overhead of all * of the mutexes, but it needs to be small enough to have a few slabs * available so that the threads are not constantly waiting on one * another. The choice is sixteen blocks, not more than a quarter of * the part size, and not more than 10MB. If we're not using the mem * cache, then avoid exceeding max_memory by keeping the slab size less * than a quarter of max_memory. */ self->slab_size = self->block_size * 16; if (self->part_size) self->slab_size = MIN(self->slab_size, self->part_size / 4); self->slab_size = MIN(self->slab_size, 10*1024*1024); if (!use_mem_cache) self->slab_size = MIN(self->slab_size, self->max_memory / 4); /* round slab size up to the nearest multiple of the block size */ self->slab_size = ((self->slab_size + self->block_size - 1) / self->block_size) * self->block_size; /* round part size up to a multiple of the slab size */ if (self->part_size != 0) { self->slabs_per_part = (self->part_size + self->slab_size - 1) / self->slab_size; self->part_size = self->slabs_per_part * self->slab_size; } else { self->slabs_per_part = 0; } /* set max_slabs */ if (use_mem_cache) { self->max_slabs = self->slabs_per_part; /* increase max_slabs to serve as mem buf */ } else { self->max_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size; } /* Note that max_slabs == 1 will cause deadlocks, due to some assumptions in * alloc_slab, so we check here that it's at least 2. */ if (self->max_slabs < 2) self->max_slabs = 2; DBG(1, "using slab_size %zu and max_slabs %ju", self->slab_size, (uintmax_t)self->max_slabs); return XFER_ELEMENT(self); } amanda-3.3.6/device-src/xfer-dest-taper-splitter.c0000664000076400007640000007261712357250004023521 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "xfer-device.h" #include "arglist.h" #include "conffile.h" /* A transfer destination that writes an entire dumpfile to one or more files * on one or more devices, without any caching. This destination supports both * LEOM-based splitting (in which parts are never rewound) and cache_inform-based * splitting (in which rewound parts are read from holding disk). */ /* * File Slices - Cache Information * * The cache_inform implementation adds cache information to a linked list of * these objects, in order. The objects are arranged in a linked list, and * describe the files in which the part data is stored. Note that we assume * that slices are added *before* they are needed: the xfer element will fail * if it tries to rewind and does not find a suitable slice. * * The slices should be "fast forwarded" after every part, so that the first * byte in part_slices is the first byte of the part; when a retry of a part is * required, use the iterator methods to properly open the various files and do * the buffering. */ typedef struct FileSlice { struct FileSlice *next; /* fully-qualified filename to read from (or NULL to read from * disk_cache_read_fd in XferDestTaperCacher) */ char *filename; /* offset in file to start at */ guint64 offset; /* length of data to read */ guint64 length; } FileSlice; /* * Xfer Dest Taper */ static GObjectClass *parent_class = NULL; typedef struct XferDestTaperSplitter { XferDestTaper __parent__; /* object parameters * * These values are supplied to the constructor, and can be assumed * constant for the lifetime of the element. */ /* Maximum size of each part (bytes) */ guint64 part_size; /* the device's need for streaming (it's assumed that all subsequent devices * have the same needs) */ StreamingRequirement streaming; /* block size expected by the target device */ gsize block_size; /* TRUE if this element is expecting slices via cache_inform */ gboolean expect_cache_inform; /* The thread doing the actual writes to tape; this also handles buffering * for streaming */ GThread *device_thread; /* Ring Buffer * * This buffer holds MAX_MEMORY bytes of data (rounded up to the next * blocksize), and serves as the interface between the device_thread and * the thread calling push_buffer. Ring_length is the total length of the * buffer in bytes, while ring_count is the number of data bytes currently * in the buffer. The ring_add_cond is signalled when data is added to the * buffer, while ring_free_cond is signalled when data is removed. Both * are governed by ring_mutex, and both are signalled when the transfer is * cancelled. */ GMutex *ring_mutex; GCond *ring_add_cond, *ring_free_cond; gchar *ring_buffer; gsize ring_length, ring_count; gsize ring_head, ring_tail; gboolean ring_head_at_eof; /* Element State * * "state" includes all of the variables below (including device * parameters). Note that the device_thread holdes this mutex for the * entire duration of writing a part. * * state_mutex should always be locked before ring_mutex, if both are to be * held simultaneously. */ GMutex *state_mutex; GCond *state_cond; volatile gboolean paused; /* The device to write to, and the header to write to it */ Device *volatile device; dumpfile_t *volatile part_header; /* bytes to read from cached slices before reading from the ring buffer */ guint64 bytes_to_read_from_slices; /* part number in progress */ volatile guint64 partnum; /* status of the last part */ gboolean last_part_eof; gboolean last_part_eom; gboolean last_part_successful; /* true if the element is done writing to devices */ gboolean no_more_parts; /* total bytes written in the current part */ volatile guint64 part_bytes_written; /* The list of active slices for the current part. The cache_inform method * appends to this list. It is safe to read this linked list, beginning at * the head, *if* you can guarantee that slices will not be fast-forwarded * in the interim. The finalize method for this class will take care of * freeing any leftover slices. Take the part_slices mutex while modifying * the links in this list. */ FileSlice *part_slices; GMutex *part_slices_mutex; } XferDestTaperSplitter; static GType xfer_dest_taper_splitter_get_type(void); #define XFER_DEST_TAPER_SPLITTER_TYPE (xfer_dest_taper_splitter_get_type()) #define XFER_DEST_TAPER_SPLITTER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_splitter_get_type(), XferDestTaperSplitter) #define XFER_DEST_TAPER_SPLITTER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_splitter_get_type(), XferDestTaperSplitter const) #define XFER_DEST_TAPER_SPLITTER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_splitter_get_type(), XferDestTaperSplitterClass) #define IS_XFER_DEST_TAPER_SPLITTER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_splitter_get_type ()) #define XFER_DEST_TAPER_SPLITTER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_splitter_get_type(), XferDestTaperSplitterClass) typedef struct { XferDestTaperClass __parent__; } XferDestTaperSplitterClass; /* * Debug logging */ #define DBG(LEVEL, ...) if (debug_taper >= LEVEL) { _xdt_dbg(__VA_ARGS__); } static void _xdt_dbg(const char *fmt, ...) { va_list argp; char msg[1024]; arglist_start(argp, fmt); g_vsnprintf(msg, sizeof(msg), fmt, argp); arglist_end(argp); g_debug("XDT: %s", msg); } /* "Fast forward" the slice list by the given length. This will free any * slices that are no longer necessary, and adjust the offset and length of the * first remaining slice. This assumes the state mutex is locked during its * operation. * * @param self: element * @param length: number of bytes to fast forward */ static void fast_forward_slices( XferDestTaperSplitter *self, guint64 length) { FileSlice *slice; /* consume slices until we've eaten the whole part */ g_mutex_lock(self->part_slices_mutex); while (length > 0) { g_assert(self->part_slices); slice = self->part_slices; if (slice->length <= length) { length -= slice->length; self->part_slices = slice->next; if (slice->filename) g_free(slice->filename); g_free(slice); slice = self->part_slices; } else { slice->length -= length; slice->offset += length; break; } } g_mutex_unlock(self->part_slices_mutex); } /* * Slice Iterator */ /* A struct for use in iterating over data in the slices */ typedef struct SliceIterator { /* current slice */ FileSlice *slice; /* file descriptor of the current file, or -1 if it's not open yet */ int cur_fd; /* bytes remaining in this slice */ guint64 slice_remaining; } SliceIterator; /* Utility functions for SliceIterator */ /* Begin iterating over slices, starting at the first byte of the first slice. * Initializes a pre-allocated SliceIterator. The caller must ensure that * fast_forward_slices is not called while an iteration is in * progress. */ static void iterate_slices( XferDestTaperSplitter *self, SliceIterator *iter) { iter->cur_fd = -1; iter->slice_remaining = 0; g_mutex_lock(self->part_slices_mutex); iter->slice = self->part_slices; /* it's safe to unlock this because, at worst, a new entry will * be appended while the iterator is in progress */ g_mutex_unlock(self->part_slices_mutex); } /* Get a block of data from the iterator, returning a pointer to a buffer * containing the data; the buffer remains the property of the iterator. * Returns NULL on error, after calling xfer_cancel_with_error with an * appropriate error message. This function does not block, so it does not * check for cancellation. */ static gpointer iterator_get_block( XferDestTaperSplitter *self, SliceIterator *iter, gpointer buf, gsize bytes_needed) { gsize buf_offset = 0; XferElement *elt = XFER_ELEMENT(self); g_assert(iter != NULL); g_assert(buf != NULL); while (bytes_needed > 0) { gsize read_size; int bytes_read; if (iter->cur_fd < 0) { guint64 offset; g_assert(iter->slice != NULL); g_assert(iter->slice->filename != NULL); iter->cur_fd = open(iter->slice->filename, O_RDONLY, 0); if (iter->cur_fd < 0) { xfer_cancel_with_error(elt, _("Could not open '%s' for reading: %s"), iter->slice->filename, strerror(errno)); return NULL; } iter->slice_remaining = iter->slice->length; offset = iter->slice->offset; if (lseek(iter->cur_fd, offset, SEEK_SET) == -1) { xfer_cancel_with_error(elt, _("Could not seek '%s' for reading: %s"), iter->slice->filename, strerror(errno)); return NULL; } } read_size = MIN(iter->slice_remaining, bytes_needed); bytes_read = full_read(iter->cur_fd, buf + buf_offset, read_size); if (bytes_read < 0 || (gsize)bytes_read < read_size) { xfer_cancel_with_error(elt, _("Error reading '%s': %s"), iter->slice->filename, errno? strerror(errno) : _("Unexpected EOF")); return NULL; } iter->slice_remaining -= bytes_read; buf_offset += bytes_read; bytes_needed -= bytes_read; if (iter->slice_remaining <= 0) { if (close(iter->cur_fd) < 0) { xfer_cancel_with_error(elt, _("Could not close fd %d: %s"), iter->cur_fd, strerror(errno)); return NULL; } iter->cur_fd = -1; iter->slice = iter->slice->next; if (elt->cancelled) return NULL; } } return buf; } /* Free the iterator's resources */ static void iterator_free( SliceIterator *iter) { if (iter->cur_fd >= 0) close(iter->cur_fd); } /* * Device Thread */ /* Wait for at least one block, or EOF, to be available in the ring buffer. * Called with the ring mutex held. */ static gsize device_thread_wait_for_block( XferDestTaperSplitter *self) { XferElement *elt = XFER_ELEMENT(self); gsize bytes_needed = self->device->block_size; gsize usable; /* for any kind of streaming, we need to fill the entire buffer before the * first byte */ if (self->part_bytes_written == 0 && self->streaming != STREAMING_REQUIREMENT_NONE) bytes_needed = self->ring_length; while (1) { /* are we ready? */ if (elt->cancelled) break; if (self->ring_count >= bytes_needed) break; if (self->ring_head_at_eof) break; /* nope - so wait */ g_cond_wait(self->ring_add_cond, self->ring_mutex); /* in STREAMING_REQUIREMENT_REQUIRED, once we decide to wait for more bytes, * we need to wait for the entire buffer to fill */ if (self->streaming == STREAMING_REQUIREMENT_REQUIRED) bytes_needed = self->ring_length; } usable = MIN(self->ring_count, bytes_needed); if (self->part_size) usable = MIN(usable, self->part_size - self->part_bytes_written); return usable; } /* Mark WRITTEN bytes as free in the ring buffer. Called with the ring mutex * held. */ static void device_thread_consume_block( XferDestTaperSplitter *self, gsize written) { self->ring_count -= written; self->ring_tail += written; if (self->ring_tail >= self->ring_length) self->ring_tail -= self->ring_length; g_cond_broadcast(self->ring_free_cond); } /* Write an entire part. Called with the state_mutex held */ static XMsg * device_thread_write_part( XferDestTaperSplitter *self) { GTimer *timer = g_timer_new(); XferElement *elt = XFER_ELEMENT(self); enum { PART_EOF, PART_LEOM, PART_EOP, PART_FAILED } part_status = PART_FAILED; int fileno = 0; XMsg *msg; self->part_bytes_written = 0; g_timer_start(timer); /* write the header; if this fails or hits LEOM, we consider this a * successful 0-byte part */ if (!device_start_file(self->device, self->part_header) || self->device->is_eom) { part_status = PART_LEOM; goto part_done; } fileno = self->device->file; g_assert(fileno > 0); /* free the header, now that it's written */ dumpfile_free(self->part_header); self->part_header = NULL; /* First, read the requisite number of bytes from the part_slices, if the part was * unsuccessful. */ if (self->bytes_to_read_from_slices) { SliceIterator iter; gsize to_write = self->block_size; gpointer buf = g_malloc(to_write); gboolean successful = TRUE; guint64 bytes_from_slices = self->bytes_to_read_from_slices; DBG(5, "reading %ju bytes from slices", (uintmax_t)bytes_from_slices); iterate_slices(self, &iter); while (bytes_from_slices) { gboolean ok; if (!iterator_get_block(self, &iter, buf, to_write)) { part_status = PART_FAILED; successful = FALSE; break; } /* note that it's OK to reference these ring_* vars here, as they * are static at this point */ ok = device_write_block(self->device, (guint)to_write, buf); if (!ok) { part_status = PART_FAILED; successful = FALSE; break; } self->part_bytes_written += to_write; bytes_from_slices -= to_write; if (self->part_size && self->part_bytes_written >= self->part_size) { part_status = PART_EOP; successful = FALSE; break; } else if (self->device->is_eom) { part_status = PART_LEOM; successful = FALSE; break; } } iterator_free(&iter); g_free(buf); /* if we didn't finish, get out of here now */ if (!successful) goto part_done; } g_mutex_lock(self->ring_mutex); while (1) { gsize to_write; gboolean ok; /* wait for at least one block, and (if necessary) prebuffer */ to_write = device_thread_wait_for_block(self); to_write = MIN(to_write, self->device->block_size); if (elt->cancelled) break; if (to_write == 0) { part_status = PART_EOF; break; } g_mutex_unlock(self->ring_mutex); DBG(8, "writing %ju bytes to device", (uintmax_t)to_write); /* note that it's OK to reference these ring_* vars here, as they * are static at this point */ ok = device_write_block(self->device, (guint)to_write, self->ring_buffer + self->ring_tail); g_mutex_lock(self->ring_mutex); if (!ok) { part_status = PART_FAILED; break; } self->part_bytes_written += to_write; device_thread_consume_block(self, to_write); if (self->part_size && self->part_bytes_written >= self->part_size) { part_status = PART_EOP; break; } else if (self->device->is_eom) { part_status = PART_LEOM; break; } } g_mutex_unlock(self->ring_mutex); part_done: /* if we write all of the blocks, but the finish_file fails, then likely * there was some buffering going on in the device driver, and the blocks * did not all make it to permanent storage -- so it's a failed part. Note * that we try to finish_file even if the part failed, just to be thorough. */ if (self->device->in_file) { if (!device_finish_file(self->device)) if (!elt->cancelled) { part_status = PART_FAILED; } } g_timer_stop(timer); msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = self->part_bytes_written; msg->duration = g_timer_elapsed(timer, NULL); msg->partnum = self->partnum; msg->fileno = fileno; msg->successful = self->last_part_successful = part_status != PART_FAILED; msg->eom = self->last_part_eom = part_status == PART_LEOM || self->device->is_eom; msg->eof = self->last_part_eof = part_status == PART_EOF; /* time runs backward on some test boxes, so make sure this is positive */ if (msg->duration < 0) msg->duration = 0; if (msg->successful && msg->size > 0) self->partnum++; self->no_more_parts = msg->eof || (!msg->successful && !self->expect_cache_inform); g_timer_destroy(timer); return msg; } static gpointer device_thread( gpointer data) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(data); XferElement *elt = XFER_ELEMENT(self); XMsg *msg; DBG(1, "(this is the device thread)"); /* This is the outer loop, that loops once for each split part written to * tape. */ g_mutex_lock(self->state_mutex); while (1) { /* wait until the main thread un-pauses us, and check that we have * the relevant device info available (block_size) */ while (self->paused && !elt->cancelled) { DBG(9, "waiting to be unpaused"); g_cond_wait(self->state_cond, self->state_mutex); } DBG(9, "done waiting"); if (elt->cancelled) break; DBG(2, "beginning to write part"); msg = device_thread_write_part(self); DBG(2, "done writing part"); if (!msg) /* cancelled */ break; /* release the slices for this part, if there were any slices */ if (msg->successful && self->expect_cache_inform) { fast_forward_slices(self, msg->size); } xfer_queue_message(elt->xfer, msg); /* pause ourselves and await instructions from the main thread */ self->paused = TRUE; /* if this is the last part, we're done with the part loop */ if (self->no_more_parts) break; } g_mutex_unlock(self->state_mutex); /* tell the main thread we're done */ xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } /* * Class mechanics */ static void push_buffer_impl( XferElement *elt, gpointer buf, size_t size) { XferDestTaperSplitter *self = (XferDestTaperSplitter *)elt; gchar *p = buf; DBG(3, "push_buffer(%p, %ju)", buf, (uintmax_t)size); /* do nothing if cancelled */ if (G_UNLIKELY(elt->cancelled)) { goto free_and_finish; } /* handle EOF */ if (G_UNLIKELY(buf == NULL)) { /* indicate EOF to the device thread */ g_mutex_lock(self->ring_mutex); self->ring_head_at_eof = TRUE; g_cond_broadcast(self->ring_add_cond); g_mutex_unlock(self->ring_mutex); goto free_and_finish; } /* push the block into the ring buffer, in pieces if necessary */ g_mutex_lock(self->ring_mutex); while (size > 0) { gsize avail; /* wait for some space */ while (self->ring_count == self->ring_length && !elt->cancelled) { DBG(9, "waiting for any space to buffer pushed data"); g_cond_wait(self->ring_free_cond, self->ring_mutex); } DBG(9, "done waiting"); if (elt->cancelled) goto unlock_and_free_and_finish; /* only copy to the end of the buffer, if the available space wraps * around to the beginning */ avail = MIN(size, self->ring_length - self->ring_count); avail = MIN(avail, self->ring_length - self->ring_head); /* copy AVAIL bytes into the ring buf (knowing it's contiguous) */ memmove(self->ring_buffer + self->ring_head, p, avail); /* reset the ring variables to represent this state */ self->ring_count += avail; self->ring_head += avail; /* will, at most, hit ring_length */ if (self->ring_head == self->ring_length) self->ring_head = 0; p = (gpointer)((guchar *)p + avail); size -= avail; /* and give the device thread a notice that data is ready */ g_cond_broadcast(self->ring_add_cond); } unlock_and_free_and_finish: g_mutex_unlock(self->ring_mutex); free_and_finish: if (buf) g_free(buf); } /* * Element mechanics */ static gboolean start_impl( XferElement *elt) { XferDestTaperSplitter *self = (XferDestTaperSplitter *)elt; GError *error = NULL; self->device_thread = g_thread_create(device_thread, (gpointer)self, FALSE, &error); if (!self->device_thread) { g_critical(_("Error creating new thread: %s (%s)"), error->message, errno? strerror(errno) : _("no error code")); } return TRUE; } static gboolean cancel_impl( XferElement *elt, gboolean expect_eof) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(elt); gboolean rv; /* chain up first */ rv = XFER_ELEMENT_CLASS(parent_class)->cancel(elt, expect_eof); /* then signal all of our condition variables, so that threads waiting on them * wake up and see elt->cancelled. */ g_mutex_lock(self->ring_mutex); g_cond_broadcast(self->ring_add_cond); g_cond_broadcast(self->ring_free_cond); g_mutex_unlock(self->ring_mutex); g_mutex_lock(self->state_mutex); g_cond_broadcast(self->state_cond); g_mutex_unlock(self->state_mutex); return rv; } static void start_part_impl( XferDestTaper *xdt, gboolean retry_part, dumpfile_t *header) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdt); g_assert(self->device != NULL); g_assert(!self->device->in_file); g_assert(header != NULL); DBG(1, "start_part()"); /* we can only retry the part if we're getting slices via cache_inform's */ if (retry_part) { if (self->last_part_successful) { xfer_cancel_with_error(XFER_ELEMENT(self), _("Previous part did not fail; cannot retry")); return; } if (!self->expect_cache_inform) { xfer_cancel_with_error(XFER_ELEMENT(self), _("No cache for previous failed part; cannot retry")); return; } self->bytes_to_read_from_slices = self->part_bytes_written; } else { /* don't read any bytes from the slices, since we're not retrying */ self->bytes_to_read_from_slices = 0; } g_mutex_lock(self->state_mutex); g_assert(self->paused); g_assert(!self->no_more_parts); if (self->part_header) dumpfile_free(self->part_header); self->part_header = dumpfile_copy(header); DBG(1, "unpausing"); self->paused = FALSE; g_cond_broadcast(self->state_cond); g_mutex_unlock(self->state_mutex); } static void use_device_impl( XferDestTaper *xdtself, Device *device) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself); StreamingRequirement newstreaming; GValue val; DBG(1, "use_device(%s)%s", device->device_name, (device == self->device)? " (no change)":""); /* short-circuit if nothing is changing */ if (self->device == device) return; g_mutex_lock(self->state_mutex); if (self->device) g_object_unref(self->device); self->device = device; g_object_ref(device); /* get this new device's streaming requirements */ bzero(&val, sizeof(val)); if (!device_property_get(self->device, PROPERTY_STREAMING, &val) || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) { g_warning("Couldn't get streaming type for %s", self->device->device_name); } else { newstreaming = g_value_get_enum(&val); if (newstreaming != self->streaming) g_warning("New device has different streaming requirements from the original; " "ignoring new requirement"); } g_value_unset(&val); /* check that the blocksize hasn't changed */ if (self->block_size != device->block_size) { g_mutex_unlock(self->state_mutex); xfer_cancel_with_error(XFER_ELEMENT(self), _("All devices used by the taper must have the same block size")); return; } g_mutex_unlock(self->state_mutex); } static void cache_inform_impl( XferDestTaper *xdt, const char *filename, off_t offset, off_t length) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdt); FileSlice *slice = g_new(FileSlice, 1), *iter; slice->next = NULL; slice->filename = g_strdup(filename); slice->offset = offset; slice->length = length; g_mutex_lock(self->part_slices_mutex); if (self->part_slices) { for (iter = self->part_slices; iter->next; iter = iter->next) {} iter->next = slice; } else { self->part_slices = slice; } g_mutex_unlock(self->part_slices_mutex); } static guint64 get_part_bytes_written_impl( XferDestTaper *xdtself) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself); /* NOTE: this access is unsafe and may return inconsistent results (e.g, a * partial write to the 64-bit value on a 32-bit system). This is ok for * the moment, as it's only informational, but be warned. */ if (self->device) { return device_get_bytes_written(self->device); } else { return self->part_bytes_written; } } static void instance_init( XferElement *elt) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(elt); elt->can_generate_eof = FALSE; self->state_mutex = g_mutex_new(); self->state_cond = g_cond_new(); self->ring_mutex = g_mutex_new(); self->ring_add_cond = g_cond_new(); self->ring_free_cond = g_cond_new(); self->part_slices_mutex = g_mutex_new(); self->device = NULL; self->paused = TRUE; self->part_header = NULL; self->partnum = 1; self->part_bytes_written = 0; self->part_slices = NULL; } static void finalize_impl( GObject * obj_self) { XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(obj_self); FileSlice *slice, *next_slice; g_mutex_free(self->state_mutex); g_cond_free(self->state_cond); g_mutex_free(self->ring_mutex); g_cond_free(self->ring_add_cond); g_cond_free(self->ring_free_cond); g_mutex_free(self->part_slices_mutex); for (slice = self->part_slices; slice; slice = next_slice) { next_slice = slice->next; if (slice->filename) g_free(slice->filename); g_free(slice); } if (self->ring_buffer) g_free(self->ring_buffer); if (self->part_header) dumpfile_free(self->part_header); if (self->device) g_object_unref(self->device); /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferDestTaperSplitterClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); XferDestTaperClass *xdt_klass = XFER_DEST_TAPER_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 1, 1}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; klass->start = start_impl; klass->cancel = cancel_impl; klass->push_buffer = push_buffer_impl; xdt_klass->start_part = start_part_impl; xdt_klass->use_device = use_device_impl; xdt_klass->cache_inform = cache_inform_impl; xdt_klass->get_part_bytes_written = get_part_bytes_written_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Dest::Taper::Splitter"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } static GType xfer_dest_taper_splitter_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestTaperSplitterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestTaperSplitter), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_DEST_TAPER_TYPE, "XferDestTaperSplitter", &info, 0); } return type; } /* * Constructor */ XferElement * xfer_dest_taper_splitter( Device *first_device, size_t max_memory, guint64 part_size, gboolean expect_cache_inform) { XferDestTaperSplitter *self = (XferDestTaperSplitter *)g_object_new(XFER_DEST_TAPER_SPLITTER_TYPE, NULL); GValue val; /* max_memory and part_size get rounded up to the next multiple of * block_size */ max_memory = ((max_memory + first_device->block_size - 1) / first_device->block_size) * first_device->block_size; if (part_size) part_size = ((part_size + first_device->block_size - 1) / first_device->block_size) * first_device->block_size; self->part_size = part_size; self->partnum = 1; self->device = first_device; g_object_ref(self->device); self->block_size = first_device->block_size; self->paused = TRUE; self->no_more_parts = FALSE; /* set up a ring buffer of size max_memory */ self->ring_length = max_memory; self->ring_buffer = g_try_malloc(max_memory); if (!self->ring_buffer) { g_critical("Can't allocate %llu KB (device-output-buffer-size) of memory", (long long)max_memory/1024); } self->ring_head = self->ring_tail = 0; self->ring_count = 0; self->ring_head_at_eof = 0; /* get this new device's streaming requirements */ bzero(&val, sizeof(val)); if (!device_property_get(self->device, PROPERTY_STREAMING, &val) || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) { g_warning("Couldn't get streaming type for %s", self->device->device_name); self->streaming = STREAMING_REQUIREMENT_REQUIRED; } else { self->streaming = g_value_get_enum(&val); } g_value_unset(&val); /* grab data from cache_inform, just in case we hit PEOM */ self->expect_cache_inform = expect_cache_inform; return XFER_ELEMENT(self); } amanda-3.3.6/device-src/xfer-device.h0000664000076400007640000001220512357250004021034 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef XFER_DEVICE_H #define XFER_DEVICE_H #include "amxfer.h" #include "device.h" #include "xfer-dest-taper.h" /* A transfer source that reads from a Device. The device must be positioned * at the start of a file before the transfer is started. The transfer will * continue until the end of the file. * * Implemented in xfer-source-device.c * * @param device: Device object to read from * @return: new element */ XferElement *xfer_source_device( Device *device); /* A transfer destination that writes bytes to a Device. The device should have a * file started, ready for a device_write_block call. On completion of the transfer, * the file will be finished. If a device error occurs, the transfer will be cancelled. * * If cancel_at_leom is true, then the transfer will also be cancelled on LEOM, with * the error message containing the string "LEOM detected" (this is used by amtapetype). * * Implemented in xfer-dest-device.c * * @param device: the Device to write to, with a file started * @param canel_at_leom: if true, the element will cancel the transfer at LEOM. * @return: new element */ XferElement *xfer_dest_device( Device *device, gboolean canel_at_leom); /* Constructor for XferDestTaperSplitter, which writes data to devices block by * block and splitting parts but no caching. * * @param first_device: the first device that will be used with this xfer, used * to calculate some internal parameters * @param max_memory: total amount of memory to use for buffers, or zero * for a reasonable default. * @param part_size: the desired size of each part * @param expect_cache_inform: TRUE if this element will get cache_inform messages * @return: new element */ XferElement * xfer_dest_taper_splitter( Device *first_device, size_t max_memory, guint64 part_size, gboolean expect_cache_inform); /* Constructor for XferDestTaperCacher, which writes data to devices block by * block and handles caching and splitting parts. * * @param first_device: the first device that will be used with this xfer, used * to calculate some internal parameters * @param max_memory: total amount of memory to use for buffers, or zero * for a reasonable default. * @param part_size: the desired size of each part * @param use_mem_cache: if true, use the memory cache * @param disk_cache_dirname: if not NULL, this is the directory in which the disk * cache should be created * @return: new element */ XferElement * xfer_dest_taper_cacher( Device *first_device, size_t max_memory, guint64 part_size, gboolean use_mem_cache, const char *disk_cache_dirname); /* Constructor for XferDestTaperDirectTCP, which uses DirectTCP to transfer data * to devices (which must support the feature). * * @param first_device: the first device that will be used with this xfer, used * to calculate some internal parameters * @param part_size: the desired size of each part * @return: new element */ XferElement * xfer_dest_taper_directtcp( Device *first_device, guint64 part_size); /* * XferSourceRecovery */ /* Create a new XferSourceRecovery object. Like XferDestTaper instances, this object * will not start transferring data until xfer_source_recovery_start_part is called to * give the device from which the data should flow. * * @param first device: teh first device that will be used with this xfer * @returns: new element */ XferElement * xfer_source_recovery( Device *first_device); /* Start an XferSourceRecovery reading from a particular, pre-positioned device * * @param self: XferSourceRecovery object * @param device: device to read from */ void xfer_source_recovery_start_part( XferElement *elt, Device *device); /* Prepare to read subsequent parts from the given device. The device must * not be started yet. It is not necessary to call this method for the first * device used in a transfer. * * @param self: the XferSourceRecovery object * @param device: the device */ void xfer_source_recovery_use_device( XferElement *self, Device *device); guint64 xfer_source_recovery_get_bytes_read( XferElement *elt); #endif amanda-3.3.6/device-src/Makefile.am0000664000076400007640000000355312357250004020524 0ustar00martineamartinea00000000000000# Makefile for Amanda tape library. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/scripts.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/xfer-src \ -I$(top_srcdir)/ndmp-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) if GCC_COMPILER # ndmp-device.c includes files with old-skool prototypes, so: AM_CFLAGS += -Wno-strict-prototypes endif AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) sbin_PROGRAMS = SCRIPTS_PERL = \ amdevcheck \ amtapetype sbin_SCRIPTS = $(SCRIPTS_PERL) ## libamdevice.la amlib_LTLIBRARIES = libamdevice.la libamdevice_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamdevice_la_SOURCES = \ property.c \ device.c \ directtcp-connection.c \ null-device.c \ rait-device.c \ vfs-device.c \ xfer-source-device.c \ xfer-dest-device.c \ xfer-dest-taper.c \ xfer-dest-taper-cacher.c \ xfer-dest-taper-directtcp.c \ xfer-dest-taper-splitter.c \ xfer-source-recovery.c libamdevice_la_LIBADD = \ ../common-src/libamanda.la \ ../xfer-src/libamxfer.la if WANT_TAPE_DEVICE libamdevice_la_SOURCES += tape-device.c endif if WANT_S3_DEVICE libamdevice_la_SOURCES += s3-device.c s3.c s3-util.c endif if WANT_DVDRW_DEVICE libamdevice_la_SOURCES += dvdrw-device.c endif if WANT_NDMP_DEVICE libamdevice_la_SOURCES += ndmp-device.c libamdevice_la_LIBADD += ../ndmp-src/libndmlib.la endif ## automake-style tests TESTS = noinst_PROGRAMS = $(TESTS) ## activate-devpay if WANT_S3_DEVICE sbin_PROGRAMS += activate-devpay activate_devpay_LDADD = \ ../gnulib/libgnu.la activate_devpay_SOURCES = activate-devpay.c endif ## headers noinst_HEADERS = \ device.h \ directtcp-connection.h \ property.h \ s3.h \ s3-util.h \ xfer-device.h \ xfer-dest-taper.h \ vfs-device.h aminclude_HEADERS = amanda-3.3.6/device-src/ndmp-device.c0000664000076400007640000017642012357250004021033 0ustar00martineamartinea00000000000000/* * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "util.h" #include "device.h" #include "directtcp.h" #include "stream.h" #include "ndmlib.h" #include "ndmpconnobj.h" #include "sockaddr-util.h" /* * Type checking and casting macros */ #define TYPE_NDMP_DEVICE (ndmp_device_get_type()) #define NDMP_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), ndmp_device_get_type(), NdmpDevice) #define NDMP_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), ndmp_device_get_type(), NdmpDevice const) #define NDMP_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), ndmp_device_get_type(), NdmpDeviceClass) #define IS_NDMP_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), ndmp_device_get_type ()) #define NDMP_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), ndmp_device_get_type(), NdmpDeviceClass) static GType ndmp_device_get_type (void); /* * Main object structure */ typedef struct NdmpDevice_ NdmpDevice; struct NdmpDevice_ { Device __parent__; NDMPConnection *ndmp; /* true if tape service is open on the NDMP server */ gboolean tape_open; /* addresses the object is listening on, and how the connection * was opened */ DirectTCPAddr *listen_addrs; gboolean for_writing; /* support for IndirectTCP */ int indirecttcp_sock; /* -1 if not in use */ int indirect; /* Current DirectTCPConnectionNDMP */ struct DirectTCPConnectionNDMP_ *directtcp_conn; /* constructor parameters and properties */ gchar *ndmp_hostname; gint ndmp_port; gchar *ndmp_device_name; gchar *ndmp_username; gchar *ndmp_password; gchar *ndmp_auth; gboolean verbose; gsize read_block_size; GMutex *abort_mutex; GCond *abort_cond; gboolean cancel; int *cancelled; }; /* * Class definition */ typedef struct NdmpDeviceClass_ NdmpDeviceClass; struct NdmpDeviceClass_ { DeviceClass __parent__; }; /* * A directtcp connection subclass representing a running mover on the other end of * the given NDMP connection */ #define TYPE_DIRECTTCP_CONNECTION_NDMP (directtcp_connection_ndmp_get_type()) #define DIRECTTCP_CONNECTION_NDMP(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), directtcp_connection_ndmp_get_type(), DirectTCPConnectionNDMP) #define DIRECTTCP_CONNECTION_NDMP_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), directtcp_connection_ndmp_get_type(), DirectTCPConnectionNDMP const) #define DIRECTTCP_CONNECTION_NDMP_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), directtcp_connection_ndmp_get_type(), DirectTCPConnectionNDMPClass) #define IS_DIRECTTCP_CONNECTION_NDMP(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), directtcp_connection_ndmp_get_type ()) #define DIRECTTCP_CONNECTION_NDMP_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), directtcp_connection_ndmp_get_type(), DirectTCPConnectionNDMPClass) GType directtcp_connection_ndmp_get_type(void); typedef struct DirectTCPConnectionNDMP_ { DirectTCPConnection __parent__; /* NDMP connection controlling the mover */ NDMPConnection *ndmp; /* mode for this operation */ ndmp9_mover_mode mode; /* last reported mover position in the datastream */ guint64 offset; } DirectTCPConnectionNDMP; typedef struct DirectTCPConnectionNDMPClass_ { DirectTCPConnectionClass __parent__; } DirectTCPConnectionNDMPClass; static DirectTCPConnectionNDMP *directtcp_connection_ndmp_new( NDMPConnection *ndmp, ndmp9_mover_mode mode); /* * Constants and static data */ #define NDMP_DEVICE_NAME "ndmp" /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; /* robust_write results */ typedef enum { ROBUST_WRITE_OK, ROBUST_WRITE_OK_LEOM, ROBUST_WRITE_ERROR, /* device error already set */ ROBUST_WRITE_NO_SPACE } robust_write_result; /* * device-specific properties */ /* Authentication information for NDMP agent. Both of these are strings. */ static DevicePropertyBase device_property_ndmp_username; static DevicePropertyBase device_property_ndmp_password; static DevicePropertyBase device_property_ndmp_auth; static DevicePropertyBase device_property_indirect; #define PROPERTY_NDMP_USERNAME (device_property_ndmp_username.ID) #define PROPERTY_NDMP_PASSWORD (device_property_ndmp_password.ID) #define PROPERTY_NDMP_AUTH (device_property_ndmp_auth.ID) #define PROPERTY_INDIRECT (device_property_indirect.ID) /* * prototypes */ void ndmp_device_register(void); static void set_error_from_ndmp(NdmpDevice *self); #define ndmp_device_read_size(self) \ (((NdmpDevice *)(self))->read_block_size? \ ((NdmpDevice *)(self))->read_block_size : ((Device *)(self))->block_size) /* * Utility functions */ static gboolean open_connection( NdmpDevice *self) { if (!self->ndmp) { self->ndmp = ndmp_connection_new( self->ndmp_hostname, self->ndmp_port, self->ndmp_username, self->ndmp_password, self->ndmp_auth); if (ndmp_connection_err_code(self->ndmp)) { char *errmsg = ndmp_connection_err_msg(self->ndmp); device_set_error(DEVICE(self), g_strdup_printf("could not connect to ndmp-server '%s:%d': %s", self->ndmp_hostname, self->ndmp_port, errmsg), DEVICE_STATUS_DEVICE_ERROR); g_object_unref(self->ndmp); self->ndmp = NULL; return FALSE; } if (self->verbose) ndmp_connection_set_verbose(self->ndmp, TRUE); self->tape_open = FALSE; } return TRUE; } static void close_connection( NdmpDevice *self) { /* note that this does not send NDMP_TAPE_CLOSE, as it's used in error * situations too */ if (self->ndmp) { g_object_unref(self->ndmp); self->ndmp = NULL; self->tape_open = FALSE; } } static gboolean open_tape_agent( NdmpDevice *self) { guint64 file_num, blockno, blocksize; /* if already open, stop now */ if (self->tape_open) { return TRUE; } if (!open_connection(self)) { /* error message set by open_connection */ return FALSE; } g_debug("opening tape device '%s' on NDMP server '%s:%d'", self->ndmp_device_name, self->ndmp_hostname, self->ndmp_port); /* send NDMP_TAPE_OPEN, using RAW mode so that it will open even with no tape */ if (!ndmp_connection_tape_open(self->ndmp, self->ndmp_device_name, NDMP9_TAPE_RAW_MODE)) { set_error_from_ndmp(self); return FALSE; } /* check that the block sizes match */ if (!ndmp_connection_tape_get_state(self->ndmp, &blocksize, &file_num, &blockno)) { set_error_from_ndmp(self); return FALSE; } if (blocksize != 0 && blocksize != DEVICE(self)->block_size) { device_set_error(DEVICE(self), g_strdup_printf("NDMP device has fixed block size %ju, but Amanda " "device is configured with blocksize %ju", (uintmax_t)blocksize, (uintmax_t)(DEVICE(self)->block_size)), DEVICE_STATUS_DEVICE_ERROR); } self->tape_open = TRUE; return TRUE; } static gboolean close_tape_agent( NdmpDevice *self) { if (self->tape_open) { g_debug("closing tape device '%s' on NDMP server '%s:%d'", self->ndmp_device_name, self->ndmp_hostname, self->ndmp_port); self->tape_open = FALSE; /* count it as closed even if there is an error */ if (!ndmp_connection_tape_close(self->ndmp)) { set_error_from_ndmp(self); return FALSE; } } return TRUE; } static gboolean single_ndmp_mtio( NdmpDevice *self, ndmp9_tape_mtio_op tape_op) { guint resid; if (!ndmp_connection_tape_mtio(self->ndmp, tape_op, 1, &resid)) { set_error_from_ndmp(self); return FALSE; } if (resid != 0) { device_set_error(DEVICE(self), g_strdup_printf("NDMP MTIO operation %d did not complete", tape_op), DEVICE_STATUS_DEVICE_ERROR); } return TRUE; } /* get the tape state straight from the device; we try to track these things * accurately in the device, but sometimes it's good to check. */ static gboolean ndmp_get_state( NdmpDevice *self) { Device *dself = DEVICE(self); guint64 file_num, blockno, blocksize; if (!ndmp_connection_tape_get_state(self->ndmp, &blocksize, &file_num, &blockno)) { set_error_from_ndmp(self); return FALSE; } g_assert(file_num < INT_MAX); dself->file = (int)file_num; dself->block = blockno; return TRUE; } static robust_write_result robust_write( NdmpDevice *self, char *buf, guint64 count) { guint64 actual; robust_write_result subresult; if (!ndmp_connection_tape_write(self->ndmp, buf, count, &actual)) { switch (ndmp_connection_err_code(self->ndmp)) { case NDMP9_IO_ERR: /* We encountered PEOM; this only happens when the caller ignores * LEOM */ return ROBUST_WRITE_NO_SPACE; case NDMP9_EOM_ERR: /* We encountered LEOM; retry the write (which should succeed) */ subresult = robust_write(self, buf, count); if (subresult != ROBUST_WRITE_OK) return subresult; g_debug("ndmp device hit logical EOM"); return ROBUST_WRITE_OK_LEOM; default: set_error_from_ndmp(self); return ROBUST_WRITE_ERROR; } } g_assert(count == actual); return ROBUST_WRITE_OK; } static void set_error_from_ndmp( NdmpDevice *self) { /* translate some error codes to the corresponding Device API status */ switch (ndmp_connection_err_code(self->ndmp)) { case NDMP9_NO_TAPE_LOADED_ERR: device_set_error(DEVICE(self), g_strdup(_("no tape loaded")), DEVICE_STATUS_VOLUME_MISSING); break; case NDMP9_DEVICE_BUSY_ERR: device_set_error(DEVICE(self), g_strdup(_("device busy")), DEVICE_STATUS_DEVICE_BUSY); break; case NDMP9_IO_ERR: device_set_error(DEVICE(self), g_strdup(_("IO error")), DEVICE_STATUS_VOLUME_UNLABELED | DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); break; default: device_set_error(DEVICE(self), ndmp_connection_err_msg(self->ndmp), DEVICE_STATUS_DEVICE_ERROR); break; } close_connection(self); } /* * Virtual function overrides */ static void ndmp_device_open_device( Device *dself, char *device_name, char *device_type, char *device_node) { NdmpDevice *self = NDMP_DEVICE(dself); char *colon, *at; /* first, extract the various parts of the device_node: * HOST[:PORT]@DEVICE */ colon = strchr(device_node, ':'); at = strchr(device_node, '@'); if (colon > at) colon = NULL; /* :PORT only counts if it's before the device name */ if (!at) { device_set_error(dself, g_strdup_printf("invalid ndmp device name '%s'", device_name), DEVICE_STATUS_DEVICE_ERROR); return; } if (colon) { char *p = NULL; long port = strtol(colon+1, &p, 10); if (port < 0 || port >= 65536 || p != at || (!port && EINVAL == errno)) { device_set_error(dself, g_strdup_printf("invalid ndmp port in device name '%s'", device_name), DEVICE_STATUS_DEVICE_ERROR); return; } self->ndmp_port = (gint)port; self->ndmp_hostname = g_strndup(device_node, colon-device_node); } else { self->ndmp_port = 0; /* (use ndmjob's default, 10000) */ self->ndmp_hostname = g_strndup(device_node, at-device_node); } self->ndmp_device_name = g_strdup(at+1); if (parent_class->open_device) { parent_class->open_device(dself, device_name, device_type, device_node); } } static void ndmp_device_finalize(GObject * obj_self) { NdmpDevice *self = NDMP_DEVICE (obj_self); if(G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); (void)close_tape_agent(self); /* ignore any error */ if (self->directtcp_conn) g_object_unref(self->directtcp_conn); if (self->listen_addrs) g_free(self->listen_addrs); close_connection(self); if (self->ndmp_hostname) g_free(self->ndmp_hostname); if (self->ndmp_device_name) g_free(self->ndmp_device_name); if (self->ndmp_username) g_free(self->ndmp_username); if (self->ndmp_password) g_free(self->ndmp_password); if (self->ndmp_auth) g_free(self->ndmp_auth); if (self->indirecttcp_sock != -1) close(self->indirecttcp_sock); } static DeviceStatusFlags ndmp_device_read_label( Device *dself) { NdmpDevice *self = NDMP_DEVICE(dself); dumpfile_t *header = NULL; gpointer buf = NULL; guint64 buf_size = 0; gsize read_block_size = 0; amfree(dself->volume_label); amfree(dself->volume_time); dumpfile_free(dself->volume_header); dself->volume_header = NULL; if (device_in_error(self)) return dself->status; if (!open_tape_agent(self)) { /* error status was set by open_tape_agent */ return dself->status; } if (!single_ndmp_mtio(self, NDMP9_MTIO_REW)) { /* error message, if any, is set by single_ndmp_mtio */ return dself->status; } /* read the tape header from the NDMP server */ dself->status = 0; read_block_size = ndmp_device_read_size(self); buf = g_try_malloc(read_block_size); if (buf == NULL) { device_set_error(dself, g_strdup(_("Cannot allocate memory")), DEVICE_STATUS_DEVICE_ERROR); goto read_err; } if (!ndmp_connection_tape_read(self->ndmp, buf, read_block_size, &buf_size)) { /* handle known errors */ switch (ndmp_connection_err_code(self->ndmp)) { case NDMP9_NO_TAPE_LOADED_ERR: device_set_error(dself, g_strdup(_("no tape loaded")), DEVICE_STATUS_VOLUME_MISSING); goto read_err; case NDMP9_IO_ERR: device_set_error(dself, g_strdup(_("IO error reading tape label")), DEVICE_STATUS_VOLUME_UNLABELED | DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); goto read_err; case NDMP9_EOM_ERR: case NDMP9_EOF_ERR: device_set_error(dself, g_strdup(_("no tape label found")), DEVICE_STATUS_VOLUME_UNLABELED); header = dself->volume_header = g_new(dumpfile_t, 1); fh_init(header); goto read_err; default: set_error_from_ndmp(self); goto read_err; } } header = dself->volume_header = g_new(dumpfile_t, 1); fh_init(header); parse_file_header(buf, header, buf_size); read_err: g_free(buf); if (dself->status != 0) { /* error already set above */ return dself->status; } /* handle a "weird" label */ if (header->type != F_TAPESTART) { device_set_error(dself, stralloc(_("No tapestart header -- unlabeled device?")), DEVICE_STATUS_VOLUME_UNLABELED); return dself->status; } dself->volume_label = g_strdup(header->name); dself->volume_time = g_strdup(header->datestamp); /* dself->volume_header is already set */ /* note: connection is left open, as well as the tape device */ device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); return dself->status; } static gboolean ndmp_device_start( Device *dself, DeviceAccessMode mode, char *label, char *timestamp) { NdmpDevice *self = NDMP_DEVICE(dself); dumpfile_t *header; char *header_buf; if (device_in_error(self)) return FALSE; if (!open_tape_agent(self)) { /* error status was set by open_tape_agent */ return FALSE; } if (mode != ACCESS_WRITE && dself->volume_label == NULL) { if (ndmp_device_read_label(dself) != DEVICE_STATUS_SUCCESS) /* the error was set by ndmp_device_read_label */ return FALSE; } dself->access_mode = mode; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); if (!single_ndmp_mtio(self, NDMP9_MTIO_REW)) { /* single_ndmp_mtio already set our error message */ return FALSE; } /* Position the tape */ switch (mode) { case ACCESS_APPEND: device_set_error(dself, g_strdup("operation not supported"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; break; case ACCESS_READ: dself->file = 0; break; case ACCESS_WRITE: header = make_tapestart_header(dself, label, timestamp); g_assert(header != NULL); header_buf = device_build_amanda_header(dself, header, NULL); if (header_buf == NULL) { device_set_error(dself, stralloc(_("Tapestart header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); dumpfile_free(header); return FALSE; } switch (robust_write(self, header_buf, dself->block_size)) { case ROBUST_WRITE_OK_LEOM: dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_OK: break; case ROBUST_WRITE_NO_SPACE: /* this would be an odd error to see writing the tape label, but * oh well */ device_set_error(dself, stralloc(_("No space left on device")), DEVICE_STATUS_VOLUME_ERROR); dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_ERROR: /* error was set by robust_write or above */ dumpfile_free(header); amfree(header_buf); return FALSE; } amfree(header_buf); if (!single_ndmp_mtio(self, NDMP9_MTIO_EOF)) { /* error was set by single_ndmp_mtio */ dumpfile_free(header); return FALSE; } dself->volume_label = newstralloc(dself->volume_label, label); dself->volume_time = newstralloc(dself->volume_time, timestamp); dumpfile_free(dself->volume_header); dself->volume_header = header; /* unset the VOLUME_UNLABELED flag, if it was set */ device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); dself->file = 0; break; default: g_assert_not_reached(); } return TRUE; } static gboolean ndmp_device_finish( Device *dself) { gboolean rval; NdmpDevice *self = NDMP_DEVICE(dself); rval = !device_in_error(dself); /* we're not in a file anymore */ dself->access_mode = ACCESS_NULL; if (!close_tape_agent(self)) { /* error is set by close_tape_agent */ rval = FALSE; } if (self->ndmp) close_connection(self); return rval; } static gboolean ndmp_device_eject( Device *dself) { NdmpDevice *self = NDMP_DEVICE(dself); if (device_in_error(dself)) return FALSE; if (!single_ndmp_mtio(self, NDMP9_MTIO_OFF)) { /* error was set by single_ndmp_mtio */ return FALSE; } return TRUE; } /* functions for writing */ static gboolean ndmp_device_start_file( Device *dself, dumpfile_t *header) { NdmpDevice *self = NDMP_DEVICE(dself); char *header_buf; if (device_in_error(self)) return FALSE; dself->is_eof = FALSE; dself->is_eom = FALSE; g_mutex_lock(dself->device_mutex); dself->bytes_written = 0; g_mutex_unlock(dself->device_mutex); /* set the blocksize in the header properly */ header->blocksize = dself->block_size; header_buf = device_build_amanda_header(dself, header, NULL); if (header_buf == NULL) { device_set_error(dself, stralloc(_("Amanda file header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } switch (robust_write(self, header_buf, dself->block_size)) { case ROBUST_WRITE_OK_LEOM: dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_OK: break; case ROBUST_WRITE_NO_SPACE: /* this would be an odd error to see writing the tape label, but * oh well */ device_set_error(dself, stralloc(_("No space left on device")), DEVICE_STATUS_VOLUME_ERROR); dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_ERROR: /* error was set by robust_write or above */ amfree(header_buf); return FALSE; } amfree(header_buf); /* arrange the file numbers correctly */ g_mutex_lock(dself->device_mutex); dself->in_file = TRUE; g_mutex_unlock(dself->device_mutex); if (!ndmp_get_state(self)) { /* error already set by ndmp_get_state */ return FALSE; } /* double-check that the tape agent gave us a non-bogus file number */ g_assert(dself->file > 0); return TRUE; } static gboolean ndmp_device_write_block( Device *dself, guint size, gpointer data) { NdmpDevice *self = NDMP_DEVICE(dself); gpointer replacement_buffer = NULL; if (device_in_error(self)) return FALSE; /* zero out to the end of a short block -- tape devices only write * whole blocks. */ if (size < dself->block_size) { replacement_buffer = g_try_malloc(dself->block_size); if (replacement_buffer == NULL) { device_set_error(dself, g_strdup(_("Cannot allocate memory")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } memcpy(replacement_buffer, data, size); bzero(replacement_buffer+size, dself->block_size-size); data = replacement_buffer; size = dself->block_size; } switch (robust_write(self, data, size)) { case ROBUST_WRITE_OK_LEOM: dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_OK: break; case ROBUST_WRITE_NO_SPACE: /* this would be an odd error to see writing the tape label, but * oh well */ device_set_error(dself, stralloc(_("No space left on device")), DEVICE_STATUS_VOLUME_ERROR); dself->is_eom = TRUE; /* fall through */ case ROBUST_WRITE_ERROR: /* error was set by robust_write or above */ if (replacement_buffer) g_free(replacement_buffer); return FALSE; } dself->block++; g_mutex_lock(dself->device_mutex); dself->bytes_written += size; g_mutex_unlock(dself->device_mutex); if (replacement_buffer) g_free(replacement_buffer); return TRUE; } static gboolean ndmp_device_finish_file( Device *dself) { NdmpDevice *self = NDMP_DEVICE(dself); if (!dself->in_file) return TRUE; /* we're not in a file anymore */ g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); if (device_in_error(dself)) return FALSE; if (!single_ndmp_mtio(self, NDMP9_MTIO_EOF)) { /* error was set by single_ndmp_mtio */ dself->is_eom = TRUE; return FALSE; } return TRUE; } /* functions for reading */ static dumpfile_t* ndmp_device_seek_file( Device *dself, guint file) { NdmpDevice *self = NDMP_DEVICE(dself); gint delta; guint resid; gpointer buf; guint64 buf_size; dumpfile_t *header; gsize read_block_size = 0; if (device_in_error(dself)) return FALSE; /* file 0 is the tape header, and isn't seekable as a distinct * Device-API-level file */ if (file == 0) { device_set_error(dself, g_strdup("cannot seek to file 0"), DEVICE_STATUS_DEVICE_ERROR); return NULL; } /* first, make sure the file and block numbers are correct */ if (!ndmp_get_state(self)) { /* error already set by ndmp_get_state */ return FALSE; } /* now calculate the file delta */ delta = file - dself->file; if (delta <= 0) { /* Note that this algorithm will rewind to the beginning of * the current part, too */ /* BSF *past* the filemark we want to seek to */ if (!ndmp_connection_tape_mtio(self->ndmp, NDMP9_MTIO_BSF, -delta + 1, &resid)) { set_error_from_ndmp(self); return NULL; } if (resid != 0) goto incomplete_bsf; /* now we are on the BOT side of the filemark, but we want to be * on the EOT side of it. An FSF will get us there.. */ if (!ndmp_connection_tape_mtio(self->ndmp, NDMP9_MTIO_FSF, 1, &resid)) { set_error_from_ndmp(self); return NULL; } if (resid != 0) { incomplete_bsf: device_set_error(dself, g_strdup_printf("BSF operation failed to seek by %d files", resid), DEVICE_STATUS_DEVICE_ERROR); return NULL; } } else /* (delta > 0) */ { if (!ndmp_connection_tape_mtio(self->ndmp, NDMP9_MTIO_FSF, delta, &resid)) { set_error_from_ndmp(self); return FALSE; } /* if we didn't seek all the way there, then we're past the tapeend */ if (resid > 0) { device_set_error(dself, vstrallocf(_("Could not seek forward to file %d"), file), DEVICE_STATUS_VOLUME_ERROR); return NULL; } } /* fix up status */ g_mutex_lock(dself->device_mutex); dself->in_file = TRUE; g_mutex_unlock(dself->device_mutex); dself->file = file; dself->block = 0; g_mutex_lock(dself->device_mutex); dself->bytes_read = 0; g_mutex_unlock(dself->device_mutex); /* now read the header */ read_block_size = ndmp_device_read_size(self); buf = g_try_malloc(read_block_size); if (buf == NULL) { device_set_error(dself, g_strdup(_("Cannot allocate memory")), DEVICE_STATUS_DEVICE_ERROR); return NULL; } if (!ndmp_connection_tape_read(self->ndmp, buf, read_block_size, &buf_size)) { switch (ndmp_connection_err_code(self->ndmp)) { case NDMP9_EOF_ERR: case NDMP9_EOM_ERR: return make_tapeend_header(); default: set_error_from_ndmp(self); g_free(buf); return NULL; } } header = g_new(dumpfile_t, 1); fh_init(header); parse_file_header(buf, header, buf_size); g_free(buf); return header; } static gboolean ndmp_device_seek_block( Device *dself, guint64 block) { if (device_in_error(dself)) return FALSE; dself->block = block; device_set_error(dself, g_strdup("operation not supported"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } static int ndmp_device_read_block (Device * dself, gpointer data, int *size_req) { NdmpDevice *self = NDMP_DEVICE(dself); guint64 requested, actual; gsize read_block_size = ndmp_device_read_size(self); /* We checked the NDMP device's blocksize when the device was opened, which should * catch any misalignent of server block size and Amanda block size */ g_assert(read_block_size < INT_MAX); /* check data type mismatch */ if (!data || *size_req < (int)(read_block_size)) { *size_req = (int)(read_block_size); return 0; } requested = *size_req; if (!ndmp_connection_tape_read(self->ndmp, data, requested, &actual)) { /* handle known errors */ switch (ndmp_connection_err_code(self->ndmp)) { case NDMP9_EOM_ERR: case NDMP9_EOF_ERR: dself->is_eof = TRUE; return -1; default: set_error_from_ndmp(self); return -1; } } *size_req = (int)actual; /* cast is OK - requested size was < INT_MAX too */ g_mutex_lock(dself->device_mutex); dself->bytes_read += actual; g_mutex_unlock(dself->device_mutex); return *size_req; } static gboolean indirecttcp_listen( NdmpDevice *self, DirectTCPAddr **addrs) { in_port_t port; self->indirecttcp_sock = stream_server(AF_INET, &port, 0, STREAM_BUFSIZE, 0); if (self->indirecttcp_sock < 0) { device_set_error(DEVICE(self), g_strdup_printf("Could not bind indirecttcp socket: %s", strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } /* An IndirectTCP address is 255.255.255.255:$port */ self->listen_addrs = *addrs = g_new0(DirectTCPAddr, 2); addrs[0]->sin.sin_family = AF_INET; addrs[0]->sin.sin_addr.s_addr = htonl(0xffffffff); SU_SET_PORT(addrs[0], port); return TRUE; } static gboolean listen_impl( Device *dself, gboolean for_writing, DirectTCPAddr **addrs) { NdmpDevice *self = NDMP_DEVICE(dself); if (device_in_error(self)) return FALSE; /* check status */ g_assert(!self->listen_addrs); if (!open_tape_agent(self)) { /* error message was set by open_tape_agent */ return FALSE; } self->for_writing = for_writing; /* first, set the window to an empty span so that the mover doesn't start * reading or writing data immediately. NDMJOB tends to reset the record * size periodically (in direct contradiction to the spec), so we reset it * here as well. */ if (!ndmp_connection_mover_set_record_size(self->ndmp, DEVICE(self)->block_size)) { set_error_from_ndmp(self); return FALSE; } if (for_writing) { /* if we're forcing indirecttcp, just do it */ if (self->indirect) { return indirecttcp_listen(self, addrs); } if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) { /* NDMP4_ILLEGAL_ARGS_ERR means the NDMP server doesn't like a zero-byte * mover window, so we'll ignore it */ if (ndmp_connection_err_code(self->ndmp) != NDMP4_ILLEGAL_ARGS_ERR) { set_error_from_ndmp(self); return FALSE; } g_debug("NDMP Device: cannot set zero-length mover window; " "falling back to IndirectTCP"); /* In this case, we need to set up IndirectTCP */ return indirecttcp_listen(self, addrs); } } else { /* For reading, set the window to the second mover record, so that the * mover will pause immediately when it wants to read the first mover * record. */ if (!ndmp_connection_mover_set_window(self->ndmp, dself->block_size, dself->block_size)) { set_error_from_ndmp(self); return FALSE; } } /* then tell it to start listening */ if (!ndmp_connection_mover_listen(self->ndmp, for_writing? NDMP9_MOVER_MODE_READ : NDMP9_MOVER_MODE_WRITE, NDMP9_ADDR_TCP, addrs)) { set_error_from_ndmp(self); return FALSE; } self->listen_addrs = *addrs; return TRUE; } static gpointer accept_wait_cond( gpointer data) { NdmpDevice *self = NDMP_DEVICE(data); ndmp9_mover_state state; guint64 bytes_moved; gulong backoff = G_USEC_PER_SEC/20; /* 5 msec */ g_mutex_lock(self->abort_mutex); while (1) { g_mutex_unlock(self->abort_mutex); if (!ndmp_connection_mover_get_state(self->ndmp, &state, &bytes_moved, NULL, NULL)) { g_mutex_lock(self->abort_mutex); set_error_from_ndmp(self); state = 0; break; } g_mutex_lock(self->abort_mutex); if (state != NDMP9_MOVER_STATE_LISTEN) break; /* back off a little bit to give the other side time to breathe, * but not more than one second */ g_mutex_unlock(self->abort_mutex); g_usleep(backoff); g_mutex_lock(self->abort_mutex); if (self->cancel) break; backoff *= 2; if (backoff > G_USEC_PER_SEC) backoff = G_USEC_PER_SEC; } self->cancel = TRUE; g_cond_broadcast(self->abort_cond); g_mutex_unlock(self->abort_mutex); return GINT_TO_POINTER(state); } static int accept_impl( Device *dself, DirectTCPConnection **dtcpconn, gboolean *cancelled, GMutex *abort_mutex, GCond *abort_cond) { NdmpDevice *self = NDMP_DEVICE(dself); ndmp9_mover_state state; ndmp9_mover_mode mode; ndmp9_mover_halt_reason mover_halt_reason = NDMP9_MOVER_HALT_NA; ndmp9_mover_pause_reason mover_pause_reason = NDMP9_MOVER_PAUSE_NA; guint64 seek_position; GThread *wait_thread; int result; char *err; if (device_in_error(self)) return 1; self->abort_mutex = abort_mutex; self->abort_cond = abort_cond; self->cancelled = cancelled; self->cancel = FALSE; g_assert(self->listen_addrs); *dtcpconn = NULL; if (!self->for_writing) { /* when reading, we don't get any kind of notification that the * connection has been established, but we can't call NDMP_MOVER_READ * until the mover is active. So we have to poll, waiting for ACTIVE. * This is ugly. */ wait_thread = g_thread_create(accept_wait_cond, (gpointer)self, TRUE, NULL); while (!*cancelled && !self->cancel) { g_cond_wait(self->abort_cond, self->abort_mutex); } self->cancel = TRUE; g_mutex_unlock(self->abort_mutex); state = GPOINTER_TO_INT(g_thread_join(wait_thread)); g_mutex_lock(self->abort_mutex); if (*cancelled) { result = 2; goto accept_failed; } /* double-check state */ if (state != NDMP9_MOVER_STATE_ACTIVE) { device_set_error(DEVICE(self), g_strdup("mover did not enter the ACTIVE state as expected"), DEVICE_STATUS_DEVICE_ERROR); result = 1; goto accept_failed; } /* now, we need to get this into the PAUSED state, since right now we * aren't allowed to perform any tape movement commands. So we issue a * MOVER_READ request for the whole darn image stream after setting the * usual empty window. Note that this means the whole dump will be read * in one MOVER_READ operation, even if it does not begin at the * beginning of a part. */ if (!ndmp_connection_mover_read(self->ndmp, 0, G_MAXUINT64)) { set_error_from_ndmp(self); result = 1; goto accept_failed; } /* now we should expect a notice that the mover has paused */ } else { /* when writing, the mover will pause as soon as the first byte comes * in, so there's no need to do anything to trigger the pause. */ } if (self->indirecttcp_sock == -1) { /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to * write outside the window, while the standard specifies .._EOW, * instead. When reading to a connection, we get the appropriate * .._SEEK. It's easy enough to handle both. */ result = ndmp_connection_wait_for_notify_with_cond(self->ndmp, NULL, &mover_halt_reason, &mover_pause_reason, &seek_position, cancelled, abort_mutex, abort_cond); if (result == 2) { goto accept_failed; } err = NULL; if (mover_pause_reason) { switch (mover_pause_reason) { case NDMP9_MOVER_PAUSE_SEEK: case NDMP9_MOVER_PAUSE_EOW: break; default: err = "got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"; break; } } else if (mover_halt_reason) { err = "unexpected NOTIFY_MOVER_HALT"; } if (err) { device_set_error(DEVICE(self), g_strdup_printf("waiting NDMP_MOVER_PAUSE_SEEK: %s", err), DEVICE_STATUS_DEVICE_ERROR); result = 1; goto accept_failed; } } /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to write * outside the window, while the standard specifies .._EOW, instead. When * reading to a connection, we get the appropriate .._SEEK. It's easy * enough to handle both. */ if (self->indirecttcp_sock == -1) { g_free(self->listen_addrs); self->listen_addrs = NULL; } if (self->for_writing) mode = NDMP9_MOVER_MODE_READ; else mode = NDMP9_MOVER_MODE_WRITE; /* set up the new directtcp connection */ if (self->directtcp_conn) g_object_unref(self->directtcp_conn); self->directtcp_conn = directtcp_connection_ndmp_new(self->ndmp, mode); *dtcpconn = DIRECTTCP_CONNECTION(self->directtcp_conn); /* reference it for the caller */ g_object_ref(*dtcpconn); return 0; accept_failed: if (self->indirecttcp_sock == -1) { g_free(self->listen_addrs); self->listen_addrs = NULL; } return result; } static int connect_impl( Device *dself, gboolean for_writing, DirectTCPAddr *addrs, DirectTCPConnection **dtcpconn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { NdmpDevice *self = NDMP_DEVICE(dself); ndmp9_mover_mode mode; ndmp9_mover_halt_reason mover_halt_reason = NDMP9_MOVER_HALT_NA; ndmp9_mover_pause_reason mover_pause_reason = NDMP9_MOVER_PAUSE_NA; guint64 seek_position; int result; g_assert(!self->listen_addrs); *dtcpconn = NULL; self->for_writing = for_writing; if (!open_tape_agent(self)) { /* error message was set by open_tape_agent */ return 1; } /* first, set the window to an empty span so that the mover doesn't start * reading or writing data immediately. NDMJOB tends to reset the record * size periodically (in direct contradiction to the spec), so we reset it * here as well. */ if (!ndmp_connection_mover_set_record_size(self->ndmp, DEVICE(self)->block_size)) { set_error_from_ndmp(self); return 1; } if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) { set_error_from_ndmp(self); return 1; } if (self->for_writing) mode = NDMP9_MOVER_MODE_READ; else mode = NDMP9_MOVER_MODE_WRITE; if (!ndmp_connection_mover_connect(self->ndmp, mode, addrs)) { set_error_from_ndmp(self); return 1; } if (!self->for_writing) { /* The agent is in the ACTIVE state, and will remain so until we tell * it to do something else. The thing we want to is for it to start * reading data from the tape, which will immediately trigger an EOW or * SEEK pause. */ if (!ndmp_connection_mover_read(self->ndmp, 0, G_MAXUINT64)) { set_error_from_ndmp(self); return 1; } /* now we should expect a notice that the mover has paused */ } else { /* when writing, the mover will pause as soon as the first byte comes * in, so there's no need to do anything to trigger the pause. */ } /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to write * outside the window, while the standard specifies .._EOW, instead. When * reading to a connection, we get the appropriate .._SEEK. It's easy * enough to handle both. */ result = ndmp_connection_wait_for_notify_with_cond(self->ndmp, NULL, &mover_halt_reason, &mover_pause_reason, &seek_position, cancelled, abort_mutex, abort_cond); if (result == 2) { return 2; } if (mover_halt_reason != NDMP9_MOVER_HALT_NA) { device_set_error(DEVICE(self), g_strdup_printf("got NDMP9_MOVER_HALT"), DEVICE_STATUS_DEVICE_ERROR); return 1; } if (mover_pause_reason != NDMP9_MOVER_PAUSE_SEEK && mover_pause_reason != NDMP9_MOVER_PAUSE_EOW) { device_set_error(DEVICE(self), g_strdup_printf("got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"), DEVICE_STATUS_DEVICE_ERROR); return 1; } if (self->listen_addrs) { g_free(self->listen_addrs); self->listen_addrs = NULL; } /* set up the new directtcp connection */ if (self->directtcp_conn) g_object_unref(self->directtcp_conn); self->directtcp_conn = directtcp_connection_ndmp_new(self->ndmp, mode); *dtcpconn = DIRECTTCP_CONNECTION(self->directtcp_conn); /* reference it for the caller */ g_object_ref(*dtcpconn); return 0; } static gboolean indirecttcp_start_writing( NdmpDevice *self) { DirectTCPAddr *real_addrs, *iter; int conn_sock; /* The current state is that the other end is trying to connect to * indirecttcp_sock. The mover remains IDLE, although its window is set * correctly for the part we are about to write. */ g_debug("indirecttcp_start_writing, ready to accept"); conn_sock = accept(self->indirecttcp_sock, NULL, NULL); if (conn_sock < 0) { device_set_error(DEVICE(self), g_strdup_printf("Could not accept indirecttcp socket: %s", strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } g_debug("indirecttcp_start_writing, accepted"); close(self->indirecttcp_sock); self->indirecttcp_sock = -1; /* tell mover to start listening */ g_assert(self->for_writing); if (!ndmp_connection_mover_listen(self->ndmp, NDMP4_MOVER_MODE_READ, NDMP4_ADDR_TCP, &real_addrs)) { set_error_from_ndmp(self); return FALSE; } /* format the addresses and send them down the socket */ for (iter = real_addrs; iter && SU_GET_FAMILY(iter) != 0; iter++) { char inet[INET_ADDRSTRLEN]; const char *addr; char *addrspec; addr = inet_ntop(AF_INET, &iter->sin.sin_addr.s_addr, inet, INET_ADDRSTRLEN); addrspec = g_strdup_printf("%s:%d%s", addr, SU_GET_PORT(iter), SU_GET_FAMILY(iter+1) !=0? " ":""); g_debug("indirecttcp_start_writing, send %s", addrspec); if (full_write(conn_sock, addrspec, strlen(addrspec)) < strlen(addrspec)) { device_set_error(DEVICE(self), g_strdup_printf("writing to indirecttcp socket: %s", strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } /* close the socket for good. This ensures that the next call to * write_from_connection_impl will not go through the mover setup process. * */ if (close(conn_sock) < 0) { device_set_error(DEVICE(self), g_strdup_printf("closing indirecttcp socket: %s", strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } conn_sock = -1; /* and free the listen_addrs, since we didn't free them in accept_impl */ if (self->listen_addrs) { g_free(self->listen_addrs); self->listen_addrs = NULL; } /* Now it's up to the remote end to connect to the mover and start sending * data. We won't get any notification when this happens, although we could * in principle poll for such a thing. */ return TRUE; } static int write_from_connection_impl( Device *dself, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { NdmpDevice *self = NDMP_DEVICE(dself); DirectTCPConnectionNDMP *nconn = self->directtcp_conn; gboolean eom = FALSE, eof = FALSE, eow = FALSE; ndmp9_mover_state mover_state; ndmp9_mover_halt_reason mover_halt_reason = NDMP9_MOVER_HALT_NA; ndmp9_mover_pause_reason mover_pause_reason = NDMP9_MOVER_PAUSE_NA; guint64 bytes_moved_before, bytes_moved_after; gchar *err; int result; if (device_in_error(self)) return FALSE; g_debug("write_from_connection_impl"); if (actual_size) *actual_size = 0; /* if this is false, then the caller did not use use_connection correctly */ g_assert(self->directtcp_conn != NULL); g_assert(self->ndmp == nconn->ndmp); g_assert(nconn->mode == NDMP9_MOVER_MODE_READ); if (!ndmp_connection_mover_get_state(self->ndmp, &mover_state, &bytes_moved_before, NULL, NULL)) { set_error_from_ndmp(self); return 1; } if (self->indirecttcp_sock != -1) { /* If we're doing IndirectTCP, then we've deferred the whole * mover_set_window mover_listen process.. until now. * So the mover should be IDLE. */ g_assert(mover_state == NDMP9_MOVER_STATE_IDLE); } else { /* the mover had best be PAUSED right now */ g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED); } /* we want to set the window regardless of whether this is directtcp or * indirecttcp */ if (!ndmp_connection_mover_set_window(self->ndmp, nconn->offset, size? size : G_MAXUINT64 - nconn->offset)) { set_error_from_ndmp(self); return 1; } /* for DirectTCP, we just tell the mover to continue; IndirectTCP is more complicated. */ if (self->indirecttcp_sock != -1) { if (!indirecttcp_start_writing(self)) { return 1; } } else { if (!ndmp_connection_mover_continue(self->ndmp)) { set_error_from_ndmp(self); return 1; } } /* now wait for the mover to pause itself again, or halt on EOF or an error */ result = ndmp_connection_wait_for_notify_with_cond(self->ndmp, NULL, &mover_halt_reason, &mover_pause_reason, NULL, cancelled, abort_mutex, abort_cond); if (result == 2) { return 2; } err = NULL; if (mover_pause_reason) { switch (mover_pause_reason) { case NDMP9_MOVER_PAUSE_EOM: eom = TRUE; break; /* ndmjob sends .._SEEK when it should send .._EOW, so deal with * both equivalently */ case NDMP9_MOVER_PAUSE_EOW: case NDMP9_MOVER_PAUSE_SEEK: eow = TRUE; break; default: err = "got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"; break; } } else if (mover_halt_reason) { switch (mover_halt_reason) { case NDMP9_MOVER_HALT_CONNECT_CLOSED: eof = TRUE; break; default: case NDMP9_MOVER_HALT_ABORTED: /* case NDMP9_MOVER_HALT_MEDIA_ERROR: <-- not in ndmjob */ case NDMP9_MOVER_HALT_INTERNAL_ERROR: case NDMP9_MOVER_HALT_CONNECT_ERROR: err = "unexpected NDMP_NOTIFY_MOVER_HALTED"; break; } } if (err) { device_set_error(DEVICE(self), g_strdup_printf("waiting for accept: %s", err), DEVICE_STATUS_DEVICE_ERROR); return 1; } /* no error, so the mover stopped due to one of EOM (volume out of space), * EOF (data connection is done), or EOW (maximum part size was written). * In any case, we want to know how many bytes were written. */ if (!ndmp_connection_mover_get_state(self->ndmp, &mover_state, &bytes_moved_after, NULL, NULL)) { set_error_from_ndmp(self); return 1; } size = bytes_moved_after - bytes_moved_before; nconn->offset += size; if (actual_size) { *actual_size = bytes_moved_after - bytes_moved_before; } if (eow) { ; /* mover finished the whole part -- nothing to report! */ } else if (eof) { DEVICE(self)->is_eof = TRUE; } else if (eom) { /* this is a *lossless* EOM, so no need to set error, but * we do need to figure out the actual size */ DEVICE(self)->is_eom = TRUE; } else { g_assert_not_reached(); error("not reached"); } return 0; } static int read_to_connection_impl( Device *dself, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { NdmpDevice *self = NDMP_DEVICE(dself); DirectTCPConnectionNDMP *nconn = self->directtcp_conn; gboolean eom = FALSE, eof = FALSE, eow = FALSE; ndmp9_mover_state mover_state; ndmp9_mover_halt_reason mover_halt_reason = NDMP9_MOVER_HALT_NA; ndmp9_mover_pause_reason mover_pause_reason = NDMP9_MOVER_PAUSE_NA; guint64 bytes_moved_before, bytes_moved_after; gchar *err; int result; if (actual_size) *actual_size = 0; if (device_in_error(self)) return 1; /* read_to_connection does not support IndirectTCP */ g_assert(self->indirecttcp_sock == -1); /* if this is false, then the caller did not use use_connection correctly */ g_assert(nconn != NULL); g_assert(self->ndmp == nconn->ndmp); g_assert(nconn->mode == NDMP9_MOVER_MODE_WRITE); if (!ndmp_connection_mover_get_state(self->ndmp, &mover_state, &bytes_moved_before, NULL, NULL)) { set_error_from_ndmp(self); return 1; } /* the mover had best be PAUSED right now */ g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED); if (!ndmp_connection_mover_set_window(self->ndmp, nconn->offset, size? size : G_MAXUINT64 - nconn->offset)) { set_error_from_ndmp(self); return 1; } if (!ndmp_connection_mover_continue(self->ndmp)) { set_error_from_ndmp(self); return 1; } /* now wait for the mover to pause itself again, or halt on EOF or an error */ result = ndmp_connection_wait_for_notify_with_cond(self->ndmp, NULL, &mover_halt_reason, &mover_pause_reason, NULL, cancelled, abort_mutex, abort_cond); if (result == 2) { return 2; } err = NULL; if (mover_pause_reason) { switch (mover_pause_reason) { case NDMP9_MOVER_PAUSE_EOF: eof = TRUE; break; /* ndmjob sends .._SEEK when it should send .._EOW, so deal with * both equivalently */ case NDMP9_MOVER_PAUSE_EOW: case NDMP9_MOVER_PAUSE_SEEK: eow = TRUE; break; default: err = "got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"; break; } } else if (mover_halt_reason) { switch (mover_halt_reason) { case NDMP9_MOVER_HALT_CONNECT_CLOSED: eof = TRUE; break; default: case NDMP9_MOVER_HALT_ABORTED: /* case NDMP9_MOVER_HALT_MEDIA_ERROR: <-- not in ndmjob */ case NDMP9_MOVER_HALT_INTERNAL_ERROR: case NDMP9_MOVER_HALT_CONNECT_ERROR: err = "unexpected NDMP_NOTIFY_MOVER_HALTED"; break; } } if (err) { device_set_error(DEVICE(self), g_strdup_printf("waiting for accept: %s", err), DEVICE_STATUS_DEVICE_ERROR); return 1; } /* no error, so the mover stopped due to one of EOM (volume out of space), * EOF (data connection is done), or EOW (maximum part size was written). * In any case, we want to know how many bytes were written. */ if (!ndmp_connection_mover_get_state(self->ndmp, &mover_state, &bytes_moved_after, NULL, NULL)) { set_error_from_ndmp(self); return 1; } size = bytes_moved_after - bytes_moved_before; nconn->offset += size; if (actual_size) { *actual_size = bytes_moved_after - bytes_moved_before; } if (eow) { ; /* mover finished the whole part -- nothing to report! */ } else if (eof) { DEVICE(self)->is_eof = TRUE; } else if (eom) { /* this is a *lossless* EOM, so no need to set error, but * we do need to figure out the actual size */ DEVICE(self)->is_eom = TRUE; } else { g_assert_not_reached(); error("not reached"); } return 0; } static gboolean use_connection_impl( Device *dself, DirectTCPConnection *conn) { NdmpDevice *self = NDMP_DEVICE(dself); DirectTCPConnectionNDMP *nconn; /* the device_use_connection_impl wrapper already made sure we're in * ACCESS_NULL, but we may have opened the tape service already to read * a label - so close it to be sure */ if (!close_tape_agent(self)) { /* error was already set by close_tape_agent */ return FALSE; } /* we had best not be listening when this is called */ g_assert(!self->listen_addrs); if (!IS_DIRECTTCP_CONNECTION_NDMP(conn)) { device_set_error(DEVICE(self), g_strdup("existing DirectTCPConnection is not compatible with this device"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->directtcp_conn) g_object_unref(self->directtcp_conn); self->directtcp_conn = nconn = DIRECTTCP_CONNECTION_NDMP(conn); g_object_ref(self->directtcp_conn); /* if this is a different connection, use it */ if (nconn->ndmp != self->ndmp) { if (self->ndmp) close_connection(self); self->ndmp = nconn->ndmp; g_object_ref(self->ndmp); } return TRUE; } /* * Class mechanics */ static gboolean ndmp_device_set_username_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(dself); amfree(self->ndmp_username); self->ndmp_username = g_value_dup_string(val); device_clear_volume_details(dself); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean ndmp_device_set_password_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(dself); amfree(self->ndmp_password); self->ndmp_password = g_value_dup_string(val); device_clear_volume_details(dself); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean ndmp_device_set_auth_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(dself); amfree(self->ndmp_auth); self->ndmp_auth = g_value_dup_string(val); device_clear_volume_details(dself); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean ndmp_device_set_verbose_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(p_self); self->verbose = g_value_get_boolean(val); /* if the connection is active, set up verbose logging or turn it off */ if (self->ndmp) { ndmp_connection_set_verbose(self->ndmp, self->verbose); } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean ndmp_device_set_read_block_size_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(p_self); gsize read_block_size = g_value_get_uint(val); if (read_block_size != 0 && ((gsize)read_block_size < p_self->block_size || (gsize)read_block_size > p_self->max_block_size)) { device_set_error(p_self, g_strdup_printf("Error setting READ-BLOCK-SIZE property to '%zu', it must be between %zu and %zu", read_block_size, p_self->block_size, p_self->max_block_size), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } self->read_block_size = read_block_size; /* use the READ_BLOCK_SIZE, even if we're invoked to get the old READ_BUFFER_SIZE */ return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean ndmp_device_set_indirect_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { NdmpDevice *self = NDMP_DEVICE(dself); self->indirect = g_value_get_boolean(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean ndmp_device_set_leom_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety G_GNUC_UNUSED, PropertySource source G_GNUC_UNUSED) { gboolean leom = g_value_get_boolean(val); if (!leom) { device_set_error(dself, g_strdup_printf("Error setting LEOM property, it must be TRUE"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } return TRUE; } static void ndmp_device_class_init(NdmpDeviceClass * c G_GNUC_UNUSED) { GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->open_device = ndmp_device_open_device; device_class->read_label = ndmp_device_read_label; device_class->start = ndmp_device_start; device_class->finish = ndmp_device_finish; device_class->eject = ndmp_device_eject; device_class->start_file = ndmp_device_start_file; device_class->write_block = ndmp_device_write_block; device_class->finish_file = ndmp_device_finish_file; device_class->seek_file = ndmp_device_seek_file; device_class->seek_block = ndmp_device_seek_block; device_class->read_block = ndmp_device_read_block; device_class->directtcp_supported = TRUE; device_class->listen = listen_impl; device_class->accept= accept_impl; device_class->connect= connect_impl; device_class->write_from_connection = write_from_connection_impl; device_class->read_to_connection = read_to_connection_impl; device_class->use_connection = use_connection_impl; g_object_class->finalize = ndmp_device_finalize; device_class_register_property(device_class, PROPERTY_NDMP_USERNAME, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, ndmp_device_set_username_fn); device_class_register_property(device_class, PROPERTY_NDMP_PASSWORD, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, ndmp_device_set_password_fn); device_class_register_property(device_class, PROPERTY_NDMP_AUTH, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, ndmp_device_set_auth_fn); device_class_register_property(device_class, PROPERTY_VERBOSE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK, device_simple_property_get_fn, ndmp_device_set_verbose_fn); device_class_register_property(device_class, PROPERTY_INDIRECT, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK, device_simple_property_get_fn, ndmp_device_set_indirect_fn); device_class_register_property(device_class, PROPERTY_READ_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, ndmp_device_set_read_block_size_fn); device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, ndmp_device_set_leom_fn); } static void ndmp_device_init(NdmpDevice *self) { Device *dself = DEVICE(self); GValue response; /* begin unconnected */ self->ndmp = NULL; /* decent defaults */ dself->block_size = 32768; dself->min_block_size = 32768; dself->max_block_size = SIZE_MAX; bzero(&response, sizeof(response)); g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_EXCLUSIVE); device_set_simple_property(dself, PROPERTY_CONCURRENCY, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_DESIRED); device_set_simple_property(dself, PROPERTY_STREAMING, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_APPENDABLE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_FULL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_LEOM, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); self->read_block_size = 0; g_value_init(&response, G_TYPE_UINT); g_value_set_uint(&response, self->read_block_size); device_set_simple_property(dself, PROPERTY_READ_BLOCK_SIZE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); g_value_init(&response, G_TYPE_STRING); g_value_set_string(&response, "ndmp"); device_set_simple_property(dself, PROPERTY_NDMP_USERNAME, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->ndmp_username = g_strdup("ndmp"); g_value_init(&response, G_TYPE_STRING); g_value_set_string(&response, "ndmp"); device_set_simple_property(dself, PROPERTY_NDMP_PASSWORD, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->ndmp_password = g_strdup("ndmp"); g_value_init(&response, G_TYPE_STRING); g_value_set_string(&response, "md5"); device_set_simple_property(dself, PROPERTY_NDMP_AUTH, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->ndmp_auth = g_strdup("md5"); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_INDIRECT, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->indirect = TRUE; self->indirecttcp_sock = -1; } static GType ndmp_device_get_type(void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (NdmpDeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ndmp_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (NdmpDevice), 0 /* n_preallocs */, (GInstanceInitFunc) ndmp_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "NdmpDevice", &info, (GTypeFlags)0); } return type; } static Device* ndmp_device_factory( char *device_name, char *device_type, char *device_node) { Device *rval; g_assert(0 == strcmp(device_type, NDMP_DEVICE_NAME)); rval = DEVICE(g_object_new(TYPE_NDMP_DEVICE, NULL)); device_open_device(rval, device_name, device_type, device_node); return rval; } void ndmp_device_register(void) { static const char * device_prefix_list[] = { NDMP_DEVICE_NAME, NULL }; /* register the device itself */ register_device(ndmp_device_factory, device_prefix_list); device_property_fill_and_register(&device_property_ndmp_username, G_TYPE_STRING, "ndmp_username", "Username for access to the NDMP agent"); device_property_fill_and_register(&device_property_ndmp_password, G_TYPE_STRING, "ndmp_password", "Password for access to the NDMP agent"); device_property_fill_and_register(&device_property_ndmp_auth, G_TYPE_STRING, "ndmp_auth", "Authentication method for the NDMP agent - md5 (default), text, none, or void"); device_property_fill_and_register(&device_property_indirect, G_TYPE_BOOLEAN, "indirect", "Use Indirect TCP mode, even if the NDMP server supports " "window length 0"); } /* * DirectTCPConnectionNDMP implementation */ static char * directtcp_connection_ndmp_close(DirectTCPConnection *dself) { DirectTCPConnectionNDMP *self = DIRECTTCP_CONNECTION_NDMP(dself); char *rv = NULL; ndmp9_mover_state state; guint64 bytes_moved; ndmp9_mover_halt_reason mover_halt_reason; gboolean expect_notif = FALSE; /* based on the current state, we may need to abort or stop the * mover before closing it */ if (!ndmp_connection_mover_get_state(self->ndmp, &state, &bytes_moved, NULL, NULL)) { rv = ndmp_connection_err_msg(self->ndmp); goto error; } switch (state) { case NDMP9_MOVER_STATE_HALTED: break; /* nothing to do but ndmp_mover_close, below */ case NDMP9_MOVER_STATE_PAUSED: if (!ndmp_connection_mover_close(self->ndmp)) { rv = ndmp_connection_err_msg(self->ndmp); goto error; } expect_notif = TRUE; break; case NDMP9_MOVER_STATE_ACTIVE: default: if (!ndmp_connection_mover_abort(self->ndmp)) { rv = ndmp_connection_err_msg(self->ndmp); goto error; } expect_notif = TRUE; break; } /* the spec isn't entirely clear that mover_close and mover_abort should * generate a NOTIF_MOVER_HALTED, but ndmjob does it */ if (expect_notif) { if (!ndmp_connection_wait_for_notify(self->ndmp, NULL, &mover_halt_reason, /* value is ignored.. */ NULL, NULL)) { goto error; } } if (!ndmp_connection_mover_stop(self->ndmp)) { rv = ndmp_connection_err_msg(self->ndmp); goto error; } error: if (self->ndmp) { g_object_unref(self->ndmp); self->ndmp = NULL; } return rv; } static void directtcp_connection_ndmp_class_init(DirectTCPConnectionNDMPClass * c) { DirectTCPConnectionClass *connc = (DirectTCPConnectionClass *)c; connc->close = directtcp_connection_ndmp_close; } GType directtcp_connection_ndmp_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DirectTCPConnectionNDMPClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) directtcp_connection_ndmp_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (DirectTCPConnectionNDMP), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static(TYPE_DIRECTTCP_CONNECTION, "DirectTCPConnectionNDMP", &info, (GTypeFlags)0); } return type; } static DirectTCPConnectionNDMP * directtcp_connection_ndmp_new( NDMPConnection *ndmp, ndmp9_mover_mode mode) { DirectTCPConnectionNDMP *dcn = DIRECTTCP_CONNECTION_NDMP( g_object_new(TYPE_DIRECTTCP_CONNECTION_NDMP, NULL)); /* hang onto a copy of this NDMP connection */ g_object_ref(ndmp); dcn->ndmp = ndmp; dcn->mode = mode; dcn->offset = 0; return dcn; } amanda-3.3.6/device-src/xfer-dest-device.c0000664000076400007640000001505412357250004021771 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "device.h" #include "property.h" #include "xfer-device.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_dest_device() references * it directly. */ GType xfer_dest_device_get_type(void); #define XFER_DEST_DEVICE_TYPE (xfer_dest_device_get_type()) #define XFER_DEST_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_device_get_type(), XferDestDevice) #define XFER_DEST_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_device_get_type(), XferDestDevice const) #define XFER_DEST_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_device_get_type(), XferDestDeviceClass) #define IS_XFER_DEST_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_device_get_type ()) #define XFER_DEST_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_device_get_type(), XferDestDeviceClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferDestDevice { XferElement __parent__; Device *device; gboolean cancel_at_leom; gpointer partial; gsize block_size; gsize partial_length; } XferDestDevice; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferDestDeviceClass; /* * Implementation */ static gboolean do_block( XferDestDevice *self, guint size, gpointer data) { XferElement *elt = XFER_ELEMENT(self); if (!device_write_block(self->device, size, data)) { xfer_cancel_with_error(elt, "%s: %s", self->device->device_name, device_error_or_status(self->device)); wait_until_xfer_cancelled(elt->xfer); return FALSE; } /* check for LEOM */ if (self->cancel_at_leom && self->device->is_eom) { xfer_cancel_with_error(elt, "%s: LEOM detected", self->device->device_name); wait_until_xfer_cancelled(elt->xfer); return FALSE; } return TRUE; } static void push_buffer_impl( XferElement *elt, gpointer buf, size_t len) { XferDestDevice *self = XFER_DEST_DEVICE(elt); gpointer to_free = buf; /* Handle EOF */ if (!buf) { /* write out the partial buffer, if there's anything in it */ if (self->partial_length) { if (!do_block(self, self->block_size, self->partial)) { return; } self->partial_length = 0; } device_finish_file(self->device); return; } /* set up the block buffer, now that we can depend on having a blocksize * from the device */ if (!self->partial) { self->partial = g_try_malloc(self->device->block_size); if (self->partial == NULL) { xfer_cancel_with_error(elt, "%s: Cannot allocate memory", self->device->device_name); wait_until_xfer_cancelled(elt->xfer); return; } self->block_size = self->device->block_size; self->partial_length = 0; } /* if we already have data in the buffer, add the new data to it */ if (self->partial_length != 0) { gsize to_copy = min(self->block_size - self->partial_length, len); memmove(self->partial + self->partial_length, buf, to_copy); buf = (gpointer)(to_copy + (char *)buf); len -= to_copy; self->partial_length += to_copy; } /* and if the buffer is now full, write the block */ if (self->partial_length == self->block_size) { if (!do_block(self, self->block_size, self->partial)) { g_free(to_free); return; } self->partial_length = 0; } /* write any whole blocks directly from the push buffer */ while (len >= self->block_size) { if (!do_block(self, self->block_size, buf)) { g_free(to_free); return; } buf = (gpointer)(self->block_size + (char *)buf); len -= self->block_size; } /* and finally store any leftover data in the partial buffer */ if (len) { memmove(self->partial, buf, len); self->partial_length = len; } g_free(to_free); } static void instance_init( XferElement *elt) { XferDestDevice *self = XFER_DEST_DEVICE(elt); self->partial = NULL; } static void finalize_impl( GObject * obj_self) { XferDestDevice *self = XFER_DEST_DEVICE(obj_self); if (self->partial) { g_free(self->partial); } } static void class_init( XferDestDeviceClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); GObjectClass *goc = (GObjectClass*) klass; static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 0, 0}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; klass->push_buffer = push_buffer_impl; klass->perl_class = "Amanda::Xfer::Dest::Device"; klass->mech_pairs = mech_pairs; goc->finalize = finalize_impl; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestDeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestDevice), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestDevice", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-device.h */ XferElement * xfer_dest_device( Device *device, gboolean cancel_at_leom) { XferDestDevice *self = (XferDestDevice *)g_object_new(XFER_DEST_DEVICE_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); g_assert(device != NULL); self->device = device; self->cancel_at_leom = cancel_at_leom; return elt; } amanda-3.3.6/device-src/amdevcheck.pl0000664000076400007640000001076012357250004021115 0ustar00martineamartinea00000000000000#! @PERL@ # Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use lib '@amperldir@'; use Getopt::Long; use strict; use warnings; use Amanda::Device qw( :constants ); use Amanda::Config qw( :getconf :init ); use Amanda::Debug qw( :logging ); use Amanda::Util qw( :constants ); # try to open the device and read its label, returning the device_read_label # result (one or more of ReadLabelStatusFlags) sub try_read_label { my ($device) = @_; my $result; $result = $device->read_label(); if ($device->status() != $DEVICE_STATUS_SUCCESS ) { $result = $device->status(); } return $result; } sub list_device_property { my ( $device, $plist ) = @_; my @proplist; my $result; if (!$plist ) { if ($device->status() == $DEVICE_STATUS_SUCCESS ) { my @list = $device->property_list(); foreach my $line (@list) { push(@proplist, $line->{'name'} ); } } else { $result = $device->status(); print_result($result, $device->error() ); return $result; } } else { @proplist = split(/,/, $plist ); } foreach my $prop (sort @proplist ) { my $value = $device->property_get(lc($prop) ); print uc($prop) . "=$value\n" if (defined($value) ); } return; } # print the results, one flag per line sub print_result { my ($flags, $errmsg) = @_; if ($flags != $DEVICE_STATUS_SUCCESS) { print "MESSAGE $errmsg\n"; } print join( "\n", DeviceStatusFlags_to_strings($flags) ), "\n"; } sub usage { print < [] EOF exit(1); } ## Application initialization Amanda::Util::setup_application("amdevcheck", "server", $CONTEXT_SCRIPTUTIL); my $config_overrides = new_config_overrides($#ARGV+1); my $getproplist; my $device_name; my $print_label; debug("Arguments: " . join(' ', @ARGV)); Getopt::Long::Configure(qw(bundling)); GetOptions( 'version' => \&Amanda::Util::version_opt, 'help|usage|?' => \&usage, 'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); }, 'properties:s' => \$getproplist, 'label' => \$print_label ) or usage(); usage() if ( @ARGV < 1 || @ARGV > 3 ); my $config_name = $ARGV[0]; set_config_overrides($config_overrides); config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name); my ($cfgerr_level, @cfgerr_errors) = config_errors(); if ($cfgerr_level >= $CFGERR_WARNINGS) { config_print_errors(); if ($cfgerr_level >= $CFGERR_ERRORS) { die("errors processing config file"); } } Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER); my $result; if (defined $getproplist && defined $print_label) { die("Can't set both --label and --properties"); } if ( $#ARGV == 1 ) { $device_name = $ARGV[1]; } else { $device_name = getconf($CNF_TAPEDEV); } my $device = Amanda::Device->new($device_name); if ( !$device ) { die("Error creating $device_name"); } $result = $device->status(); if ($result == $DEVICE_STATUS_SUCCESS) { $device->configure(1); if (defined $getproplist) { list_device_property($device,$getproplist); exit 0; } $result = try_read_label($device); if (defined $print_label) { if ($result == $DEVICE_STATUS_SUCCESS) { print $device->volume_label(), "\n"; exit 0; } else { exit 1; } } else { print_result($result, $device->error()); exit 0; } } else { if (!defined $getproplist && !defined $print_label) { print_result($result, $device->error()); exit 0; } else { exit 1; } } Amanda::Util::finish_application(); exit 0; amanda-3.3.6/device-src/directtcp-connection.h0000664000076400007640000000762312357250004022761 0ustar00martineamartinea00000000000000/* * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef DIRECTTCP_CONNECTION_H #define DIRECTTCP_CONNECTION_H #include #include GType directtcp_connection_get_type (void); #define TYPE_DIRECTTCP_CONNECTION (directtcp_connection_get_type()) #define DIRECTTCP_CONNECTION(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), directtcp_connection_get_type(), DirectTCPConnection) #define IS_DIRECTTCP_CONNECTION(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), directtcp_connection_get_type ()) #define DIRECTTCP_CONNECTION_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), directtcp_connection_get_type(), DirectTCPConnectionClass) /* * Parent class for connections */ typedef struct DirectTCPConnection { GObject __parent__; gboolean closed; } DirectTCPConnection; typedef struct DirectTCPConnectionClass_ { GObjectClass __parent__; /* The DirectTCPConnection object allows a particular connection to "span" * multiple devices -- the caller gets the connection from one device, * reads or writes as desired, then creates a new device and passes the * connection to that device. If the new device cannot use the old * connection, then it generates a suitable error message. */ /* call this to close the connection (even if the Device that created * it is long gone). Note that this will be called automatically by * finalize, but it is a programming error to allow this to happen as * any error will be fatal. * * @param self: object * @returns: error message on error, NULL for no error (caller should * free the error message) */ char *(* close)(struct DirectTCPConnection *self); } DirectTCPConnectionClass; /* Method Stubs */ char *directtcp_connection_close( DirectTCPConnection *self); /* * A simple connection subclass containing a local TCP socket, useful for testing */ #define TYPE_DIRECTTCP_CONNECTION_SOCKET (directtcp_connection_socket_get_type()) #define DIRECTTCP_CONNECTION_SOCKET(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), directtcp_connection_socket_get_type(), DirectTCPConnectionSocket) #define DIRECTTCP_CONNECTION_SOCKET_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), directtcp_connection_socket_get_type(), DirectTCPConnectionSocket const) #define DIRECTTCP_CONNECTION_SOCKET_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), directtcp_connection_socket_get_type(), DirectTCPConnectionSocketClass) #define IS_DIRECTTCP_CONNECTION_SOCKET(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), directtcp_connection_socket_get_type ()) #define DIRECTTCP_CONNECTION_SOCKET_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), directtcp_connection_socket_get_type(), DirectTCPConnectionSocketClass) GType directtcp_connection_socket_get_type(void); typedef struct DirectTCPConnectionSocket_ { DirectTCPConnection __parent__; int socket; } DirectTCPConnectionSocket; typedef struct DirectTCPConnectionSocketClass_ { DirectTCPConnectionClass __parent__; } DirectTCPConnectionSocketClass; /* Method Stubs */ DirectTCPConnectionSocket *directtcp_connection_socket_new(int socket); #endif /* DIRECTTCP_CONNECTION_H */ amanda-3.3.6/device-src/device.h0000664000076400007640000004253212357250004020100 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* The Device API abstracts device workings, interaction, properties, and * capabilities from the rest of the Amanda code base. It supports * pluggable modules for different kinds of devices. */ #ifndef DEVICE_H #define DEVICE_H #include #include #include "property.h" #include "fileheader.h" #include "directtcp.h" #include "directtcp-connection.h" /* Device API version. */ #define DEVICE_API_VERSION 0 extern void device_api_init(void); /* Different access modes */ typedef enum { ACCESS_NULL, /* Device is not yet opened. */ ACCESS_READ, ACCESS_WRITE, ACCESS_APPEND } DeviceAccessMode; #define IS_WRITABLE_ACCESS_MODE(mode) ((mode) == ACCESS_WRITE || \ (mode) == ACCESS_APPEND) /* Device object definition follows. */ /* * Type checking and casting macros */ GType device_get_type (void); #define TYPE_DEVICE (device_get_type()) #define DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device) #define DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device const) #define DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), device_get_type(), DeviceClass) #define IS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), device_get_type ()) #define DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), device_get_type(), DeviceClass) typedef struct DevicePrivate_s DevicePrivate; /* See Amanda::Device POD for a description of these constants */ typedef enum { DEVICE_STATUS_SUCCESS = 0, DEVICE_STATUS_DEVICE_ERROR = (1 << 0), DEVICE_STATUS_DEVICE_BUSY = (1 << 1), DEVICE_STATUS_VOLUME_MISSING = (1 << 2), DEVICE_STATUS_VOLUME_UNLABELED = (1 << 3), DEVICE_STATUS_VOLUME_ERROR = (1 << 4), DEVICE_STATUS_FLAGS_MAX = (1 << 5) } DeviceStatusFlags; #define DEVICE_STATUS_FLAGS_MASK (DEVICE_STATUS_MAX-1) #define DEVICE_STATUS_FLAGS_TYPE (device_status_flags_get_type()) GType device_status_flags_get_type(void); /* a callback to prolong an operation */ typedef gboolean (* ProlongProc)(gpointer data); /* * Main object structure */ typedef struct Device { GObject __parent__; /* You can peek at the stuff below, but only subclasses should change these values.*/ /* A mutex to protect field accessed from another thread. * Only get_bytes_read and get_bytes_written are allowed from another * Only in_file, bytes_read and bytes_written are protected */ GMutex *device_mutex; /* What file, block are we at? (and are we in the middle of a file?) */ int file; guint64 block; gboolean in_file; /* Holds the user-specified device name, which may be an alias */ char * device_name; /* Holds the user-specified access-mode, or ACCESS_NULL if the device * has not yet been started*/ DeviceAccessMode access_mode; /* In reading mode, FALSE unless all the data from the current file * was successfully read. In writing mode, TRUE if the last byte * of a file has been written by write_from_connection. */ gboolean is_eof; /* In writing mode, indicates that the volume is at (or near, if possible) * EOM. */ gboolean is_eom; /* Holds the label and time of the currently-inserted volume, * or NULL if it has not been read/written yet. */ char * volume_label; char * volume_time; /* The most recently read volume header, or NULL if no header was * read from this device. Callers can use this to glean information * about the volume beyond volume_label and volume_time. */ dumpfile_t *volume_header; /* The latest status for the device */ DeviceStatusFlags status; /* device block-size ranges. These are also available as properties, * and by default users can set block_size via property BLOCK_SIZE. * Writers should use block_size, and readers should initially use * block_size, and expand buffers as directed by read_block. */ gsize min_block_size; gsize max_block_size; gsize block_size; gsize header_block_size; guint64 bytes_read; guint64 bytes_written; /* surety and source for the block size; if you set block_size directly, * set these, too! */ PropertySurety block_size_surety; PropertySource block_size_source; DevicePrivate * private; } Device; /* Pointer to factory function for device types. * * device_name is the full name ("tape:/dev/nst0") * device_prefix is the prefix ("tape") * device_node is what follows the prefix ("/dev/nst0") * * The caller retains responsibility to free or otherwise handle * the passed strings. */ typedef Device* (*DeviceFactory)(char *device_name, char * device_prefix, char * device_node); /* This function registers a new device with the allocation system. * Call it after you register your type with the GLib type system. * This function assumes that the strings in device_prefix_list are * statically allocated. */ extern void register_device(DeviceFactory factory, const char ** device_prefix_list); /* * Class definition */ typedef struct _DeviceClass DeviceClass; struct _DeviceClass { GObjectClass __parent__; void (* open_device) (Device * self, char * device_name, char * device_prefix, char * device_node); gboolean (* configure) (Device * self, gboolean use_global_config); DeviceStatusFlags (* read_label)(Device * self); gboolean (* start) (Device * self, DeviceAccessMode mode, char * label, char * timestamp); gboolean (* start_file) (Device * self, dumpfile_t * info); gboolean (* write_block) (Device * self, guint size, gpointer data); gboolean (* finish_file) (Device * self); dumpfile_t* (* seek_file) (Device * self, guint file); gboolean (* seek_block) (Device * self, guint64 block); int (* read_block) (Device * self, gpointer buf, int * size); gboolean (* property_get_ex) (Device * self, DevicePropertyId id, GValue * val, PropertySurety *surety, PropertySource *source); gboolean (* property_set_ex) (Device * self, DevicePropertyId id, GValue * val, PropertySurety surety, PropertySource source); gboolean (* recycle_file) (Device * self, guint filenum); gboolean (* erase) (Device * self); gboolean (* eject) (Device * self); gboolean (* finish) (Device * self); guint64 (* get_bytes_read) (Device * self); guint64 (* get_bytes_written) (Device * self); gboolean (* listen)(Device *self, gboolean for_writing, DirectTCPAddr **addrs); /* The MainLoop must be running, but the following 4 methods must not be * called from an event. they must be called from a different thread. * They return: * 0 - success * 1 - failed * 2 - interupted */ int (* accept)(Device *self, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int (* connect)(Device *self, gboolean for_writing, DirectTCPAddr *addrs, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int (* write_from_connection)(Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int (* read_to_connection)(Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); gboolean (* use_connection)(Device *self, DirectTCPConnection *conn); /* array of DeviceProperty objects for this class, keyed by ID */ GArray *class_properties; /* The return value of device_property_get_list */ GSList * class_properties_list; /* TRUE if the directtcp methods are implemented by this device class */ gboolean directtcp_supported; }; /* * Device Instantiation */ /* Return the unaliased device name of a device. * The returned string must not be freed by the caller. */ char* device_unaliased_name(char * device_name); /* This is how you get a new Device. Pass in a device name or alias. * * A Device is *always* returned, even for an invalid device name. You * must check the resulting device->status to know if the device is valid * to be used. If device->status is not DEVICE_STATUS_SUCCESS, then there * was an error opening the device. * * Note that the Amanda configuration must be initialized, as this function * looks for device definitions and other configuration information. */ Device* device_open (char * device_name); /* As a special case, a RAIT device can be created from a collection of child * devices. This is used by the RAIT changer, for example. This function is * implemented in rait-device.c. */ Device* rait_device_open_from_children(GSList *child_devices); /* Once you have a new device, you should configure it. This sets properties * on the device based on the user's configuation. If USE_GLOBAL_CONFIG is * true, then any global device_property parameters are processed, along with * tapetype and othe relevant parameters. */ gboolean device_configure(Device *self, gboolean use_global_config); /* * Error Handling */ /* return the error message or the string "Unknown Device error". The * string remains the responsibility of the Device, and should not * be freed by the caller. */ char *device_error(Device * self); /* return a string version of the status. The string remains the * responsibility of the Device, and should not be freed by the * caller. */ char *device_status_error(Device * self); /* Return errmsg if it is set or a string version of the status. The * string remains the responsibility of the Device, and should not * be freed by the caller. */ char *device_error_or_status(Device * self); /* Set the error message for this device; for use internally to the * API. The string becomes the responsibility of the Device. If * ERRMSG is NULL, the message is cleared. Note that the given flags * are OR'd with any existing status flags. */ void device_set_error(Device * self, char *errmsg, DeviceStatusFlags new_flags); /* Mostly for internal use, this is a boolean check to see whether a given * device is in an error state. If this is TRUE, most operations on the * device will fail. * * The check is for DEVICE_STATUS_DEVICE_ERROR *alone*; if any other bits * (e.g., VOLUME_UNLABELED) are set, then the device may not actually be in * an error state. */ #define device_in_error(dev) \ ((DEVICE(dev))->status == DEVICE_STATUS_DEVICE_ERROR) /* * Public methods * * See the Amanda::Device POD for more information here */ DeviceStatusFlags device_read_label (Device * self); gboolean device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); gboolean device_finish (Device * self); guint64 device_get_bytes_read (Device * self); guint64 device_get_bytes_written(Device * self); gboolean device_start_file (Device * self, dumpfile_t * jobInfo); gboolean device_write_block (Device * self, guint size, gpointer data); gboolean device_finish_file (Device * self); dumpfile_t* device_seek_file (Device * self, guint file); gboolean device_seek_block (Device * self, guint64 block); int device_read_block (Device * self, gpointer buffer, int * size); const GSList * device_property_get_list (Device * self); gboolean device_property_get_ex (Device * self, DevicePropertyId id, GValue * val, PropertySurety *surety, PropertySource *source); #define device_property_get(self, id, val) \ device_property_get_ex((self), (id), (val), NULL, NULL) gboolean device_property_set_ex (Device * self, DevicePropertyId id, GValue * val, PropertySurety surety, PropertySource source); #define device_property_set(self, id, val) \ device_property_set_ex((self), (id), (val), \ PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_USER) gboolean device_recycle_file (Device * self, guint filenum); gboolean device_erase (Device * self); gboolean device_eject (Device * self); #define device_directtcp_supported(self) (DEVICE_GET_CLASS((self))->directtcp_supported) gboolean device_listen(Device *self, gboolean for_writing, DirectTCPAddr **addrs); int device_accept(Device *self, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int device_connect(Device *self, gboolean for_writing, DirectTCPAddr *addrs, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int device_write_from_connection(Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); int device_read_to_connection(Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond); gboolean device_use_connection(Device *self, DirectTCPConnection *conn); /* Protected methods. Don't call these except in subclass implementations. */ /* This method provides post-construction initalization once the * device name is known. It should only be used by Device * factories. It is provided here as a virtual method (instead of * a static function) because some devices may want to chain * initilization to their parents. */ void device_open_device (Device * self, char *device_name, char *device_type, char *device_node); /* Builds a proper header of between *size and self->block_size bytes. * Returns NULL if the header does not fit in a single block. The result * must be free'd. If size is NULL, the block size is used. * * If size is not NULL, *size is set to the actual size of the generated header. */ char * device_build_amanda_header(Device * self, const dumpfile_t * jobinfo, size_t *size); /* Does what you expect. You have to free the returned header. Ensures that self->volume_time matches the header written to tape. */ dumpfile_t * make_tapestart_header(Device * self, char * label, char * timestamp); /* Does what you expect. Uses the current time. */ dumpfile_t * make_tapeend_header(void); /* Erase any stored volume information. Use this if something happens (e.g., * a property is set) that voids previously-read volume details. * This function is a NOOP unless the device is in the NULL state. */ void device_clear_volume_details(Device * device); /* Property Handling */ /* Registers a property for a new device class; device drivers' GClassInitFunc * should call this function for each device-specific property of the class. * If either getter or setter is NULL, then the corresponding operation will * return FALSE. * * Note that this will replace any existing registration (e.g., from a parent * class). */ void device_class_register_property(DeviceClass *klass, DevicePropertyId id, PropertyAccessFlags access, PropertyGetFn getter, PropertySetFn setter); /* Set a 'simple' property on the device. This tucks the value away in the * object, to be retrieved by device_simple_property_get_fn. This is most * often used in GInstanceInit functions, but can be used at any time to set or * change the value of a simple property */ gboolean device_set_simple_property(Device *self, DevicePropertyId id, GValue *val, PropertySurety surety, PropertySource source); /* Get a simple property set with device_set_simple_property. This is a little * bit quicker than calling device_property_get_ex(), and does not affect the * device's error state. Returns FALSE if the property has not been set. * Surety and source are output parameters and will be ignored if they are * NULL. */ gboolean device_get_simple_property(Device *self, DevicePropertyId id, GValue *val, PropertySurety *surety, PropertySource *source); /* A useful PropertySetFn. If your subclass also needs to intercept sets, for * example to flush a cache or update a member variable, then write a stub * function which "calls up" to this function. */ gboolean device_simple_property_set_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); /* A useful PropertyGetFn -- returns the value, source, and surety set with * device_set_simple_property */ gboolean device_simple_property_get_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); #endif /* DEVICE_H */ amanda-3.3.6/device-src/s3.c0000664000076400007640000031502412357250004017160 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* TODO * - collect speed statistics * - debugging mode */ #ifdef HAVE_CONFIG_H /* use a relative path here to avoid conflicting with Perl's config.h. */ #include "../config/config.h" #endif #include #include "s3.h" #include "s3-util.h" #ifdef HAVE_REGEX_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_DIRENT_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_UTIL_H #include "util.h" #endif #ifdef HAVE_AMANDA_H #include "amanda.h" #endif #include /* Constant renamed after version 7.10.7 */ #ifndef CURLINFO_RESPONSE_CODE #define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE #endif /* We don't need OpenSSL's kerberos support, and it's broken in * RHEL 3 anyway. */ #define OPENSSL_NO_KRB5 #ifdef HAVE_OPENSSL_HMAC_H # include #else # ifdef HAVE_CRYPTO_HMAC_H # include # else # ifdef HAVE_HMAC_H # include # endif # endif #endif #include #include #include /* Maximum key length as specified in the S3 documentation * (*excluding* null terminator) */ #define S3_MAX_KEY_LENGTH 1024 #define AMAZON_SECURITY_HEADER "x-amz-security-token" #define AMAZON_STORAGE_CLASS_HEADER "x-amz-storage-class" #define AMAZON_SERVER_SIDE_ENCRYPTION_HEADER "x-amz-server-side-encryption" #define AMAZON_WILDCARD_LOCATION "*" /* parameters for exponential backoff in the face of retriable errors */ /* start at 0.01s */ #define EXPONENTIAL_BACKOFF_START_USEC G_USEC_PER_SEC/100 /* double at each retry */ #define EXPONENTIAL_BACKOFF_BASE 2 /* retry 14 times (for a total of about 3 minutes spent waiting) */ #define EXPONENTIAL_BACKOFF_MAX_RETRIES 14 /* general "reasonable size" parameters */ #define MAX_ERROR_RESPONSE_LEN (100*1024) // CURLE_SSL_CACERT_BADFILE is defined in 7.16.0 #if LIBCURL_VERSION_NUM >= 0x071600 #define AMAMDA_CURLE_SSL_CACERT_BADFILE CURLE_SSL_CACERT_BADFILE #else # define AMAMDA_CURLE_SSL_CACERT_BADFILE CURLE_GOT_NOTHING #endif /* Results which should always be retried */ #define RESULT_HANDLING_ALWAYS_RETRY \ { 400, S3_ERROR_RequestTimeout, 0, S3_RESULT_RETRY }, \ { 403, S3_ERROR_RequestTimeTooSkewed,0, S3_RESULT_RETRY }, \ { 409, S3_ERROR_OperationAborted, 0, S3_RESULT_RETRY }, \ { 412, S3_ERROR_PreconditionFailed, 0, S3_RESULT_RETRY }, \ { 500, S3_ERROR_InternalError, 0, S3_RESULT_RETRY }, \ { 501, S3_ERROR_NotImplemented, 0, S3_RESULT_RETRY }, \ { 0, 0, CURLE_COULDNT_CONNECT, S3_RESULT_RETRY }, \ { 0, 0, CURLE_COULDNT_RESOLVE_HOST, S3_RESULT_RETRY }, \ { 0, 0, CURLE_PARTIAL_FILE, S3_RESULT_RETRY }, \ { 0, 0, CURLE_OPERATION_TIMEOUTED, S3_RESULT_RETRY }, \ { 0, 0, CURLE_SSL_CONNECT_ERROR, S3_RESULT_RETRY }, \ { 0, 0, CURLE_SEND_ERROR, S3_RESULT_RETRY }, \ { 0, 0, CURLE_RECV_ERROR, S3_RESULT_RETRY }, \ { 0, 0, CURLE_GOT_NOTHING, S3_RESULT_RETRY }, \ { 0, 0, AMAMDA_CURLE_SSL_CACERT_BADFILE, S3_RESULT_RETRY } /* * Data structures and associated functions */ struct S3Handle { /* (all strings in this struct are freed by s3_free()) */ char *access_key; char *secret_key; char *user_token; char *swift_account_id; char *swift_access_key; char *username; char *password; char *tenant_id; char *tenant_name; char *client_id; char *client_secret; char *refresh_token; char *access_token; time_t expires; gboolean getting_oauth2_access_token; gboolean getting_swift_2_token; /* attributes for new objects */ char *bucket_location; char *storage_class; char *server_side_encryption; char *proxy; char *host; char *service_path; gboolean use_subdomain; S3_api s3_api; char *ca_info; char *x_auth_token; char *x_storage_url; CURL *curl; gboolean verbose; gboolean use_ssl; guint64 max_send_speed; guint64 max_recv_speed; /* information from the last request */ char *last_message; guint last_response_code; s3_error_code_t last_s3_error_code; CURLcode last_curl_code; guint last_num_retries; void *last_response_body; guint last_response_body_size; /* offset with s3 */ time_t time_offset_with_s3; char *content_type; gboolean reuse_connection; long timeout; /* CAStor */ char *reps; char *reps_bucket; }; typedef struct { CurlBuffer resp_buf; s3_write_func write_func; s3_reset_func reset_func; gpointer write_data; gboolean headers_done; gboolean int_write_done; char *etag; /* Points to current handle: Added to get hold of s3 offset */ struct S3Handle *hdl; } S3InternalData; /* Callback function to examine headers one-at-a-time * * @note this is the same as CURLOPT_HEADERFUNCTION * * @param data: The pointer to read data from * @param size: The size of each "element" of the data buffer in bytes * @param nmemb: The number of elements in the data buffer. * So, the buffer's size is size*nmemb bytes. * @param stream: the header_data (an opaque pointer) * * @return The number of bytes written to the buffer or * CURL_WRITEFUNC_PAUSE to pause. * If it's the number of bytes written, it should match the buffer size */ typedef size_t (*s3_header_func)(void *data, size_t size, size_t nmemb, void *stream); /* * S3 errors */ /* (see preprocessor magic in s3.h) */ static char * s3_error_code_names[] = { #define S3_ERROR(NAME) #NAME S3_ERROR_LIST #undef S3_ERROR }; /* Convert an s3 error name to an error code. This function * matches strings case-insensitively, and is appropriate for use * on data from the network. * * @param s3_error_code: the error name * @returns: the error code (see constants in s3.h) */ static s3_error_code_t s3_error_code_from_name(char *s3_error_name); /* Convert an s3 error code to a string * * @param s3_error_code: the error code to convert * @returns: statically allocated string */ static const char * s3_error_name_from_code(s3_error_code_t s3_error_code); /* * result handling */ /* result handling is specified by a static array of result_handling structs, * which match based on response_code (from HTTP) and S3 error code. The result * given for the first match is used. 0 acts as a wildcard for both response_code * and s3_error_code. The list is terminated with a struct containing 0 for both * response_code and s3_error_code; the result for that struct is the default * result. * * See RESULT_HANDLING_ALWAYS_RETRY for an example. */ typedef enum { S3_RESULT_RETRY = -1, S3_RESULT_FAIL = 0, S3_RESULT_OK = 1, S3_RESULT_NOTIMPL = 2 } s3_result_t; typedef struct result_handling { guint response_code; s3_error_code_t s3_error_code; CURLcode curl_code; s3_result_t result; } result_handling_t; /* * get the access token for OAUTH2 */ static gboolean oauth2_get_access_token(S3Handle *hdl); /* Lookup a result in C{result_handling}. * * @param result_handling: array of handling specifications * @param response_code: response code from operation * @param s3_error_code: s3 error code from operation, if any * @param curl_code: the CURL error, if any * @returns: the matching result */ static s3_result_t lookup_result(const result_handling_t *result_handling, guint response_code, s3_error_code_t s3_error_code, CURLcode curl_code); /* * Precompiled regular expressions */ static regex_t etag_regex, error_name_regex, message_regex, subdomain_regex, location_con_regex, date_sync_regex, x_auth_token_regex, x_storage_url_regex, access_token_regex, expires_in_regex, content_type_regex, details_regex, code_regex; /* * Utility functions */ /* Check if a string is non-empty * * @param str: string to check * @returns: true iff str is non-NULL and not "\0" */ static gboolean is_non_empty_string(const char *str); /* Construct the URL for an Amazon S3 REST request. * * A new string is allocated and returned; it is the responsiblity of the caller. * * @param hdl: the S3Handle object * @param service_path: A path to add in the URL, or NULL for none. * @param bucket: the bucket being accessed, or NULL for none * @param key: the key being accessed, or NULL for none * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none * @param query: the query being accessed (e.g. "acl"), or NULL for none * * !use_subdomain: http://host/service_path/bucket/key * use_subdomain : http://bucket.host/service_path/key * */ static char * build_url( S3Handle *hdl, const char *bucket, const char *key, const char *subresource, const char *query); /* Create proper authorization headers for an Amazon S3 REST * request to C{headers}. * * @note: C{X-Amz} headers (in C{headers}) must * - be in lower-case * - be in alphabetical order * - have no spaces around the colon * (don't yell at me -- see the Amazon Developer Guide) * * @param hdl: the S3Handle object * @param verb: capitalized verb for this request ('PUT', 'GET', etc.) * @param bucket: the bucket being accessed, or NULL for none * @param key: the key being accessed, or NULL for none * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none * @param md5_hash: the MD5 hash of the request body, or NULL for none */ static struct curl_slist * authenticate_request(S3Handle *hdl, const char *verb, const char *bucket, const char *key, const char *subresource, const char *md5_hash, const char *content_type, const size_t content_length, const char *project_id); /* Interpret the response to an S3 operation, assuming CURL completed its request * successfully. This function fills in the relevant C{hdl->last*} members. * * @param hdl: The S3Handle object * @param body: the response body * @param body_len: the length of the response body * @param etag: The response's ETag header * @param content_md5: The hex-encoded MD5 hash of the request body, * which will be checked against the response's ETag header. * If NULL, the header is not checked. * If non-NULL, then the body should have the response headers at its beginnning. * @returns: TRUE if the response should be retried (e.g., network error) */ static gboolean interpret_response(S3Handle *hdl, CURLcode curl_code, char *curl_error_buffer, gchar *body, guint body_len, const char *etag, const char *content_md5); /* Perform an S3 operation. This function handles all of the details * of retryig requests and so on. * * The concepts of bucket and keys are defined by the Amazon S3 API. * See: "Components of Amazon S3" - API Version 2006-03-01 pg. 8 * * Individual sub-resources are defined in several places. In the REST API, * they they are represented by a "flag" in the "query string". * See: "Constructing the CanonicalizedResource Element" - API Version 2006-03-01 pg. 60 * * @param hdl: the S3Handle object * @param verb: the HTTP request method * @param bucket: the bucket to access, or NULL for none * @param key: the key to access, or NULL for none * @param subresource: the "sub-resource" to request (e.g. "acl") or NULL for none * @param query: the query string to send (not including th initial '?'), * or NULL for none * @param read_func: the callback for reading data * Will use s3_empty_read_func if NULL is passed in. * @param read_reset_func: the callback for to reset reading data * @param size_func: the callback to get the number of bytes to upload * @param md5_func: the callback to get the MD5 hash of the data to upload * @param read_data: pointer to pass to the above functions * @param write_func: the callback for writing data. * Will use s3_counter_write_func if NULL is passed in. * @param write_reset_func: the callback for to reset writing data * @param write_data: pointer to pass to C{write_func} * @param progress_func: the callback for progress information * @param progress_data: pointer to pass to C{progress_func} * @param result_handling: instructions for handling the results; see above. * @returns: the result specified by result_handling; details of the response * are then available in C{hdl->last*} */ static s3_result_t perform_request(S3Handle *hdl, const char *verb, const char *bucket, const char *key, const char *subresource, const char *query, const char *content_type, const char *project_id, s3_read_func read_func, s3_reset_func read_reset_func, s3_size_func size_func, s3_md5_func md5_func, gpointer read_data, s3_write_func write_func, s3_reset_func write_reset_func, gpointer write_data, s3_progress_func progress_func, gpointer progress_data, const result_handling_t *result_handling); /* * a CURLOPT_WRITEFUNCTION to save part of the response in memory and * call an external function if one was provided. */ static size_t s3_internal_write_func(void *ptr, size_t size, size_t nmemb, void * stream); /* * a function to reset to our internal buffer */ static void s3_internal_reset_func(void * stream); /* * a CURLOPT_HEADERFUNCTION to save the ETag header only. */ static size_t s3_internal_header_func(void *ptr, size_t size, size_t nmemb, void * stream); static gboolean compile_regexes(void); static gboolean get_openstack_swift_api_v1_setting(S3Handle *hdl); static gboolean get_openstack_swift_api_v2_setting(S3Handle *hdl); /* * Static function implementations */ static s3_error_code_t s3_error_code_from_name(char *s3_error_name) { int i; if (!s3_error_name) return S3_ERROR_Unknown; /* do a brute-force search through the list, since it's not sorted */ for (i = 0; i < S3_ERROR_END; i++) { if (g_ascii_strcasecmp(s3_error_name, s3_error_code_names[i]) == 0) return i; } return S3_ERROR_Unknown; } static const char * s3_error_name_from_code(s3_error_code_t s3_error_code) { if (s3_error_code >= S3_ERROR_END) s3_error_code = S3_ERROR_Unknown; return s3_error_code_names[s3_error_code]; } gboolean s3_curl_supports_ssl(void) { static int supported = -1; if (supported == -1) { #if defined(CURL_VERSION_SSL) curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); if (info->features & CURL_VERSION_SSL) supported = 1; else supported = 0; #else supported = 0; #endif } return supported; } static gboolean s3_curl_throttling_compat(void) { /* CURLOPT_MAX_SEND_SPEED_LARGE added in 7.15.5 */ #if LIBCURL_VERSION_NUM >= 0x070f05 curl_version_info_data *info; /* check the runtime version too */ info = curl_version_info(CURLVERSION_NOW); return info->version_num >= 0x070f05; #else return FALSE; #endif } static s3_result_t lookup_result(const result_handling_t *result_handling, guint response_code, s3_error_code_t s3_error_code, CURLcode curl_code) { while (result_handling->response_code || result_handling->s3_error_code || result_handling->curl_code) { if ((result_handling->response_code && result_handling->response_code != response_code) || (result_handling->s3_error_code && result_handling->s3_error_code != s3_error_code) || (result_handling->curl_code && result_handling->curl_code != curl_code)) { result_handling++; continue; } return result_handling->result; } /* return the result for the terminator, as the default */ return result_handling->result; } static time_t rfc3339_date( const char *date) { gint year, month, day, hour, minute, seconds; const char *atz; if (strlen(date) < 19) return 1073741824; year = atoi(date); month = atoi(date+5); day = atoi(date+8); hour = atoi(date+11); minute = atoi(date+14); seconds = atoi(date+17); atz = date+19; if (*atz == '.') { /* skip decimal seconds */ atz++; while (*atz >= '0' && *atz <= '9') { atz++; } } #if GLIB_CHECK_VERSION(2,26,0) if (!glib_check_version(2,26,0)) { GTimeZone *tz; GDateTime *dt; time_t a; tz = g_time_zone_new(atz); dt = g_date_time_new(tz, year, month, day, hour, minute, seconds); a = g_date_time_to_unix(dt); g_time_zone_unref(tz); g_date_time_unref(dt); return a; } else #endif { struct tm tm; time_t t; tm.tm_year = year - 1900; tm.tm_mon = month - 1; tm.tm_mday = day; tm.tm_hour = hour; tm.tm_min = minute; tm.tm_sec = seconds; tm.tm_wday = 0; tm.tm_yday = 0; tm.tm_isdst = -1; t = time(NULL); if (*atz == '-' || *atz == '+') { /* numeric timezone */ time_t lt, gt; time_t a; struct tm ltt, gtt; gint Hour = atoi(atz); gint Min = atoi(atz+4); if (Hour < 0) Min = -Min; tm.tm_hour -= Hour; tm.tm_min -= Min; tm.tm_isdst = 0; localtime_r(&t, <t); lt = mktime(<t); gmtime_r(&t, >t); gt = mktime(>t); tm.tm_sec += lt - gt; a = mktime(&tm); return a; } else if (*atz == 'Z' && *(atz+1) == '\0') { /* Z timezone */ time_t lt, gt; time_t a; struct tm ltt, gtt; tm.tm_isdst = 0; localtime_r(&t, <t); lt = mktime(<t); gmtime_r(&t, >t); gt = mktime(>t); tm.tm_sec += lt - gt; a = mktime(&tm); return a; } else { /* named timezone */ int pid; int fd[2]; char buf[101]; time_t a; size_t size; if (pipe(fd) == -1) return 1073741824; pid = fork(); switch (pid) { case -1: close(fd[0]); close(fd[1]); return 1073741824; break; case 0: close(fd[0]); setenv("TZ", atz, 1); tzset(); a = mktime(&tm); g_snprintf(buf, 100, "%d", (int)a); size = write(fd[1], buf, strlen(buf)); close(fd[1]); exit(0); default: close(fd[1]); size = read(fd[0], buf, 100); close(fd[0]); buf[size] = '\0'; waitpid(pid, NULL, 0); break; } return atoi(buf); } } } static gboolean is_non_empty_string(const char *str) { return str && str[0] != '\0'; } static char * build_url( S3Handle *hdl, const char *bucket, const char *key, const char *subresource, const char *query) { GString *url = NULL; char *esc_bucket = NULL, *esc_key = NULL; if ((hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2 || hdl->s3_api == S3_API_OAUTH2) && hdl->x_storage_url) { url = g_string_new(hdl->x_storage_url); g_string_append(url, "/"); } else { /* scheme */ url = g_string_new("http"); if (hdl->use_ssl) g_string_append(url, "s"); g_string_append(url, "://"); /* domain */ if (hdl->use_subdomain && bucket) g_string_append_printf(url, "%s.%s", bucket, hdl->host); else g_string_append_printf(url, "%s", hdl->host); if (hdl->service_path) { g_string_append_printf(url, "%s/", hdl->service_path); } else { g_string_append(url, "/"); } } /* path */ if (!hdl->use_subdomain && bucket) { /* curl_easy_escape addeded in 7.15.4 */ #if LIBCURL_VERSION_NUM >= 0x070f04 curl_version_info_data *info; /* check the runtime version too */ info = curl_version_info(CURLVERSION_NOW); if (info->version_num >= 0x070f04) esc_bucket = curl_easy_escape(hdl->curl, bucket, 0); else esc_bucket = curl_escape(bucket, 0); #else esc_bucket = curl_escape(bucket, 0); #endif if (!esc_bucket) goto cleanup; g_string_append_printf(url, "%s", esc_bucket); if (key) g_string_append(url, "/"); curl_free(esc_bucket); } if (key) { /* curl_easy_escape addeded in 7.15.4 */ #if LIBCURL_VERSION_NUM >= 0x070f04 curl_version_info_data *info; /* check the runtime version too */ info = curl_version_info(CURLVERSION_NOW); if (info->version_num >= 0x070f04) esc_key = curl_easy_escape(hdl->curl, key, 0); else esc_key = curl_escape(key, 0); #else esc_key = curl_escape(key, 0); #endif if (!esc_key) goto cleanup; g_string_append_printf(url, "%s", esc_key); curl_free(esc_key); } if (url->str[strlen(url->str)-1] == '/') { g_string_truncate(url, strlen(url->str)-1); } /* query string */ if (subresource || query || (hdl->s3_api == S3_API_CASTOR && hdl->tenant_name)) g_string_append(url, "?"); if (subresource) g_string_append(url, subresource); if (subresource && query) g_string_append(url, "&"); if (query) g_string_append(url, query); /* add CAStor tenant domain override query arg */ if (hdl->s3_api == S3_API_CASTOR && hdl->tenant_name) { if (subresource || query) { g_string_append(url, "&"); } g_string_append_printf(url, "domain=%s", hdl->tenant_name); } cleanup: return g_string_free(url, FALSE); } static struct curl_slist * authenticate_request(S3Handle *hdl, const char *verb, const char *bucket, const char *key, const char *subresource, const char *md5_hash, const char *content_type, const size_t content_length, const char *project_id) { time_t t; struct tm tmp; char *date = NULL; char *buf = NULL; HMAC_CTX ctx; GByteArray *md = NULL; char *auth_base64 = NULL; struct curl_slist *headers = NULL; char *esc_bucket = NULL, *esc_key = NULL; GString *auth_string = NULL; char *reps = NULL; /* From RFC 2616 */ static const char *wkday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static const char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; /* calculate the date */ t = time(NULL); /* sync clock with amazon s3 */ t = t + hdl->time_offset_with_s3; #ifdef _WIN32 if (!gmtime_s(&tmp, &t)) g_debug("localtime error"); #else if (!gmtime_r(&t, &tmp)) perror("localtime"); #endif date = g_strdup_printf("%s, %02d %s %04d %02d:%02d:%02d GMT", wkday[tmp.tm_wday], tmp.tm_mday, month[tmp.tm_mon], 1900+tmp.tm_year, tmp.tm_hour, tmp.tm_min, tmp.tm_sec); if (hdl->s3_api == S3_API_SWIFT_1) { if (!bucket) { buf = g_strdup_printf("X-Auth-User: %s", hdl->swift_account_id); headers = curl_slist_append(headers, buf); g_free(buf); buf = g_strdup_printf("X-Auth-Key: %s", hdl->swift_access_key); headers = curl_slist_append(headers, buf); g_free(buf); } else { buf = g_strdup_printf("X-Auth-Token: %s", hdl->x_auth_token); headers = curl_slist_append(headers, buf); g_free(buf); } } else if (hdl->s3_api == S3_API_SWIFT_2) { if (bucket) { buf = g_strdup_printf("X-Auth-Token: %s", hdl->x_auth_token); headers = curl_slist_append(headers, buf); g_free(buf); } buf = g_strdup_printf("Accept: %s", "application/xml"); headers = curl_slist_append(headers, buf); g_free(buf); } else if (hdl->s3_api == S3_API_OAUTH2) { if (bucket) { buf = g_strdup_printf("Authorization: Bearer %s", hdl->access_token); headers = curl_slist_append(headers, buf); g_free(buf); } } else if (hdl->s3_api == S3_API_CASTOR) { if (g_str_equal(verb, "PUT") || g_str_equal(verb, "POST")) { if (key) { buf = g_strdup("CAStor-Application: Amanda"); headers = curl_slist_append(headers, buf); g_free(buf); reps = g_strdup(hdl->reps); /* object replication level */ } else { reps = g_strdup(hdl->reps_bucket); /* bucket replication level */ } /* set object replicas in lifepoint */ buf = g_strdup_printf("lifepoint: [] reps=%s", reps); headers = curl_slist_append(headers, buf); g_free(buf); g_free(reps); } } else { /* Build the string to sign, per the S3 spec. * See: "Authenticating REST Requests" - API Version 2006-03-01 pg 58 */ /* verb */ auth_string = g_string_new(verb); g_string_append(auth_string, "\n"); /* Content-MD5 header */ if (md5_hash) g_string_append(auth_string, md5_hash); g_string_append(auth_string, "\n"); if (content_type) { g_string_append(auth_string, content_type); } g_string_append(auth_string, "\n"); /* Date */ g_string_append(auth_string, date); g_string_append(auth_string, "\n"); /* CanonicalizedAmzHeaders, sorted lexicographically */ if (is_non_empty_string(hdl->user_token)) { g_string_append(auth_string, AMAZON_SECURITY_HEADER); g_string_append(auth_string, ":"); g_string_append(auth_string, hdl->user_token); g_string_append(auth_string, ","); g_string_append(auth_string, STS_PRODUCT_TOKEN); g_string_append(auth_string, "\n"); } if (g_str_equal(verb,"PUT") && is_non_empty_string(hdl->server_side_encryption)) { g_string_append(auth_string, AMAZON_SERVER_SIDE_ENCRYPTION_HEADER); g_string_append(auth_string, ":"); g_string_append(auth_string, hdl->server_side_encryption); g_string_append(auth_string, "\n"); } if (hdl->s3_api == S3_API_S3 && is_non_empty_string(hdl->storage_class)) { g_string_append(auth_string, AMAZON_STORAGE_CLASS_HEADER); g_string_append(auth_string, ":"); g_string_append(auth_string, hdl->storage_class); g_string_append(auth_string, "\n"); } /* CanonicalizedResource */ if (hdl->service_path) { g_string_append(auth_string, hdl->service_path); } g_string_append(auth_string, "/"); if (bucket) { if (hdl->use_subdomain) g_string_append(auth_string, bucket); else { esc_bucket = curl_escape(bucket, 0); if (!esc_bucket) goto cleanup; g_string_append(auth_string, esc_bucket); } } if (bucket && (hdl->use_subdomain || key)) g_string_append(auth_string, "/"); if (key) { esc_key = curl_escape(key, 0); if (!esc_key) goto cleanup; g_string_append(auth_string, esc_key); } if (subresource) { g_string_append(auth_string, "?"); g_string_append(auth_string, subresource); } /* run HMAC-SHA1 on the canonicalized string */ md = g_byte_array_sized_new(EVP_MAX_MD_SIZE+1); HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, hdl->secret_key, (int) strlen(hdl->secret_key), EVP_sha1(), NULL); HMAC_Update(&ctx, (unsigned char*) auth_string->str, auth_string->len); HMAC_Final(&ctx, md->data, &md->len); HMAC_CTX_cleanup(&ctx); auth_base64 = s3_base64_encode(md); /* append the new headers */ if (is_non_empty_string(hdl->user_token)) { /* Devpay headers are included in hash. */ buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", hdl->user_token); headers = curl_slist_append(headers, buf); g_free(buf); buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", STS_PRODUCT_TOKEN); headers = curl_slist_append(headers, buf); g_free(buf); } if (g_str_equal(verb,"PUT") && is_non_empty_string(hdl->server_side_encryption)) { buf = g_strdup_printf(AMAZON_SERVER_SIDE_ENCRYPTION_HEADER ": %s", hdl->server_side_encryption); headers = curl_slist_append(headers, buf); g_free(buf); } if (hdl->s3_api == S3_API_S3 && is_non_empty_string(hdl->storage_class)) { buf = g_strdup_printf(AMAZON_STORAGE_CLASS_HEADER ": %s", hdl->storage_class); headers = curl_slist_append(headers, buf); g_free(buf); } buf = g_strdup_printf("Authorization: AWS %s:%s", hdl->access_key, auth_base64); headers = curl_slist_append(headers, buf); g_free(buf); } if (md5_hash && '\0' != md5_hash[0]) { buf = g_strdup_printf("Content-MD5: %s", md5_hash); headers = curl_slist_append(headers, buf); g_free(buf); } if (content_length > 0) { buf = g_strdup_printf("Content-Length: %zu", content_length); headers = curl_slist_append(headers, buf); g_free(buf); } if (content_type) { buf = g_strdup_printf("Content-Type: %s", content_type); headers = curl_slist_append(headers, buf); g_free(buf); } if (hdl->s3_api == S3_API_OAUTH2) { buf = g_strdup_printf("x-goog-api-version: 2"); headers = curl_slist_append(headers, buf); g_free(buf); } if (project_id && hdl->s3_api == S3_API_OAUTH2) { buf = g_strdup_printf("x-goog-project-id: %s", project_id); headers = curl_slist_append(headers, buf); g_free(buf); } buf = g_strdup_printf("Date: %s", date); headers = curl_slist_append(headers, buf); g_free(buf); cleanup: g_free(date); g_free(esc_bucket); g_free(esc_key); if (md) g_byte_array_free(md, TRUE); g_free(auth_base64); if (auth_string) g_string_free(auth_string, TRUE); return headers; } /* Functions for a SAX parser to parse the XML failure from Amazon */ /* Private structure for our "thunk", which tracks where the user is in the list * * of keys. */ struct failure_thunk { gboolean want_text; gboolean in_title; gboolean in_body; gboolean in_code; gboolean in_message; gboolean in_details; gboolean in_access; gboolean in_token; gboolean in_serviceCatalog; gboolean in_service; gboolean in_endpoint; gint in_others; gchar *text; gsize text_len; gchar *message; gchar *details; gchar *error_name; gchar *token_id; gchar *service_type; gchar *service_public_url; gint64 expires; }; static void failure_start_element(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error G_GNUC_UNUSED) { struct failure_thunk *thunk = (struct failure_thunk *)user_data; const gchar **att_name, **att_value; if (g_ascii_strcasecmp(element_name, "title") == 0) { thunk->in_title = 1; thunk->in_others = 0; thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "body") == 0) { thunk->in_body = 1; thunk->in_others = 0; thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "code") == 0) { thunk->in_code = 1; thunk->in_others = 0; thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "message") == 0) { thunk->in_message = 1; thunk->in_others = 0; thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "details") == 0) { thunk->in_details = 1; thunk->in_others = 0; thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "access") == 0) { thunk->in_access = 1; thunk->in_others = 0; } else if (g_ascii_strcasecmp(element_name, "token") == 0) { thunk->in_token = 1; thunk->in_others = 0; for (att_name=attribute_names, att_value=attribute_values; *att_name != NULL; att_name++, att_value++) { if (g_str_equal(*att_name, "id")) { thunk->token_id = g_strdup(*att_value); } if (g_str_equal(*att_name, "expires") && strlen(*att_value) >= 19) { thunk->expires = rfc3339_date(*att_value) - 600; } } } else if (g_ascii_strcasecmp(element_name, "serviceCatalog") == 0) { thunk->in_serviceCatalog = 1; thunk->in_others = 0; } else if (g_ascii_strcasecmp(element_name, "service") == 0) { thunk->in_service = 1; thunk->in_others = 0; for (att_name=attribute_names, att_value=attribute_values; *att_name != NULL; att_name++, att_value++) { if (g_str_equal(*att_name, "type")) { thunk->service_type = g_strdup(*att_value); } } } else if (g_ascii_strcasecmp(element_name, "endpoint") == 0) { thunk->in_endpoint = 1; thunk->in_others = 0; if (thunk->service_type && g_str_equal(thunk->service_type, "object-store")) { for (att_name=attribute_names, att_value=attribute_values; *att_name != NULL; att_name++, att_value++) { if (g_str_equal(*att_name, "publicURL")) { thunk->service_public_url = g_strdup(*att_value); } } } } else if (g_ascii_strcasecmp(element_name, "error") == 0) { for (att_name=attribute_names, att_value=attribute_values; *att_name != NULL; att_name++, att_value++) { if (g_str_equal(*att_name, "message")) { thunk->message = g_strdup(*att_value); } } } else { thunk->in_others++; } } static void failure_end_element(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *element_name, gpointer user_data, GError **error G_GNUC_UNUSED) { struct failure_thunk *thunk = (struct failure_thunk *)user_data; if (g_ascii_strcasecmp(element_name, "title") == 0) { char *p = strchr(thunk->text, ' '); if (p) { p++; if (*p) { thunk->error_name = g_strdup(p); } } g_free(thunk->text); thunk->text = NULL; thunk->in_title = 0; } else if (g_ascii_strcasecmp(element_name, "body") == 0) { thunk->message = thunk->text; g_strstrip(thunk->message); thunk->text = NULL; thunk->in_body = 0; } else if (g_ascii_strcasecmp(element_name, "code") == 0) { thunk->error_name = thunk->text; thunk->text = NULL; thunk->in_code = 0; } else if (g_ascii_strcasecmp(element_name, "message") == 0) { thunk->message = thunk->text; thunk->text = NULL; thunk->in_message = 0; } else if (g_ascii_strcasecmp(element_name, "details") == 0) { thunk->details = thunk->text; thunk->text = NULL; thunk->in_details = 0; } else if (g_ascii_strcasecmp(element_name, "access") == 0) { thunk->message = thunk->text; thunk->text = NULL; thunk->in_access = 0; } else if (g_ascii_strcasecmp(element_name, "token") == 0) { thunk->message = thunk->text; thunk->text = NULL; thunk->in_token = 0; } else if (g_ascii_strcasecmp(element_name, "serviceCatalog") == 0) { thunk->message = thunk->text; thunk->text = NULL; thunk->in_serviceCatalog = 0; } else if (g_ascii_strcasecmp(element_name, "service") == 0) { thunk->message = thunk->text; thunk->text = NULL; g_free(thunk->service_type); thunk->service_type = NULL; thunk->in_service = 0; } else if (g_ascii_strcasecmp(element_name, "endpoint") == 0) { thunk->message = thunk->text; thunk->text = NULL; thunk->in_endpoint = 0; } else { thunk->in_others--; } } static void failure_text(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *text, gsize text_len, gpointer user_data, GError **error G_GNUC_UNUSED) { struct failure_thunk *thunk = (struct failure_thunk *)user_data; if (thunk->want_text && thunk->in_others == 0) { char *new_text; new_text = g_strndup(text, text_len); if (thunk->text) { strappend(thunk->text, new_text); g_free(new_text); } else { thunk->text = new_text; } } } static gboolean interpret_response(S3Handle *hdl, CURLcode curl_code, char *curl_error_buffer, gchar *body, guint body_len, const char *etag, const char *content_md5) { long response_code = 0; gboolean ret = TRUE; struct failure_thunk thunk; GMarkupParseContext *ctxt = NULL; static GMarkupParser parser = { failure_start_element, failure_end_element, failure_text, NULL, NULL }; GError *err = NULL; if (!hdl) return FALSE; if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = NULL; hdl->last_response_code = 0; hdl->last_s3_error_code = 0; hdl->last_curl_code = 0; /* bail out from a CURL error */ if (curl_code != CURLE_OK) { hdl->last_curl_code = curl_code; hdl->last_message = g_strdup_printf("CURL error: %s", curl_error_buffer); return FALSE; } /* CURL seems to think things were OK, so get its response code */ curl_easy_getinfo(hdl->curl, CURLINFO_RESPONSE_CODE, &response_code); hdl->last_response_code = response_code; /* check ETag, if present and not CAStor */ if (etag && content_md5 && 200 == response_code && hdl->s3_api != S3_API_CASTOR) { if (etag && g_ascii_strcasecmp(etag, content_md5)) hdl->last_message = g_strdup("S3 Error: Possible data corruption (ETag returned by Amazon did not match the MD5 hash of the data sent)"); else ret = FALSE; return ret; } /* Now look at the body to try to get the actual Amazon error message. */ /* impose a reasonable limit on body size */ if (body_len > MAX_ERROR_RESPONSE_LEN) { hdl->last_message = g_strdup("S3 Error: Unknown (response body too large to parse)"); return FALSE; } else if (!body || body_len == 0) { if (response_code < 100 || response_code >= 400) { hdl->last_message = g_strdup("S3 Error: Unknown (empty response body)"); return TRUE; /* perhaps a network error; retry the request */ } else { /* 2xx and 3xx codes without body are good result */ hdl->last_s3_error_code = S3_ERROR_None; return FALSE; } } thunk.in_title = FALSE; thunk.in_body = FALSE; thunk.in_code = FALSE; thunk.in_message = FALSE; thunk.in_details = FALSE; thunk.in_access = FALSE; thunk.in_token = FALSE; thunk.in_serviceCatalog = FALSE; thunk.in_service = FALSE; thunk.in_endpoint = FALSE; thunk.in_others = 0; thunk.text = NULL; thunk.want_text = FALSE; thunk.text_len = 0; thunk.message = NULL; thunk.details = NULL; thunk.error_name = NULL; thunk.token_id = NULL; thunk.service_type = NULL; thunk.service_public_url = NULL; thunk.expires = 0; if ((hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2) && hdl->content_type && (g_str_equal(hdl->content_type, "text/html") || g_str_equal(hdl->content_type, "text/plain"))) { char *body_copy = g_strndup(body, body_len); char *b = body_copy; char *p = strchr(b, '\n'); char *p1; if (p) { /* first line: error code */ *p = '\0'; p++; p1 = strchr(b, ' '); if (p1) { p1++; if (*p1) { thunk.error_name = g_strdup(p1); } } b = p; } p = strchr(b, '\n'); if (p) { /* second line: error message */ *p = '\0'; p++; thunk.message = g_strdup(p); g_strstrip(thunk.message); b = p; } goto parsing_done; } else if ((hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2) && hdl->content_type && g_str_equal(hdl->content_type, "application/json")) { char *body_copy = g_strndup(body, body_len); char *code = NULL; char *details = NULL; regmatch_t pmatch[2]; if (!s3_regexec_wrap(&code_regex, body_copy, 2, pmatch, 0)) { code = find_regex_substring(body_copy, pmatch[1]); } if (!s3_regexec_wrap(&details_regex, body_copy, 2, pmatch, 0)) { details = find_regex_substring(body_copy, pmatch[1]); } if (code && details) { hdl->last_message = g_strdup_printf("%s (%s)", details, code); } else if (code) { hdl->last_message = g_strdup_printf("(%s)", code); } else if (details) { hdl->last_message = g_strdup_printf("%s", details); } else { hdl->last_message = NULL; } g_free(code); g_free(details); g_free(body_copy); return FALSE; } else if (hdl->s3_api == S3_API_CASTOR) { /* The error mesage is the body */ hdl->last_message = g_strndup(body, body_len); return FALSE; } else if (!hdl->content_type || !g_str_equal(hdl->content_type, "application/xml")) { return FALSE; } /* run the parser over it */ ctxt = g_markup_parse_context_new(&parser, 0, (gpointer)&thunk, NULL); if (!g_markup_parse_context_parse(ctxt, body, body_len, &err)) { if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = g_strdup(err->message); goto cleanup; } if (!g_markup_parse_context_end_parse(ctxt, &err)) { if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = g_strdup(err->message); goto cleanup; } g_markup_parse_context_free(ctxt); ctxt = NULL; if (hdl->s3_api == S3_API_SWIFT_2) { if (!hdl->x_auth_token && thunk.token_id) { hdl->x_auth_token = thunk.token_id; thunk.token_id = NULL; } if (!hdl->x_storage_url && thunk.service_public_url) { hdl->x_storage_url = thunk.service_public_url; thunk.service_public_url = NULL; } } if (thunk.expires > 0) { hdl->expires = thunk.expires; } parsing_done: if (thunk.error_name) { hdl->last_s3_error_code = s3_error_code_from_name(thunk.error_name); g_free(thunk.error_name); thunk.error_name = NULL; } if (thunk.message) { g_free(hdl->last_message); if (thunk.details) { hdl->last_message = g_strdup_printf("%s: %s", thunk.message, thunk.details); amfree(thunk.message); amfree(thunk.details); } else { hdl->last_message = thunk.message; thunk.message = NULL; /* steal the reference to the string */ } } cleanup: g_free(thunk.text); g_free(thunk.message); g_free(thunk.error_name); g_free(thunk.token_id); g_free(thunk.service_public_url); g_free(thunk.service_type); return FALSE; } /* a CURLOPT_READFUNCTION to read data from a buffer. */ size_t s3_buffer_read_func(void *ptr, size_t size, size_t nmemb, void * stream) { CurlBuffer *data = stream; guint bytes_desired = (guint) size * nmemb; /* check the number of bytes remaining, just to be safe */ if (bytes_desired > data->buffer_len - data->buffer_pos) bytes_desired = data->buffer_len - data->buffer_pos; memcpy((char *)ptr, data->buffer + data->buffer_pos, bytes_desired); data->buffer_pos += bytes_desired; return bytes_desired; } size_t s3_buffer_size_func(void *stream) { CurlBuffer *data = stream; return data->buffer_len; } GByteArray* s3_buffer_md5_func(void *stream) { CurlBuffer *data = stream; GByteArray req_body_gba = {(guint8 *)data->buffer, data->buffer_len}; return s3_compute_md5_hash(&req_body_gba); } void s3_buffer_reset_func(void *stream) { CurlBuffer *data = stream; data->buffer_pos = 0; } /* a CURLOPT_WRITEFUNCTION to write data to a buffer. */ size_t s3_buffer_write_func(void *ptr, size_t size, size_t nmemb, void *stream) { CurlBuffer * data = stream; guint new_bytes = (guint) size * nmemb; guint bytes_needed = data->buffer_pos + new_bytes; /* error out if the new size is greater than the maximum allowed */ if (data->max_buffer_size && bytes_needed > data->max_buffer_size) return 0; /* reallocate if necessary. We use exponential sizing to make this * happen less often. */ if (bytes_needed > data->buffer_len) { guint new_size = MAX(bytes_needed, data->buffer_len * 2); if (data->max_buffer_size) { new_size = MIN(new_size, data->max_buffer_size); } data->buffer = g_realloc(data->buffer, new_size); data->buffer_len = new_size; } if (!data->buffer) return 0; /* returning zero signals an error to libcurl */ /* actually copy the data to the buffer */ memcpy(data->buffer + data->buffer_pos, ptr, new_bytes); data->buffer_pos += new_bytes; /* signal success to curl */ return new_bytes; } /* a CURLOPT_READFUNCTION that writes nothing. */ size_t s3_empty_read_func(G_GNUC_UNUSED void *ptr, G_GNUC_UNUSED size_t size, G_GNUC_UNUSED size_t nmemb, G_GNUC_UNUSED void * stream) { return 0; } size_t s3_empty_size_func(G_GNUC_UNUSED void *stream) { return 0; } GByteArray* s3_empty_md5_func(G_GNUC_UNUSED void *stream) { static const GByteArray empty = {(guint8 *) "", 0}; return s3_compute_md5_hash(&empty); } /* a CURLOPT_WRITEFUNCTION to write data that just counts data. * s3_write_data should be NULL or a pointer to an gint64. */ size_t s3_counter_write_func(G_GNUC_UNUSED void *ptr, size_t size, size_t nmemb, void *stream) { gint64 *count = (gint64*) stream, inc = nmemb*size; if (count) *count += inc; return inc; } void s3_counter_reset_func(void *stream) { gint64 *count = (gint64*) stream; if (count) *count = 0; } #ifdef _WIN32 /* a CURLOPT_READFUNCTION to read data from a file. */ size_t s3_file_read_func(void *ptr, size_t size, size_t nmemb, void * stream) { HANDLE *hFile = (HANDLE *) stream; DWORD bytes_read; ReadFile(hFile, ptr, (DWORD) size*nmemb, &bytes_read, NULL); return bytes_read; } size_t s3_file_size_func(void *stream) { HANDLE *hFile = (HANDLE *) stream; DWORD size = GetFileSize(hFile, NULL); if (INVALID_FILE_SIZE == size) { return -1; } else { return size; } } GByteArray* s3_file_md5_func(void *stream) { #define S3_MD5_BUF_SIZE (10*1024) HANDLE *hFile = (HANDLE *) stream; guint8 buf[S3_MD5_BUF_SIZE]; DWORD bytes_read; MD5_CTX md5_ctx; GByteArray *ret = NULL; g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); ret = g_byte_array_sized_new(S3_MD5_HASH_BYTE_LEN); g_byte_array_set_size(ret, S3_MD5_HASH_BYTE_LEN); MD5_Init(&md5_ctx); while (ReadFile(hFile, buf, S3_MD5_BUF_SIZE, &bytes_read, NULL)) { MD5_Update(&md5_ctx, buf, bytes_read); } MD5_Final(ret->data, &md5_ctx); g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); return ret; #undef S3_MD5_BUF_SIZE } GByteArray* s3_file_reset_func(void *stream) { g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); } /* a CURLOPT_WRITEFUNCTION to write data to a file. */ size_t s3_file_write_func(void *ptr, size_t size, size_t nmemb, void *stream) { HANDLE *hFile = (HANDLE *) stream; DWORD bytes_written; WriteFile(hFile, ptr, (DWORD) size*nmemb, &bytes_written, NULL); return bytes_written; } #endif static int curl_debug_message(CURL *curl G_GNUC_UNUSED, curl_infotype type, char *s, size_t len, void *unused G_GNUC_UNUSED) { char *lineprefix; char *message; char **lines, **line; size_t i; switch (type) { case CURLINFO_TEXT: lineprefix=""; break; case CURLINFO_HEADER_IN: lineprefix="Hdr In: "; break; case CURLINFO_HEADER_OUT: lineprefix="Hdr Out: "; break; case CURLINFO_DATA_IN: if (len > 3000) return 0; for (i=0;i 3000) return 0; for (i=0;icurl != NULL); if (hdl->s3_api == S3_API_OAUTH2 && !hdl->getting_oauth2_access_token && (!hdl->access_token || hdl->expires < time(NULL))) { result = oauth2_get_access_token(hdl); if (!result) { g_debug("oauth2_get_access_token returned %d", result); return result; } } else if (hdl->s3_api == S3_API_SWIFT_2 && !hdl->getting_swift_2_token && (!hdl->x_auth_token || hdl->expires < time(NULL))) { result = get_openstack_swift_api_v2_setting(hdl); if (!result) { g_debug("get_openstack_swift_api_v2_setting returned %d", result); return result; } } s3_reset(hdl); url = build_url(hdl, bucket, key, subresource, query); if (!url) goto cleanup; /* libcurl may behave strangely if these are not set correctly */ if (!strncmp(verb, "PUT", 4)) { curlopt_upload = 1; } else if (!strncmp(verb, "GET", 4)) { curlopt_httpget = 1; } else if (!strncmp(verb, "POST", 5)) { curlopt_post = 1; } else if (!strncmp(verb, "HEAD", 5)) { curlopt_nobody = 1; } else { curlopt_customrequest = verb; } if (size_func) { request_body_size = size_func(read_data); } if (md5_func) { md5_hash = md5_func(read_data); if (md5_hash) { md5_hash_b64 = s3_base64_encode(md5_hash); md5_hash_hex = s3_hex_encode(md5_hash); g_byte_array_free(md5_hash, TRUE); } } if (!read_func) { /* Curl will use fread() otherwise */ read_func = s3_empty_read_func; } if (write_func) { int_writedata.write_func = write_func; int_writedata.reset_func = write_reset_func; int_writedata.write_data = write_data; } else { /* Curl will use fwrite() otherwise */ int_writedata.write_func = s3_counter_write_func; int_writedata.reset_func = s3_counter_reset_func; int_writedata.write_data = NULL; } while (1) { /* reset things */ if (headers) { curl_slist_free_all(headers); } curl_error_buffer[0] = '\0'; if (read_reset_func) { read_reset_func(read_data); } /* calls write_reset_func */ s3_internal_reset_func(&int_writedata); /* set up the request */ headers = authenticate_request(hdl, verb, bucket, key, subresource, md5_hash_b64, content_type, request_body_size, project_id); if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOSIGNAL, TRUE))) goto curl_error; if (hdl->ca_info) { if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CAINFO, hdl->ca_info))) goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_VERBOSE, hdl->verbose))) goto curl_error; if (hdl->verbose) { if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_DEBUGFUNCTION, curl_debug_message))) goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_ERRORBUFFER, curl_error_buffer))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOPROGRESS, 1))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_FOLLOWLOCATION, 1))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_URL, url))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPHEADER, headers))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEFUNCTION, s3_internal_write_func))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEDATA, &int_writedata))) goto curl_error; /* Note: we always have to set this apparently, for consistent "end of header" detection */ if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HEADERFUNCTION, s3_internal_header_func))) goto curl_error; /* Note: if set, CURLOPT_HEADERDATA seems to also be used for CURLOPT_WRITEDATA ? */ if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HEADERDATA, &int_writedata))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_PROGRESSFUNCTION, progress_func))) goto curl_error; if (progress_func) { if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOPROGRESS,0))) goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_PROGRESSDATA, progress_data))) goto curl_error; /* CURLOPT_INFILESIZE_LARGE added in 7.11.0 */ #if LIBCURL_VERSION_NUM >= 0x070b00 if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)request_body_size))) goto curl_error; #else if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE, (long)request_body_size))) goto curl_error; #endif /* CURLOPT_POSTFIELDSIZE_LARGE added in 7.11.1 */ #if LIBCURL_VERSION_NUM >= 0x070b01 if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)request_body_size))) goto curl_error; #else if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POSTFIELDSIZE, (long)request_body_size))) goto curl_error; #endif /* CURLOPT_MAX_{RECV,SEND}_SPEED_LARGE added in 7.15.5 */ #if LIBCURL_VERSION_NUM >= 0x070f05 if (s3_curl_throttling_compat()) { if (hdl->max_send_speed) if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)hdl->max_send_speed))) goto curl_error; if (hdl->max_recv_speed) if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)hdl->max_recv_speed))) goto curl_error; } #endif if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPGET, curlopt_httpget))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, curlopt_upload))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POST, curlopt_post))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOBODY, curlopt_nobody))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST, curlopt_customrequest))) goto curl_error; if (curlopt_upload || curlopt_post) { if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, read_func))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, read_data))) goto curl_error; } else { /* Clear request_body options. */ if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, NULL))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, NULL))) goto curl_error; } if (hdl->proxy) { if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_PROXY, hdl->proxy))) goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_FRESH_CONNECT, (long)(hdl->reuse_connection && retry_after_close == 0 ? 0 : 1)))) { goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_FORBID_REUSE, (long)(hdl->reuse_connection? 0 : 1)))) { goto curl_error; } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_TIMEOUT, (long)hdl->timeout))) { goto curl_error; } /* Perform the request */ curl_code = curl_easy_perform(hdl->curl); /* interpret the response into hdl->last* */ curl_error: /* (label for short-circuiting the curl_easy_perform call) */ should_retry = interpret_response(hdl, curl_code, curl_error_buffer, int_writedata.resp_buf.buffer, int_writedata.resp_buf.buffer_pos, int_writedata.etag, md5_hash_hex); if (hdl->s3_api == S3_API_OAUTH2 && hdl->last_response_code == 401 && hdl->last_s3_error_code == S3_ERROR_AuthenticationRequired) { should_retry = oauth2_get_access_token(hdl); } /* and, unless we know we need to retry, see what we're to do now */ if (!should_retry) { result = lookup_result(result_handling, hdl->last_response_code, hdl->last_s3_error_code, hdl->last_curl_code); /* break out of the while(1) unless we're retrying */ if (result != S3_RESULT_RETRY) break; } if (retries >= EXPONENTIAL_BACKOFF_MAX_RETRIES && retry_after_close < 3 && hdl->last_s3_error_code == S3_ERROR_RequestTimeout) { retries = -1; retry_after_close++; g_debug("Retry on a new connection"); } if (retries >= EXPONENTIAL_BACKOFF_MAX_RETRIES) { /* we're out of retries, so annotate hdl->last_message appropriately and bail * out. */ char *m = g_strdup_printf("Too many retries; last message was '%s'", hdl->last_message); if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = m; result = S3_RESULT_FAIL; break; } g_usleep(backoff); retries++; backoff *= EXPONENTIAL_BACKOFF_BASE; } if (result != S3_RESULT_OK) { g_debug(_("%s %s failed with %d/%s"), verb, url, hdl->last_response_code, s3_error_name_from_code(hdl->last_s3_error_code)); } cleanup: g_free(url); if (headers) curl_slist_free_all(headers); g_free(md5_hash_b64); g_free(md5_hash_hex); g_free(int_writedata.etag); /* we don't deallocate the response body -- we keep it for later */ hdl->last_response_body = int_writedata.resp_buf.buffer; hdl->last_response_body_size = int_writedata.resp_buf.buffer_pos; hdl->last_num_retries = retries; return result; } static size_t s3_internal_write_func(void *ptr, size_t size, size_t nmemb, void * stream) { S3InternalData *data = (S3InternalData *) stream; size_t bytes_saved; if (!data->headers_done) return size*nmemb; /* call write on internal buffer (if not full) */ if (data->int_write_done) { bytes_saved = 0; } else { bytes_saved = s3_buffer_write_func(ptr, size, nmemb, &data->resp_buf); if (!bytes_saved) { data->int_write_done = TRUE; } } /* call write on user buffer */ if (data->write_func) { return data->write_func(ptr, size, nmemb, data->write_data); } else { return bytes_saved; } } static void s3_internal_reset_func(void * stream) { S3InternalData *data = (S3InternalData *) stream; s3_buffer_reset_func(&data->resp_buf); data->headers_done = FALSE; data->int_write_done = FALSE; data->etag = NULL; if (data->reset_func) { data->reset_func(data->write_data); } } static size_t s3_internal_header_func(void *ptr, size_t size, size_t nmemb, void * stream) { static const char *final_header = "\r\n"; time_t remote_time_in_sec,local_time; char *header; regmatch_t pmatch[2]; S3InternalData *data = (S3InternalData *) stream; header = g_strndup((gchar *) ptr, (gsize) size*nmemb); if (header[strlen(header)-1] == '\n') header[strlen(header)-1] = '\0'; if (header[strlen(header)-1] == '\r') header[strlen(header)-1] = '\0'; if (!s3_regexec_wrap(&etag_regex, header, 2, pmatch, 0)) data->etag = find_regex_substring(header, pmatch[1]); if (!s3_regexec_wrap(&x_auth_token_regex, header, 2, pmatch, 0)) data->hdl->x_auth_token = find_regex_substring(header, pmatch[1]); if (!s3_regexec_wrap(&x_storage_url_regex, header, 2, pmatch, 0)) data->hdl->x_storage_url = find_regex_substring(header, pmatch[1]); if (!s3_regexec_wrap(&content_type_regex, header, 2, pmatch, 0)) data->hdl->content_type = find_regex_substring(header, pmatch[1]); if (strlen(header) == 0) data->headers_done = TRUE; if (g_str_equal(final_header, header)) data->headers_done = TRUE; if (g_str_equal("\n", header)) data->headers_done = TRUE; /* If date header is found */ if (!s3_regexec_wrap(&date_sync_regex, header, 2, pmatch, 0)){ char *date = find_regex_substring(header, pmatch[1]); /* Remote time is always in GMT: RFC 2616 */ /* both curl_getdate and time operate in UTC, so no timezone math is necessary */ if ( (remote_time_in_sec = curl_getdate(date, NULL)) < 0 ){ g_debug("Error: Conversion of remote time to seconds failed."); data->hdl->time_offset_with_s3 = 0; }else{ local_time = time(NULL); /* Offset time */ data->hdl->time_offset_with_s3 = remote_time_in_sec - local_time; if (data->hdl->verbose) g_debug("Time Offset (remote - local) :%ld",(long)data->hdl->time_offset_with_s3); } g_free(date); } g_free(header); return size*nmemb; } static gboolean compile_regexes(void) { #ifdef HAVE_REGEX_H /* using POSIX regular expressions */ struct {const char * str; int flags; regex_t *regex;} regexes[] = { {"[[:space:]]*([^<]*)[[:space:]]*", REG_EXTENDED | REG_ICASE, &error_name_regex}, {"^ETag:[[:space:]]*\"([^\"]+)\"[[:space:]]*$", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &etag_regex}, {"^X-Auth-Token:[[:space:]]*([^ ]+)[[:space:]]*$", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &x_auth_token_regex}, {"^X-Storage-Url:[[:space:]]*([^ ]+)[[:space:]]*$", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &x_storage_url_regex}, {"^Content-Type:[[:space:]]*([^ ;]+).*$", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &content_type_regex}, {"[[:space:]]*([^<]*)[[:space:]]*", REG_EXTENDED | REG_ICASE, &message_regex}, {"^[a-z0-9](-*[a-z0-9]){2,62}$", REG_EXTENDED | REG_NOSUB, &subdomain_regex}, {"(/>)|(>([^<]*))", REG_EXTENDED | REG_ICASE, &location_con_regex}, {"^Date:(.*)$",REG_EXTENDED | REG_ICASE | REG_NEWLINE, &date_sync_regex}, {"\"access_token\" : \"([^\"]*)\",", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &access_token_regex}, {"\"expires_in\" : (.*)", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &expires_in_regex}, {"\"details\": \"([^\"]*)\",", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &details_regex}, {"\"code\": (.*),", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &code_regex}, {NULL, 0, NULL} }; char regmessage[1024]; int i; int reg_result; for (i = 0; regexes[i].str; i++) { reg_result = regcomp(regexes[i].regex, regexes[i].str, regexes[i].flags); if (reg_result != 0) { regerror(reg_result, regexes[i].regex, regmessage, sizeof(regmessage)); g_error(_("Regex error: %s"), regmessage); return FALSE; } } #else /* ! HAVE_REGEX_H */ /* using PCRE via GLib */ struct {const char * str; int flags; regex_t *regex;} regexes[] = { {"\\s*([^<]*)\\s*", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &error_name_regex}, {"^ETag:\\s*\"([^\"]+)\"\\s*$", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &etag_regex}, {"^X-Auth-Token:\\s*([^ ]+)\\s*$", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &x_auth_token_regex}, {"^X-Storage-Url:\\s*([^ ]+)\\s*$", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &x_storage_url_regex}, {"^Content-Type:\\s*([^ ]+)\\s*$", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &content_type_regex}, {"\\s*([^<]*)\\s*", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &message_regex}, {"^[a-z0-9]((-*[a-z0-9])|(\\.[a-z0-9])){2,62}$", G_REGEX_OPTIMIZE | G_REGEX_NO_AUTO_CAPTURE, &subdomain_regex}, {"(/>)|(>([^<]*))", G_REGEX_CASELESS, &location_con_regex}, {"^Date:(.*)$", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &date_sync_regex}, {"\"access_token\" : \"([^\"]*)\"", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &access_token_regex}, {"\"expires_n\" : (.*)", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &expires_in_regex}, {"\"details\" : \"([^\"]*)\"", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &details_regex}, {"\"code\" : (.*)", G_REGEX_OPTIMIZE | G_REGEX_CASELESS, &code_regex}, {NULL, 0, NULL} }; int i; GError *err = NULL; for (i = 0; regexes[i].str; i++) { *(regexes[i].regex) = g_regex_new(regexes[i].str, regexes[i].flags, 0, &err); if (err) { g_error(_("Regex error: %s"), err->message); g_error_free(err); return FALSE; } } #endif return TRUE; } /* * Public function implementations */ #if (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 31)) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif gboolean s3_init(void) { static GStaticMutex mutex = G_STATIC_MUTEX_INIT; static gboolean init = FALSE, ret; /* n.b. curl_global_init is called in common-src/glib-util.c:glib_init() */ g_static_mutex_lock (&mutex); if (!init) { ret = compile_regexes(); init = TRUE; } g_static_mutex_unlock(&mutex); return ret; } #if (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 31)) # pragma GCC diagnostic pop #endif gboolean s3_curl_location_compat(void) { curl_version_info_data *info; info = curl_version_info(CURLVERSION_NOW); return info->version_num > 0x070a02; } gboolean s3_bucket_location_compat(const char *bucket) { return !s3_regexec_wrap(&subdomain_regex, bucket, 0, NULL, 0); } static gboolean get_openstack_swift_api_v1_setting( S3Handle *hdl) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; s3_verbose(hdl, 1); result = perform_request(hdl, "GET", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, result_handling); return result == S3_RESULT_OK; } static gboolean get_openstack_swift_api_v2_setting( S3Handle *hdl) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; CurlBuffer buf = {NULL, 0, 0, 0}; GString *body = g_string_new(""); if (hdl->username && hdl->password) { g_string_append_printf(body, "tenant_id) { g_string_append_printf(body, " tenantId=\"%s\"", hdl->tenant_id); } if (hdl->tenant_name) { g_string_append_printf(body, " tenantName=\"%s\"", hdl->tenant_name); } g_string_append(body, ">"); if (hdl->username && hdl->password) { g_string_append_printf(body, "", hdl->username, hdl->password); } else { g_string_append_printf(body, "", hdl->access_key, hdl->secret_key); } g_string_append(body, ""); buf.buffer = g_string_free(body, FALSE); buf.buffer_len = strlen(buf.buffer); s3_verbose(hdl, 1); hdl->getting_swift_2_token = 1; g_free(hdl->x_storage_url); hdl->x_storage_url = NULL; result = perform_request(hdl, "POST", NULL, NULL, NULL, NULL, "application/xml", NULL, S3_BUFFER_READ_FUNCS, &buf, NULL, NULL, NULL, NULL, NULL, result_handling); hdl->getting_swift_2_token = 0; return result == S3_RESULT_OK; } S3Handle * s3_open(const char *access_key, const char *secret_key, const char *swift_account_id, const char *swift_access_key, const char *host, const char *service_path, const gboolean use_subdomain, const char *user_token, const char *bucket_location, const char *storage_class, const char *ca_info, const char *server_side_encryption, const char *proxy, const S3_api s3_api, const char *username, const char *password, const char *tenant_id, const char *tenant_name, const char *client_id, const char *client_secret, const char *refresh_token, const gboolean reuse_connection, const long timeout, const char *reps, const char *reps_bucket) { S3Handle *hdl; hdl = g_new0(S3Handle, 1); if (!hdl) goto error; hdl->verbose = TRUE; hdl->use_ssl = s3_curl_supports_ssl(); hdl->reuse_connection = reuse_connection; hdl->timeout = timeout; if (s3_api == S3_API_S3) { g_assert(access_key); hdl->access_key = g_strdup(access_key); g_assert(secret_key); hdl->secret_key = g_strdup(secret_key); } else if (s3_api == S3_API_SWIFT_1) { g_assert(swift_account_id); hdl->swift_account_id = g_strdup(swift_account_id); g_assert(swift_access_key); hdl->swift_access_key = g_strdup(swift_access_key); } else if (s3_api == S3_API_SWIFT_2) { g_assert((username && password) || (access_key && secret_key)); hdl->username = g_strdup(username); hdl->password = g_strdup(password); hdl->access_key = g_strdup(access_key); hdl->secret_key = g_strdup(secret_key); g_assert(tenant_id || tenant_name); hdl->tenant_id = g_strdup(tenant_id); hdl->tenant_name = g_strdup(tenant_name); } else if (s3_api == S3_API_OAUTH2) { hdl->client_id = g_strdup(client_id); hdl->client_secret = g_strdup(client_secret); hdl->refresh_token = g_strdup(refresh_token); } else if (s3_api == S3_API_CASTOR) { hdl->username = g_strdup(username); hdl->password = g_strdup(password); hdl->tenant_name = g_strdup(tenant_name); hdl->reps = g_strdup(reps); hdl->reps_bucket = g_strdup(reps_bucket); } /* NULL is okay */ hdl->user_token = g_strdup(user_token); /* NULL is okay */ hdl->bucket_location = g_strdup(bucket_location); /* NULL is ok */ hdl->storage_class = g_strdup(storage_class); /* NULL is ok */ hdl->server_side_encryption = g_strdup(server_side_encryption); /* NULL is ok */ hdl->proxy = g_strdup(proxy); /* NULL is okay */ hdl->ca_info = g_strdup(ca_info); if (!is_non_empty_string(host)) host = "s3.amazonaws.com"; hdl->host = g_ascii_strdown(host, -1); hdl->use_subdomain = use_subdomain || (strcmp(hdl->host, "s3.amazonaws.com") == 0 && is_non_empty_string(hdl->bucket_location)); hdl->s3_api = s3_api; if (service_path) { if (strlen(service_path) == 0 || (strlen(service_path) == 1 && service_path[0] == '/')) { hdl->service_path = NULL; } else if (service_path[0] != '/') { hdl->service_path = g_strdup_printf("/%s", service_path); } else { hdl->service_path = g_strdup(service_path); } if (hdl->service_path) { /* remove trailling / */ size_t len = strlen(hdl->service_path) - 1; if (hdl->service_path[len] == '/') hdl->service_path[len] = '\0'; } } else { hdl->service_path = NULL; } hdl->curl = curl_easy_init(); if (!hdl->curl) goto error; /* Set HTTP handling options for CAStor */ if (s3_api == S3_API_CASTOR) { #if LIBCURL_VERSION_NUM >= 0x071301 curl_version_info_data *info; /* check the runtime version too */ info = curl_version_info(CURLVERSION_NOW); if (info->version_num >= 0x071301) { curl_easy_setopt(hdl->curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(hdl->curl, CURLOPT_UNRESTRICTED_AUTH, 1); curl_easy_setopt(hdl->curl, CURLOPT_MAXREDIRS, 5); curl_easy_setopt(hdl->curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); curl_easy_setopt(hdl->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); if (hdl->username) curl_easy_setopt(hdl->curl, CURLOPT_USERNAME, hdl->username); if (hdl->password) curl_easy_setopt(hdl->curl, CURLOPT_PASSWORD, hdl->password); curl_easy_setopt(hdl->curl, CURLOPT_HTTPAUTH, (CURLAUTH_BASIC | CURLAUTH_DIGEST)); } #endif } return hdl; error: s3_free(hdl); return NULL; } gboolean s3_open2( S3Handle *hdl) { gboolean ret = TRUE; /* get the X-Storage-Url and X-Auth-Token */ if (hdl->s3_api == S3_API_SWIFT_1) { ret = get_openstack_swift_api_v1_setting(hdl); } else if (hdl->s3_api == S3_API_SWIFT_2) { ret = get_openstack_swift_api_v2_setting(hdl); } return ret; } void s3_free(S3Handle *hdl) { s3_reset(hdl); if (hdl) { g_free(hdl->access_key); g_free(hdl->secret_key); g_free(hdl->swift_account_id); g_free(hdl->swift_access_key); g_free(hdl->content_type); g_free(hdl->ca_info); g_free(hdl->proxy); g_free(hdl->username); g_free(hdl->password); g_free(hdl->tenant_id); g_free(hdl->tenant_name); g_free(hdl->client_id); g_free(hdl->client_secret); g_free(hdl->refresh_token); g_free(hdl->access_token); if (hdl->user_token) g_free(hdl->user_token); if (hdl->bucket_location) g_free(hdl->bucket_location); if (hdl->storage_class) g_free(hdl->storage_class); if (hdl->server_side_encryption) g_free(hdl->server_side_encryption); if (hdl->host) g_free(hdl->host); if (hdl->service_path) g_free(hdl->service_path); if (hdl->curl) curl_easy_cleanup(hdl->curl); g_free(hdl); } } void s3_reset(S3Handle *hdl) { if (hdl) { /* We don't call curl_easy_reset here, because doing that in curl * < 7.16 blanks the default CA certificate path, and there's no way * to get it back. */ if (hdl->last_message) { g_free(hdl->last_message); hdl->last_message = NULL; } hdl->last_response_code = 0; hdl->last_curl_code = 0; hdl->last_s3_error_code = 0; hdl->last_num_retries = 0; if (hdl->last_response_body) { g_free(hdl->last_response_body); hdl->last_response_body = NULL; } if (hdl->content_type) { g_free(hdl->content_type); hdl->content_type = NULL; } hdl->last_response_body_size = 0; } } void s3_error(S3Handle *hdl, const char **message, guint *response_code, s3_error_code_t *s3_error_code, const char **s3_error_name, CURLcode *curl_code, guint *num_retries) { if (hdl) { if (message) *message = hdl->last_message; if (response_code) *response_code = hdl->last_response_code; if (s3_error_code) *s3_error_code = hdl->last_s3_error_code; if (s3_error_name) *s3_error_name = s3_error_name_from_code(hdl->last_s3_error_code); if (curl_code) *curl_code = hdl->last_curl_code; if (num_retries) *num_retries = hdl->last_num_retries; } else { /* no hdl? return something coherent, anyway */ if (message) *message = "NULL S3Handle"; if (response_code) *response_code = 0; if (s3_error_code) *s3_error_code = 0; if (s3_error_name) *s3_error_name = NULL; if (curl_code) *curl_code = 0; if (num_retries) *num_retries = 0; } } void s3_verbose(S3Handle *hdl, gboolean verbose) { hdl->verbose = verbose; } gboolean s3_set_max_send_speed(S3Handle *hdl, guint64 max_send_speed) { if (!s3_curl_throttling_compat()) return FALSE; hdl->max_send_speed = max_send_speed; return TRUE; } gboolean s3_set_max_recv_speed(S3Handle *hdl, guint64 max_recv_speed) { if (!s3_curl_throttling_compat()) return FALSE; hdl->max_recv_speed = max_recv_speed; return TRUE; } gboolean s3_use_ssl(S3Handle *hdl, gboolean use_ssl) { gboolean ret = TRUE; if (use_ssl & !s3_curl_supports_ssl()) { ret = FALSE; } else { hdl->use_ssl = use_ssl; } return ret; } char * s3_strerror(S3Handle *hdl) { const char *message; guint response_code; const char *s3_error_name; CURLcode curl_code; guint num_retries; char s3_info[256] = ""; char response_info[16] = ""; char curl_info[32] = ""; char retries_info[32] = ""; s3_error(hdl, &message, &response_code, NULL, &s3_error_name, &curl_code, &num_retries); if (!message) message = "Unknown S3 error"; if (s3_error_name) g_snprintf(s3_info, sizeof(s3_info), " (%s)", s3_error_name); if (response_code) g_snprintf(response_info, sizeof(response_info), " (HTTP %d)", response_code); if (curl_code) g_snprintf(curl_info, sizeof(curl_info), " (CURLcode %d)", curl_code); if (num_retries) g_snprintf(retries_info, sizeof(retries_info), " (after %d retries)", num_retries); return g_strdup_printf("%s%s%s%s%s", message, s3_info, curl_info, response_info, retries_info); } /* Perform an upload. When this function returns, KEY and * BUFFER remain the responsibility of the caller. * * @param self: the s3 device * @param bucket: the bucket to which the upload should be made * @param key: the key to which the upload should be made * @param buffer: the data to be uploaded * @param buffer_len: the length of the data to upload * @returns: false if an error ocurred */ gboolean s3_upload(S3Handle *hdl, const char *bucket, const char *key, s3_read_func read_func, s3_reset_func reset_func, s3_size_func size_func, s3_md5_func md5_func, gpointer read_data, s3_progress_func progress_func, gpointer progress_data) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 201, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; char *verb = "PUT"; char *content_type = NULL; g_assert(hdl != NULL); if (hdl->s3_api == S3_API_CASTOR) { verb = "POST"; content_type = "application/x-amanda-backup-data"; } result = perform_request(hdl, verb, bucket, key, NULL, NULL, content_type, NULL, read_func, reset_func, size_func, md5_func, read_data, NULL, NULL, NULL, progress_func, progress_data, result_handling); return result == S3_RESULT_OK; } /* Private structure for our "thunk", which tracks where the user is in the list * of keys. */ struct list_keys_thunk { GSList *filename_list; /* all pending filenames */ gboolean in_contents; /* look for "key" entities in here */ gboolean in_common_prefixes; /* look for "prefix" entities in here */ gboolean is_truncated; gchar *next_marker; guint64 size; gboolean want_text; gchar *text; gsize text_len; }; /* Functions for a SAX parser to parse the XML from Amazon */ static void list_start_element(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *element_name, const gchar **attribute_names G_GNUC_UNUSED, const gchar **attribute_values G_GNUC_UNUSED, gpointer user_data, GError **error G_GNUC_UNUSED) { struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data; thunk->want_text = 0; if (g_ascii_strcasecmp(element_name, "contents") == 0 || g_ascii_strcasecmp(element_name, "object") == 0) { thunk->in_contents = 1; } else if (g_ascii_strcasecmp(element_name, "commonprefixes") == 0) { thunk->in_common_prefixes = 1; } else if (g_ascii_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { thunk->want_text = 1; } else if ((g_ascii_strcasecmp(element_name, "key") == 0 || g_ascii_strcasecmp(element_name, "name") == 0) && thunk->in_contents) { thunk->want_text = 1; } else if ((g_ascii_strcasecmp(element_name, "size") == 0 || g_ascii_strcasecmp(element_name, "bytes") == 0) && thunk->in_contents) { thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "istruncated")) { thunk->want_text = 1; } else if (g_ascii_strcasecmp(element_name, "nextmarker")) { thunk->want_text = 1; } } static void list_end_element(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *element_name, gpointer user_data, GError **error G_GNUC_UNUSED) { struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data; if (g_ascii_strcasecmp(element_name, "contents") == 0) { thunk->in_contents = 0; } else if (g_ascii_strcasecmp(element_name, "commonprefixes") == 0) { thunk->in_common_prefixes = 0; } else if ((g_ascii_strcasecmp(element_name, "key") == 0 || g_ascii_strcasecmp(element_name, "name") == 0) && thunk->in_contents) { thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text); if (thunk->is_truncated) { if (thunk->next_marker) g_free(thunk->next_marker); thunk->next_marker = g_strdup(thunk->text); } thunk->text = NULL; } else if ((g_ascii_strcasecmp(element_name, "size") == 0 || g_ascii_strcasecmp(element_name, "bytes") == 0) && thunk->in_contents) { thunk->size += g_ascii_strtoull (thunk->text, NULL, 10); thunk->text = NULL; } else if (g_ascii_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text); thunk->text = NULL; } else if (g_ascii_strcasecmp(element_name, "istruncated") == 0) { if (thunk->text && g_ascii_strncasecmp(thunk->text, "false", 5) != 0) thunk->is_truncated = TRUE; } else if (g_ascii_strcasecmp(element_name, "nextmarker") == 0) { if (thunk->next_marker) g_free(thunk->next_marker); thunk->next_marker = thunk->text; thunk->text = NULL; } } static void list_text(GMarkupParseContext *context G_GNUC_UNUSED, const gchar *text, gsize text_len, gpointer user_data, GError **error G_GNUC_UNUSED) { struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data; if (thunk->want_text) { if (thunk->text) g_free(thunk->text); thunk->text = g_strndup(text, text_len); } } /* Perform a fetch from S3; several fetches may be involved in a * single listing operation */ static s3_result_t list_fetch(S3Handle *hdl, const char *bucket, const char *prefix, const char *delimiter, const char *marker, const char *max_keys, CurlBuffer *buf) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; const char* pos_parts[][2] = { {"prefix", prefix}, {"delimiter", delimiter}, {"marker", marker}, {"max-keys", max_keys}, {NULL, NULL} }; char *esc_value; GString *query; guint i; gboolean have_prev_part = FALSE; /* loop over possible parts to build query string */ query = g_string_new(""); for (i = 0; pos_parts[i][0]; i++) { if (pos_parts[i][1]) { const char *keyword; if (have_prev_part) g_string_append(query, "&"); else have_prev_part = TRUE; esc_value = curl_escape(pos_parts[i][1], 0); keyword = pos_parts[i][0]; if ((hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2) && strcmp(keyword, "max-keys") == 0) { keyword = "limit"; } else if ((hdl->s3_api == S3_API_CASTOR) && strcmp(keyword, "max-keys") == 0) { keyword = "size"; } g_string_append_printf(query, "%s=%s", keyword, esc_value); curl_free(esc_value); } } if (hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2 || hdl->s3_api == S3_API_CASTOR) { if (have_prev_part) g_string_append(query, "&"); g_string_append(query, "format=xml"); } /* and perform the request on that URI */ result = perform_request(hdl, "GET", bucket, NULL, NULL, query->str, NULL, NULL, NULL, NULL, NULL, NULL, NULL, S3_BUFFER_WRITE_FUNCS, buf, NULL, NULL, result_handling); if (query) g_string_free(query, TRUE); return result; } gboolean s3_list_keys(S3Handle *hdl, const char *bucket, const char *prefix, const char *delimiter, GSList **list, guint64 *total_size) { /* * max len of XML variables: * bucket: 255 bytes (p12 API Version 2006-03-01) * key: 1024 bytes (p15 API Version 2006-03-01) * size per key: 5GB bytes (p6 API Version 2006-03-01) * size of size 10 bytes (i.e. 10 decimal digits) * etag: 44 (observed+assumed) * owner ID: 64 (observed+assumed) * owner DisplayName: 255 (assumed) * StorageClass: const (p18 API Version 2006-03-01) */ static const guint MAX_RESPONSE_LEN = 1000*2000; static const char *MAX_KEYS = "1000"; struct list_keys_thunk thunk; GMarkupParseContext *ctxt = NULL; static GMarkupParser parser = { list_start_element, list_end_element, list_text, NULL, NULL }; GError *err = NULL; s3_result_t result = S3_RESULT_FAIL; CurlBuffer buf = {NULL, 0, 0, MAX_RESPONSE_LEN}; g_assert(list); *list = NULL; thunk.filename_list = NULL; thunk.text = NULL; thunk.next_marker = NULL; thunk.size = 0; /* Loop until S3 has given us the entire picture */ do { s3_buffer_reset_func(&buf); /* get some data from S3 */ result = list_fetch(hdl, bucket, prefix, delimiter, thunk.next_marker, MAX_KEYS, &buf); if (result != S3_RESULT_OK) goto cleanup; if (buf.buffer_pos == 0) goto cleanup; /* no body */ /* run the parser over it */ thunk.in_contents = FALSE; thunk.in_common_prefixes = FALSE; thunk.is_truncated = FALSE; if (thunk.next_marker) g_free(thunk.next_marker); thunk.next_marker = NULL; thunk.want_text = FALSE; ctxt = g_markup_parse_context_new(&parser, 0, (gpointer)&thunk, NULL); if (!g_markup_parse_context_parse(ctxt, buf.buffer, buf.buffer_pos, &err)) { if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = g_strdup(err->message); result = S3_RESULT_FAIL; goto cleanup; } if (!g_markup_parse_context_end_parse(ctxt, &err)) { if (hdl->last_message) g_free(hdl->last_message); hdl->last_message = g_strdup(err->message); result = S3_RESULT_FAIL; goto cleanup; } g_markup_parse_context_free(ctxt); ctxt = NULL; } while (thunk.next_marker); cleanup: if (err) g_error_free(err); if (thunk.text) g_free(thunk.text); if (thunk.next_marker) g_free(thunk.next_marker); if (ctxt) g_markup_parse_context_free(ctxt); if (buf.buffer) g_free(buf.buffer); if (result != S3_RESULT_OK) { g_slist_free(thunk.filename_list); return FALSE; } else { *list = thunk.filename_list; if(total_size) { *total_size = thunk.size; } return TRUE; } } gboolean s3_read(S3Handle *hdl, const char *bucket, const char *key, s3_write_func write_func, s3_reset_func reset_func, gpointer write_data, s3_progress_func progress_func, gpointer progress_data) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; g_assert(hdl != NULL); g_assert(write_func != NULL); result = perform_request(hdl, "GET", bucket, key, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, write_func, reset_func, write_data, progress_func, progress_data, result_handling); return result == S3_RESULT_OK; } gboolean s3_delete(S3Handle *hdl, const char *bucket, const char *key) { s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, { 404, 0, 0, S3_RESULT_OK }, { 404, S3_ERROR_NoSuchBucket, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 409, 0, 0, S3_RESULT_OK }, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; g_assert(hdl != NULL); result = perform_request(hdl, "DELETE", bucket, key, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, result_handling); return result == S3_RESULT_OK; } int s3_multi_delete(S3Handle *hdl, const char *bucket, const char **key) { GString *query; CurlBuffer data; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, { 400, 0, 0, S3_RESULT_NOTIMPL }, { 404, S3_ERROR_NoSuchBucket, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; g_assert(hdl != NULL); query = g_string_new(NULL); g_string_append(query, "\n"); g_string_append(query, "\n"); if (!hdl->verbose) { g_string_append(query, " true\n"); } while (*key != NULL) { g_string_append(query, " \n"); g_string_append(query, " "); g_string_append(query, *key); g_string_append(query, "\n"); g_string_append(query, " \n"); key++; } g_string_append(query, "\n"); data.buffer_len = query->len; data.buffer = query->str; data.buffer_pos = 0; data.max_buffer_size = data.buffer_len; result = perform_request(hdl, "POST", bucket, NULL, "delete", NULL, "application/xml", NULL, s3_buffer_read_func, s3_buffer_reset_func, s3_buffer_size_func, s3_buffer_md5_func, &data, NULL, NULL, NULL, NULL, NULL, result_handling); g_string_free(query, TRUE); if (result == S3_RESULT_OK) return 1; else if (result == S3_RESULT_NOTIMPL) return 2; else return 0; } gboolean s3_make_bucket(S3Handle *hdl, const char *bucket, const char *project_id) { char *body = NULL; char *verb = "PUT"; char *content_type = NULL; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 201, 0, 0, S3_RESULT_OK }, { 202, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, { 404, S3_ERROR_NoSuchBucket, 0, S3_RESULT_RETRY }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; regmatch_t pmatch[4]; char *loc_end_open, *loc_content; CurlBuffer buf = {NULL, 0, 0, 0}, *ptr = NULL; s3_read_func read_func = NULL; s3_reset_func reset_func = NULL; s3_md5_func md5_func = NULL; s3_size_func size_func = NULL; GString *CreateBucketConfiguration; gboolean add_create = FALSE; g_assert(hdl != NULL); CreateBucketConfiguration = g_string_new("host, "gss.iijgio.com")) { g_string_append(CreateBucketConfiguration, " xmlns=\"http://acs.iijgio.com/doc/2006-03-01/\""); } g_string_append(CreateBucketConfiguration, ">"); if (is_non_empty_string(hdl->bucket_location) && 0 != strcmp(AMAZON_WILDCARD_LOCATION, hdl->bucket_location)) { if (s3_bucket_location_compat(bucket)) { g_string_append_printf(CreateBucketConfiguration, "%s", hdl->bucket_location); add_create = TRUE; } else { hdl->last_message = g_strdup_printf(_( "Location constraint given for Amazon S3 bucket, " "but the bucket name (%s) is not usable as a subdomain."), bucket); g_string_free(CreateBucketConfiguration, TRUE); return FALSE; } } if (hdl->s3_api == S3_API_OAUTH2 && hdl->storage_class) { g_string_append_printf(CreateBucketConfiguration, "%s", hdl->storage_class); add_create = TRUE; } g_string_append(CreateBucketConfiguration, ""); if (add_create) { ptr = &buf; buf.buffer = g_string_free(CreateBucketConfiguration, FALSE); buf.buffer_len = (guint) strlen(buf.buffer); buf.buffer_pos = 0; buf.max_buffer_size = buf.buffer_len; read_func = s3_buffer_read_func; reset_func = s3_buffer_reset_func; size_func = s3_buffer_size_func; md5_func = s3_buffer_md5_func; } else { g_string_free(CreateBucketConfiguration, TRUE); } if (hdl->s3_api == S3_API_CASTOR) { verb = "POST"; content_type = "application/castorcontext"; } result = perform_request(hdl, verb, bucket, NULL, NULL, NULL, content_type, project_id, read_func, reset_func, size_func, md5_func, ptr, NULL, NULL, NULL, NULL, NULL, result_handling); if (ptr) g_free(ptr->buffer); if (result == S3_RESULT_OK || (result != S3_RESULT_OK && hdl->last_s3_error_code == S3_ERROR_BucketAlreadyOwnedByYou)) { /* verify the that the location constraint on the existing bucket matches * the one that's configured. */ if (is_non_empty_string(hdl->bucket_location)) { result = perform_request(hdl, "GET", bucket, NULL, "location", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, result_handling); } else { result = perform_request(hdl, "GET", bucket, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, result_handling); } if (result == S3_RESULT_OK && is_non_empty_string(hdl->bucket_location)) { /* return to the default state of failure */ result = S3_RESULT_FAIL; /* use strndup to get a null-terminated string */ body = g_strndup(hdl->last_response_body, hdl->last_response_body_size); if (!body) { hdl->last_message = g_strdup(_("No body received for location request")); goto cleanup; } else if ('\0' == body[0]) { hdl->last_message = g_strdup(_("Empty body received for location request")); goto cleanup; } if (!s3_regexec_wrap(&location_con_regex, body, 4, pmatch, 0)) { loc_end_open = find_regex_substring(body, pmatch[1]); loc_content = find_regex_substring(body, pmatch[3]); /* The case of an empty string is special because XML allows * "self-closing" tags */ if (0 == strcmp(AMAZON_WILDCARD_LOCATION, hdl->bucket_location) && '/' != loc_end_open[0]) hdl->last_message = g_strdup(_("A wildcard location constraint is " "configured, but the bucket has a non-empty location constraint")); else if (strcmp(AMAZON_WILDCARD_LOCATION, hdl->bucket_location)? strncmp(loc_content, hdl->bucket_location, strlen(hdl->bucket_location)) : ('\0' != loc_content[0])) hdl->last_message = g_strdup(_("The location constraint configured " "does not match the constraint currently on the bucket")); else result = S3_RESULT_OK; } else { hdl->last_message = g_strdup(_("Unexpected location response from Amazon S3")); } } } cleanup: if (body) g_free(body); return result == S3_RESULT_OK; } static s3_result_t oauth2_get_access_token( S3Handle *hdl) { GString *query; CurlBuffer data; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; char *body; regmatch_t pmatch[2]; g_assert(hdl != NULL); query = g_string_new(NULL); g_string_append(query, "client_id="); g_string_append(query, hdl->client_id); g_string_append(query, "&client_secret="); g_string_append(query, hdl->client_secret); g_string_append(query, "&refresh_token="); g_string_append(query, hdl->refresh_token); g_string_append(query, "&grant_type=refresh_token"); data.buffer_len = query->len; data.buffer = query->str; data.buffer_pos = 0; data.max_buffer_size = data.buffer_len; hdl->x_storage_url = "https://accounts.google.com/o/oauth2/token"; hdl->getting_oauth2_access_token = 1; result = perform_request(hdl, "POST", NULL, NULL, NULL, NULL, "application/x-www-form-urlencoded", NULL, s3_buffer_read_func, s3_buffer_reset_func, s3_buffer_size_func, s3_buffer_md5_func, &data, NULL, NULL, NULL, NULL, NULL, result_handling); hdl->x_storage_url = NULL; hdl->getting_oauth2_access_token = 0; /* use strndup to get a null-terminated string */ body = g_strndup(hdl->last_response_body, hdl->last_response_body_size); if (!body) { hdl->last_message = g_strdup(_("No body received for location request")); goto cleanup; } else if ('\0' == body[0]) { hdl->last_message = g_strdup(_("Empty body received for location request")); goto cleanup; } if (!s3_regexec_wrap(&access_token_regex, body, 2, pmatch, 0)) { hdl->access_token = find_regex_substring(body, pmatch[1]); hdl->x_auth_token = g_strdup(hdl->access_token); } if (!s3_regexec_wrap(&expires_in_regex, body, 2, pmatch, 0)) { char *expires_in = find_regex_substring(body, pmatch[1]); hdl->expires = time(NULL) + atoi(expires_in) - 600; g_free(expires_in); } cleanup: g_free(body); return result == S3_RESULT_OK; } gboolean s3_is_bucket_exists(S3Handle *hdl, const char *bucket, const char *project_id) { s3_result_t result = S3_RESULT_FAIL; char *query; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, { 204, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; if (hdl->s3_api == S3_API_SWIFT_1 || hdl->s3_api == S3_API_SWIFT_2) { query = "limit=1"; } else if (hdl->s3_api == S3_API_CASTOR) { query = "format=xml&size=0"; } else { query = "max-keys=1"; } result = perform_request(hdl, "GET", bucket, NULL, NULL, query, NULL, project_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, result_handling); return result == S3_RESULT_OK; } gboolean s3_delete_bucket(S3Handle *hdl, const char *bucket) { return s3_delete(hdl, bucket, NULL); } amanda-3.3.6/device-src/xfer-dest-taper.c0000664000076400007640000000663012357250004021645 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "xfer-device.h" static GObjectClass *parent_class = NULL; /* * Method implementation */ static void cache_inform_impl( XferDestTaper *self G_GNUC_UNUSED, const char *filename G_GNUC_UNUSED, off_t offset G_GNUC_UNUSED, off_t length G_GNUC_UNUSED) { /* do nothing */ } static void instance_init( XferElement *elt) { elt->can_generate_eof = FALSE; } static void class_init( XferDestTaperClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); selfc->cache_inform = cache_inform_impl; klass->perl_class = "Amanda::Xfer::Dest::Taper"; parent_class = g_type_class_peek_parent(selfc); } GType xfer_dest_taper_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestTaperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestTaper), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestTaper", &info, 0); } return type; } /* * Method stubs */ void xfer_dest_taper_start_part( XferElement *elt, gboolean retry_part, dumpfile_t *header) { XferDestTaperClass *klass; g_assert(IS_XFER_DEST_TAPER(elt)); klass = XFER_DEST_TAPER_GET_CLASS(elt); klass->start_part(XFER_DEST_TAPER(elt), retry_part, header); } void xfer_dest_taper_use_device( XferElement *elt, Device *device) { XferDestTaperClass *klass; g_assert(IS_XFER_DEST_TAPER(elt)); klass = XFER_DEST_TAPER_GET_CLASS(elt); klass->use_device(XFER_DEST_TAPER(elt), device); } void xfer_dest_taper_cache_inform( XferElement *elt, const char *filename, off_t offset, off_t length) { XferDestTaperClass *klass; g_assert(IS_XFER_DEST_TAPER(elt)); klass = XFER_DEST_TAPER_GET_CLASS(elt); klass->cache_inform(XFER_DEST_TAPER(elt), filename, offset, length); } guint64 xfer_dest_taper_get_part_bytes_written( XferElement *elt G_GNUC_UNUSED) { XferDestTaperClass *klass; g_assert(IS_XFER_DEST_TAPER(elt)); klass = XFER_DEST_TAPER_GET_CLASS(elt); if (klass->get_part_bytes_written) return klass->get_part_bytes_written(XFER_DEST_TAPER(elt)); else return 0; } amanda-3.3.6/device-src/directtcp-connection.c0000664000076400007640000001117512357250004022751 0ustar00martineamartinea00000000000000/* * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "directtcp-connection.h" #include /* * DirectTCPConnection class implementation */ static GObjectClass *parent_class = NULL; static void directtcp_connection_finalize(GObject *goself) { DirectTCPConnection *self = DIRECTTCP_CONNECTION(goself); /* close this socket if necessary, failing fatally if that doesn't work */ if (!self->closed) { char *errmsg; g_warning("connection freed without being closed first; any error will be fatal"); errmsg = directtcp_connection_close(self); if (errmsg) error("while closing directtcp connection: %s", errmsg); } G_OBJECT_CLASS(parent_class)->finalize(goself); } static void directtcp_connection_class_init( DirectTCPConnectionClass * c) { GObjectClass *goc = (GObjectClass *)c; goc->finalize = directtcp_connection_finalize; parent_class = g_type_class_peek_parent(c); } GType directtcp_connection_get_type(void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DirectTCPConnectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) directtcp_connection_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (DirectTCPConnection), 0 /* n_preallocs */, (GInstanceInitFunc) NULL, NULL }; type = g_type_register_static (G_TYPE_OBJECT, "DirectTCPConnection", &info, (GTypeFlags)G_TYPE_FLAG_ABSTRACT); } return type; } char * directtcp_connection_close( DirectTCPConnection *self) { DirectTCPConnectionClass *klass = DIRECTTCP_CONNECTION_GET_CLASS(self); char *rv; /* Note that this also tracks the 'closed' value, which is used by finalize * to ensure that the connection has been closed */ g_assert(!self->closed); g_assert(klass->close); rv = klass->close(self); self->closed = TRUE; return rv; } /* * DirectTCPConnSocket class implementation */ DirectTCPConnectionSocket * directtcp_connection_socket_new( int socket) { DirectTCPConnectionSocket *conn = DIRECTTCP_CONNECTION_SOCKET(g_object_new(TYPE_DIRECTTCP_CONNECTION_SOCKET, NULL)); conn->socket = socket; return conn; } static char * directtcp_connection_socket_close(DirectTCPConnection *dself) { DirectTCPConnectionSocket *self = DIRECTTCP_CONNECTION_SOCKET(dself); if (self->socket >= 0 && close(self->socket)) { return g_strdup_printf("while closing socket: %s", strerror(errno)); } self->socket = -1; return NULL; } static void directtcp_connection_socket_init(DirectTCPConnectionSocket *self) { self->socket = -1; } static void directtcp_connection_socket_class_init(DirectTCPConnectionSocketClass * c) { DirectTCPConnectionClass *connc = (DirectTCPConnectionClass *)c; connc->close = directtcp_connection_socket_close; } GType directtcp_connection_socket_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DirectTCPConnectionSocketClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) directtcp_connection_socket_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (DirectTCPConnectionSocket), 0 /* n_preallocs */, (GInstanceInitFunc) directtcp_connection_socket_init, NULL }; type = g_type_register_static(TYPE_DIRECTTCP_CONNECTION, "DirectTCPConnectionSocket", &info, (GTypeFlags)0); } return type; } amanda-3.3.6/device-src/s3-device.c0000664000076400007640000033220112357250004020411 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* An S3 device uses Amazon's S3 service (http://www.amazon.com/s3) to store * data. It stores data in keys named with a user-specified prefix, inside a * user-specified bucket. Data is stored in the form of numbered (large) * blocks. */ #include "amanda.h" #include #include #include #include #include #include #include #include "util.h" #include "conffile.h" #include "device.h" #include "s3.h" #include #ifdef HAVE_OPENSSL_HMAC_H # include #else # ifdef HAVE_CRYPTO_HMAC_H # include # else # ifdef HAVE_HMAC_H # include # endif # endif #endif /* * Type checking and casting macros */ #define TYPE_S3_DEVICE (s3_device_get_type()) #define S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device) #define S3_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device const) #define S3_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), s3_device_get_type(), S3DeviceClass) #define IS_S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), s3_device_get_type ()) #define S3_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), s3_device_get_type(), S3DeviceClass) static GType s3_device_get_type (void); /* * Main object structure */ typedef struct _S3MetadataFile S3MetadataFile; typedef struct _S3Device S3Device; typedef struct _S3_by_thread S3_by_thread; struct _S3_by_thread { S3Handle * volatile s3; CurlBuffer volatile curl_buffer; guint volatile buffer_len; int volatile idle; int volatile eof; int volatile done; char volatile * volatile filename; DeviceStatusFlags volatile errflags; /* device_status */ char volatile * volatile errmsg; /* device error message */ GMutex *now_mutex; guint64 dlnow, ulnow; }; struct _S3Device { Device __parent__; /* The "easy" curl handle we use to access Amazon S3 */ S3_by_thread *s3t; /* S3 access information */ char *bucket; char *prefix; /* The S3 access information. */ char *secret_key; char *access_key; char *user_token; /* The Openstack swift information. */ char *swift_account_id; char *swift_access_key; char *username; char *password; char *tenant_id; char *tenant_name; char *bucket_location; char *storage_class; char *host; char *service_path; char *server_side_encryption; char *proxy; char *ca_info; /* a cache for unsuccessful reads (where we get the file but the caller * doesn't have space for it or doesn't want it), where we expect the * next call will request the same file. */ char *cached_buf; char *cached_key; int cached_size; /* Produce verbose output? */ gboolean verbose; /* create the bucket? */ gboolean create_bucket; /* Use SSL? */ gboolean use_ssl; S3_api s3_api; /* Throttling */ guint64 max_send_speed; guint64 max_recv_speed; gboolean leom; guint64 volume_bytes; guint64 volume_limit; gboolean enforce_volume_limit; gboolean use_subdomain; gboolean use_s3_multi_delete; int nb_threads; int nb_threads_backup; int nb_threads_recovery; GThreadPool *thread_pool_delete; GThreadPool *thread_pool_write; GThreadPool *thread_pool_read; GCond *thread_idle_cond; GMutex *thread_idle_mutex; int next_block_to_read; GSList *keys; guint64 dltotal; guint64 ultotal; /* google OAUTH2 */ char *client_id; char *client_secret; char *refresh_token; char *project_id; gboolean reuse_connection; long timeout; /* CAStor */ char *reps; char *reps_bucket; }; /* * Class definition */ typedef struct _S3DeviceClass S3DeviceClass; struct _S3DeviceClass { DeviceClass __parent__; }; /* * Constants and static data */ #define S3_DEVICE_NAME "s3" /* Maximum key length as specified in the S3 documentation * (*excluding* null terminator) */ #define S3_MAX_KEY_LENGTH 1024 /* Note: for compatability, min can only be decreased and max increased */ #define S3_DEVICE_MIN_BLOCK_SIZE 1024 #define S3_DEVICE_MAX_BLOCK_SIZE (3*1024*1024*1024ULL) #define S3_DEVICE_DEFAULT_BLOCK_SIZE (10*1024*1024) #define EOM_EARLY_WARNING_ZONE_BLOCKS 4 /* This goes in lieu of file number for metadata. */ #define SPECIAL_INFIX "special-" /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; /* * device-specific properties */ /* Authentication information for Amazon S3. Both of these are strings. */ static DevicePropertyBase device_property_s3_access_key; static DevicePropertyBase device_property_s3_secret_key; #define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID) #define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID) /* Authentication information for Openstack Swift. Both of these are strings. */ static DevicePropertyBase device_property_swift_account_id; static DevicePropertyBase device_property_swift_access_key; #define PROPERTY_SWIFT_ACCOUNT_ID (device_property_swift_account_id.ID) #define PROPERTY_SWIFT_ACCESS_KEY (device_property_swift_access_key.ID) /* Authentication information for Openstack Swift. Both of these are strings. */ static DevicePropertyBase device_property_username; static DevicePropertyBase device_property_password; static DevicePropertyBase device_property_tenant_id; static DevicePropertyBase device_property_tenant_name; #define PROPERTY_USERNAME (device_property_username.ID) #define PROPERTY_PASSWORD (device_property_password.ID) #define PROPERTY_TENANT_ID (device_property_tenant_id.ID) #define PROPERTY_TENANT_NAME (device_property_tenant_name.ID) /* Host and path */ static DevicePropertyBase device_property_s3_host; static DevicePropertyBase device_property_s3_service_path; #define PROPERTY_S3_HOST (device_property_s3_host.ID) #define PROPERTY_S3_SERVICE_PATH (device_property_s3_service_path.ID) /* Same, but for S3 with DevPay. */ static DevicePropertyBase device_property_s3_user_token; #define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID) /* Location constraint for new buckets created on Amazon S3. */ static DevicePropertyBase device_property_s3_bucket_location; #define PROPERTY_S3_BUCKET_LOCATION (device_property_s3_bucket_location.ID) /* Storage class */ static DevicePropertyBase device_property_s3_storage_class; #define PROPERTY_S3_STORAGE_CLASS (device_property_s3_storage_class.ID) /* Server side encryption */ static DevicePropertyBase device_property_s3_server_side_encryption; #define PROPERTY_S3_SERVER_SIDE_ENCRYPTION (device_property_s3_server_side_encryption.ID) /* proxy */ static DevicePropertyBase device_property_proxy; #define PROPERTY_PROXY (device_property_proxy.ID) /* Path to certificate authority certificate */ static DevicePropertyBase device_property_ssl_ca_info; #define PROPERTY_SSL_CA_INFO (device_property_ssl_ca_info.ID) /* Which strotage api to use. */ static DevicePropertyBase device_property_storage_api; #define PROPERTY_STORAGE_API (device_property_storage_api.ID) /* Whether to use openstack protocol. */ /* DEPRECATED */ static DevicePropertyBase device_property_openstack_swift_api; #define PROPERTY_OPENSTACK_SWIFT_API (device_property_openstack_swift_api.ID) /* Whether to use SSL with Amazon S3. */ static DevicePropertyBase device_property_s3_ssl; #define PROPERTY_S3_SSL (device_property_s3_ssl.ID) /* Whether to re-use connection. */ static DevicePropertyBase device_property_reuse_connection; #define PROPERTY_REUSE_CONNECTION (device_property_reuse_connection.ID) /* Speed limits for sending and receiving */ static DevicePropertyBase device_property_max_send_speed; static DevicePropertyBase device_property_max_recv_speed; #define PROPERTY_MAX_SEND_SPEED (device_property_max_send_speed.ID) #define PROPERTY_MAX_RECV_SPEED (device_property_max_recv_speed.ID) /* Whether to use subdomain */ static DevicePropertyBase device_property_s3_subdomain; #define PROPERTY_S3_SUBDOMAIN (device_property_s3_subdomain.ID) /* Number of threads to use */ static DevicePropertyBase device_property_nb_threads_backup; #define PROPERTY_NB_THREADS_BACKUP (device_property_nb_threads_backup.ID) static DevicePropertyBase device_property_nb_threads_recovery; #define PROPERTY_NB_THREADS_RECOVERY (device_property_nb_threads_recovery.ID) /* If the s3 server have the multi-delete functionality */ static DevicePropertyBase device_property_s3_multi_delete; #define PROPERTY_S3_MULTI_DELETE (device_property_s3_multi_delete.ID) /* The client_id for OAUTH2 */ static DevicePropertyBase device_property_client_id; #define PROPERTY_CLIENT_ID (device_property_client_id.ID) /* The client_secret for OAUTH2 */ static DevicePropertyBase device_property_client_secret; #define PROPERTY_CLIENT_SECRET (device_property_client_secret.ID) /* The refresh token for OAUTH2 */ static DevicePropertyBase device_property_refresh_token; #define PROPERTY_REFRESH_TOKEN (device_property_refresh_token.ID) /* The PROJECT ID */ static DevicePropertyBase device_property_project_id; #define PROPERTY_PROJECT_ID (device_property_project_id.ID) /* The PROJECT ID */ static DevicePropertyBase device_property_create_bucket; #define PROPERTY_CREATE_BUCKET (device_property_create_bucket.ID) static DevicePropertyBase device_property_timeout; #define PROPERTY_TIMEOUT (device_property_timeout.ID) /* CAStor replication values for objects and buckets */ static DevicePropertyBase device_property_s3_reps; #define PROPERTY_S3_REPS (device_property_s3_reps.ID) #define S3_DEVICE_REPS_DEFAULT "2" static DevicePropertyBase device_property_s3_reps_bucket; #define PROPERTY_S3_REPS_BUCKET (device_property_s3_reps_bucket.ID) #define S3_DEVICE_REPS_BUCKET_DEFAULT "4" /* * prototypes */ void s3_device_register(void); /* * utility functions */ /* Given file and block numbers, return an S3 key. * * @param self: the S3Device object * @param file: the file number * @param block: the block within that file * @returns: a newly allocated string containing an S3 key. */ static char * file_and_block_to_key(S3Device *self, int file, guint64 block); /* Given the name of a special file (such as 'tapestart'), generate * the S3 key to use for that file. * * @param self: the S3Device object * @param special_name: name of the special file * @param file: a file number to include; omitted if -1 * @returns: a newly alocated string containing an S3 key. */ static char * special_file_to_key(S3Device *self, char *special_name, int file); /* Write an amanda header file to S3. * * @param self: the S3Device object * @param label: the volume label * @param timestamp: the volume timestamp */ static gboolean write_amanda_header(S3Device *self, char *label, char * timestamp); /* "Fast forward" this device to the end by looking up the largest file number * present and setting the current file number one greater. * * @param self: the S3Device object */ static gboolean seek_to_end(S3Device *self); /* Find the number of the last file that contains any data (even just a header). * * @param self: the S3Device object * @returns: the last file, or -1 in event of an error */ static int find_last_file(S3Device *self); /* Delete all blocks in the given file, including the filestart block * * @param self: the S3Device object * @param file: the file to delete */ static gboolean delete_file(S3Device *self, int file); /* Delete all files in the given device * * @param self: the S3Device object */ static gboolean delete_all_files(S3Device *self); /* Set up self->s3t as best as possible. * * The return value is TRUE iff self->s3t is useable. * * @param self: the S3Device object * @returns: TRUE if the handle is set up */ static gboolean setup_handle(S3Device * self); static void s3_wait_thread_delete(S3Device *self); /* * class mechanics */ static void s3_device_init(S3Device * o); static void s3_device_class_init(S3DeviceClass * c); static void s3_device_finalize(GObject * o); static Device* s3_device_factory(char * device_name, char * device_type, char * device_node); /* * Property{Get,Set}Fns */ static gboolean s3_device_set_access_key_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_secret_key_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_swift_account_id_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_swift_access_key_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_username(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_password(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_tenant_id(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_tenant_name(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_user_token_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_bucket_location_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_storage_class_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_server_side_encryption_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_proxy_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_ca_info_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_verbose_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_create_bucket_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_storage_api(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_openstack_swift_api_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_s3_multi_delete_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_ssl_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_reuse_connection_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_timeout_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_max_send_speed_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_max_recv_speed_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_nb_threads_backup(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_nb_threads_recovery(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean property_set_leom_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_enforce_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_use_subdomain_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_host_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_service_path_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_client_id_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_client_secret_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_refresh_token_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_project_id_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_reps_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean s3_device_set_reps_bucket_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static void s3_thread_read_block(gpointer thread_data, gpointer data); static void s3_thread_write_block(gpointer thread_data, gpointer data); static gboolean make_bucket(Device * pself); /* Wait that all threads are done */ static void reset_thread(S3Device *self); /* * virtual functions */ static void s3_device_open_device(Device *pself, char *device_name, char * device_type, char * device_node); static DeviceStatusFlags s3_device_read_label(Device * self); static gboolean s3_device_start(Device * self, DeviceAccessMode mode, char * label, char * timestamp); static gboolean s3_device_finish(Device * self); static guint64 s3_device_get_bytes_read(Device * self); static guint64 s3_device_get_bytes_written(Device * self); static gboolean s3_device_start_file(Device * self, dumpfile_t * jobInfo); static gboolean s3_device_write_block(Device * self, guint size, gpointer data); static gboolean s3_device_finish_file(Device * self); static dumpfile_t* s3_device_seek_file(Device *pself, guint file); static gboolean s3_device_seek_block(Device *pself, guint64 block); static int s3_device_read_block(Device * pself, gpointer data, int *size_req); static gboolean s3_device_recycle_file(Device *pself, guint file); static gboolean s3_device_erase(Device *pself); static gboolean check_at_leom(S3Device *self, guint64 size); static gboolean check_at_peom(S3Device *self, guint64 size); /* * Private functions */ static char * file_and_block_to_key(S3Device *self, int file, guint64 block) { char *s3_key = g_strdup_printf("%sf%08x-b%016llx.data", self->prefix, file, (long long unsigned int)block); g_assert(strlen(s3_key) <= S3_MAX_KEY_LENGTH); return s3_key; } static char * special_file_to_key(S3Device *self, char *special_name, int file) { if (file == -1) return g_strdup_printf("%s" SPECIAL_INFIX "%s", self->prefix, special_name); else return g_strdup_printf("%sf%08x-%s", self->prefix, file, special_name); } static gboolean write_amanda_header(S3Device *self, char *label, char * timestamp) { CurlBuffer amanda_header = {NULL, 0, 0, 0}; char * key = NULL; gboolean result; dumpfile_t * dumpinfo = NULL; Device *d_self = DEVICE(self); size_t header_size; /* build the header */ header_size = 0; /* no minimum size */ dumpinfo = make_tapestart_header(DEVICE(self), label, timestamp); amanda_header.buffer = device_build_amanda_header(DEVICE(self), dumpinfo, &header_size); if (amanda_header.buffer == NULL) { device_set_error(d_self, stralloc(_("Amanda tapestart header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); dumpfile_free(dumpinfo); g_free(amanda_header.buffer); return FALSE; } if(check_at_leom(self, header_size)) d_self->is_eom = TRUE; if(check_at_peom(self, header_size)) { d_self->is_eom = TRUE; device_set_error(d_self, stralloc(_("No space left on device")), DEVICE_STATUS_DEVICE_ERROR); g_free(amanda_header.buffer); return FALSE; } /* write out the header and flush the uploads. */ key = special_file_to_key(self, "tapestart", -1); g_assert(header_size < G_MAXUINT); /* for cast to guint */ amanda_header.buffer_len = (guint)header_size; result = s3_upload(self->s3t[0].s3, self->bucket, key, S3_BUFFER_READ_FUNCS, &amanda_header, NULL, NULL); g_free(amanda_header.buffer); g_free(key); if (!result) { device_set_error(d_self, vstrallocf(_("While writing amanda header: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); dumpfile_free(dumpinfo); } else { dumpfile_free(d_self->volume_header); d_self->volume_header = dumpinfo; self->volume_bytes += header_size; } d_self->header_block_size = header_size; return result; } static gboolean seek_to_end(S3Device *self) { int last_file; Device *pself = DEVICE(self); last_file = find_last_file(self); if (last_file < 0) return FALSE; pself->file = last_file; return TRUE; } /* Convert an object name into a file number, assuming the given prefix * length. Returns -1 if the object name is invalid, or 0 if the object name * is a "special" key. */ static int key_to_file(guint prefix_len, const char * key) { int file; int i; /* skip the prefix */ if (strlen(key) <= prefix_len) return -1; key += prefix_len; if (strncmp(key, SPECIAL_INFIX, strlen(SPECIAL_INFIX)) == 0) { return 0; } /* check that key starts with 'f' */ if (key[0] != 'f') return -1; key++; /* check that key is of the form "%08x-" */ for (i = 0; i < 8; i++) { if (!(key[i] >= '0' && key[i] <= '9') && !(key[i] >= 'a' && key[i] <= 'f') && !(key[i] >= 'A' && key[i] <= 'F')) break; } if (key[i] != '-') return -1; if (i < 8) return -1; /* convert the file number */ errno = 0; file = strtoul(key, NULL, 16); if (errno != 0) { g_warning(_("unparseable file number '%s'"), key); return -1; } return file; } /* Find the number of the last file that contains any data (even just a header). * Returns -1 in event of an error */ static int find_last_file(S3Device *self) { gboolean result; GSList *keys; unsigned int prefix_len = strlen(self->prefix); int last_file = 0; Device *d_self = DEVICE(self); /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ result = s3_list_keys(self->s3t[0].s3, self->bucket, self->prefix, "-", &keys, NULL); if (!result) { device_set_error(d_self, vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } for (; keys; keys = g_slist_remove(keys, keys->data)) { int file = key_to_file(prefix_len, keys->data); /* and if it's the last, keep it */ if (file > last_file) last_file = file; } return last_file; } /* Find the number of the file following the requested one, if any. * Returns 0 if there is no such file or -1 in event of an error */ static int find_next_file(S3Device *self, int last_file) { gboolean result; GSList *keys; unsigned int prefix_len = strlen(self->prefix); int next_file = 0; Device *d_self = DEVICE(self); /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ result = s3_list_keys(self->s3t[0].s3, self->bucket, self->prefix, "-", &keys, NULL); if (!result) { device_set_error(d_self, vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } for (; keys; keys = g_slist_remove(keys, keys->data)) { int file; file = key_to_file(prefix_len, (char*)keys->data); if (file < 0) { /* Set this in case we don't find a next file; this is not a * hard error, so if we can find a next file we'll return that * instead. */ next_file = -1; } if (file < next_file && file > last_file) { next_file = file; } } return next_file; } static gboolean delete_file(S3Device *self, int file) { int thread = -1; gboolean result; GSList *keys; guint64 total_size = 0; Device *d_self = DEVICE(self); char *my_prefix; if (file == -1) { my_prefix = g_strdup_printf("%sf", self->prefix); } else { my_prefix = g_strdup_printf("%sf%08x-", self->prefix, file); } result = s3_list_keys(self->s3t[0].s3, self->bucket, my_prefix, NULL, &keys, &total_size); g_free(my_prefix); if (!result) { guint response_code; s3_error_code_t s3_error_code; CURLcode curl_code; s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, &curl_code, NULL); if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchBucket) { return TRUE; } device_set_error(d_self, g_strdup_printf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } g_mutex_lock(self->thread_idle_mutex); if (!self->keys) { self->keys = keys; } else { self->keys = g_slist_concat(self->keys, keys); } if (!self->keys) { g_mutex_unlock(self->thread_idle_mutex); return TRUE; } // start the threads for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].idle == 1) { /* Check if the thread is in error */ if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) { device_set_error(d_self, (char *)self->s3t[thread].errmsg, self->s3t[thread].errflags); self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS; self->s3t[thread].errmsg = NULL; g_mutex_unlock(self->thread_idle_mutex); s3_wait_thread_delete(self); return FALSE; } self->s3t[thread].idle = 0; self->s3t[thread].done = 0; g_thread_pool_push(self->thread_pool_delete, &self->s3t[thread], NULL); } } g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); g_mutex_unlock(self->thread_idle_mutex); self->volume_bytes = total_size; s3_wait_thread_delete(self); return TRUE; } static void s3_thread_delete_block( gpointer thread_data, gpointer data) { static int count = 0; S3_by_thread *s3t = (S3_by_thread *)thread_data; Device *pself = (Device *)data; S3Device *self = S3_DEVICE(pself); int result = 1; char *filename; g_mutex_lock(self->thread_idle_mutex); while (result && self->keys) { if (self->use_s3_multi_delete) { char **filenames = g_new(char *, 1001); char **f = filenames; int n = 0; while (self->keys && n<1000) { *f++ = self->keys->data; self->keys = g_slist_remove(self->keys, self->keys->data); n++; } *f++ = NULL; g_mutex_unlock(self->thread_idle_mutex); result = s3_multi_delete(s3t->s3, (const char *)self->bucket, (const char **)filenames); if (result != 1) { char **f; if (result == 2) { g_debug("Deleting multiple keys not implemented"); } else { /* result == 0 */ g_debug("Deleteing multiple keys failed: %s", s3_strerror(s3t->s3)); } self->use_s3_multi_delete = 0; /* re-add all filenames */ f = filenames; g_mutex_lock(self->thread_idle_mutex); while(*f) { self->keys = g_slist_prepend(self->keys, *f++); } g_mutex_unlock(self->thread_idle_mutex); g_free(filenames); result = 1; g_mutex_lock(self->thread_idle_mutex); continue; } f = filenames; while(*f) { g_free(*f++); } g_free(filenames); } else { filename = self->keys->data; self->keys = g_slist_remove(self->keys, self->keys->data); count++; if (count >= 1000) { g_debug("Deleting %s ...", filename); count = 0; } g_mutex_unlock(self->thread_idle_mutex); result = s3_delete(s3t->s3, (const char *)self->bucket, (const char *)filename); if (!result) { s3t->errflags = DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR; s3t->errmsg = g_strdup_printf(_("While deleting key '%s': %s"), filename, s3_strerror(s3t->s3)); } g_free(filename); } g_mutex_lock(self->thread_idle_mutex); } s3t->idle = 1; s3t->done = 1; g_cond_broadcast(self->thread_idle_cond); g_mutex_unlock(self->thread_idle_mutex); } static void s3_wait_thread_delete(S3Device *self) { Device *d_self = (Device *)self; int idle_thread = 0; int thread; g_mutex_lock(self->thread_idle_mutex); while (idle_thread != self->nb_threads) { idle_thread = 0; for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].idle == 1) { idle_thread++; } /* Check if the thread is in error */ if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) { device_set_error(d_self, (char *)self->s3t[thread].errmsg, self->s3t[thread].errflags); self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS; self->s3t[thread].errmsg = NULL; } } if (idle_thread != self->nb_threads) { g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); } } g_mutex_unlock(self->thread_idle_mutex); } static gboolean delete_all_files(S3Device *self) { return delete_file(self, -1); } /* * Class mechanics */ void s3_device_register(void) { static const char * device_prefix_list[] = { S3_DEVICE_NAME, NULL }; g_assert(s3_init()); /* set up our properties */ device_property_fill_and_register(&device_property_s3_secret_key, G_TYPE_STRING, "s3_secret_key", "Secret access key to authenticate with Amazon S3"); device_property_fill_and_register(&device_property_s3_access_key, G_TYPE_STRING, "s3_access_key", "Access key ID to authenticate with Amazon S3"); device_property_fill_and_register(&device_property_swift_account_id, G_TYPE_STRING, "swift_account_id", "Account ID to authenticate with openstack swift"); device_property_fill_and_register(&device_property_swift_access_key, G_TYPE_STRING, "swift_access_key", "Access key to authenticate with openstack swift"); device_property_fill_and_register(&device_property_username, G_TYPE_STRING, "username", "Username to authenticate with"); device_property_fill_and_register(&device_property_password, G_TYPE_STRING, "password", "password to authenticate with"); device_property_fill_and_register(&device_property_tenant_id, G_TYPE_STRING, "tenant_id", "tenant_id to authenticate with"); device_property_fill_and_register(&device_property_tenant_name, G_TYPE_STRING, "tenant_name", "tenant_name to authenticate with"); device_property_fill_and_register(&device_property_s3_host, G_TYPE_STRING, "s3_host", "hostname:port of the server"); device_property_fill_and_register(&device_property_s3_service_path, G_TYPE_STRING, "s3_service_path", "path to add in the url"); device_property_fill_and_register(&device_property_s3_user_token, G_TYPE_STRING, "s3_user_token", "User token for authentication Amazon devpay requests"); device_property_fill_and_register(&device_property_s3_bucket_location, G_TYPE_STRING, "s3_bucket_location", "Location constraint for buckets on Amazon S3"); device_property_fill_and_register(&device_property_s3_storage_class, G_TYPE_STRING, "s3_storage_class", "Storage class as specified by Amazon (STANDARD or REDUCED_REDUNDANCY)"); device_property_fill_and_register(&device_property_s3_server_side_encryption, G_TYPE_STRING, "s3_server_side_encryption", "Serve side encryption as specified by Amazon (AES256)"); device_property_fill_and_register(&device_property_proxy, G_TYPE_STRING, "proxy", "The proxy"); device_property_fill_and_register(&device_property_ssl_ca_info, G_TYPE_STRING, "ssl_ca_info", "Path to certificate authority certificate"); device_property_fill_and_register(&device_property_storage_api, G_TYPE_STRING, "storage_api", "Which cloud API to use."); device_property_fill_and_register(&device_property_openstack_swift_api, G_TYPE_STRING, "openstack_swift_api", "Whether to use openstack protocol"); device_property_fill_and_register(&device_property_client_id, G_TYPE_STRING, "client_id", "client_id for use with oauth2"); device_property_fill_and_register(&device_property_client_secret, G_TYPE_STRING, "client_secret", "client_secret for use with oauth2"); device_property_fill_and_register(&device_property_refresh_token, G_TYPE_STRING, "refresh_token", "refresh_token for use with oauth2"); device_property_fill_and_register(&device_property_project_id, G_TYPE_STRING, "project_id", "project id for use with google"); device_property_fill_and_register(&device_property_s3_ssl, G_TYPE_BOOLEAN, "s3_ssl", "Whether to use SSL with Amazon S3"); device_property_fill_and_register(&device_property_reuse_connection, G_TYPE_BOOLEAN, "reuse_connection", "Whether to reuse connection"); device_property_fill_and_register(&device_property_create_bucket, G_TYPE_BOOLEAN, "create_bucket", "Whether to create/delete bucket"); device_property_fill_and_register(&device_property_s3_subdomain, G_TYPE_BOOLEAN, "s3_subdomain", "Whether to use subdomain"); device_property_fill_and_register(&device_property_max_send_speed, G_TYPE_UINT64, "max_send_speed", "Maximum average upload speed (bytes/sec)"); device_property_fill_and_register(&device_property_max_recv_speed, G_TYPE_UINT64, "max_recv_speed", "Maximum average download speed (bytes/sec)"); device_property_fill_and_register(&device_property_nb_threads_backup, G_TYPE_UINT64, "nb_threads_backup", "Number of writer thread"); device_property_fill_and_register(&device_property_nb_threads_recovery, G_TYPE_UINT64, "nb_threads_recovery", "Number of reader thread"); device_property_fill_and_register(&device_property_s3_multi_delete, G_TYPE_BOOLEAN, "s3_multi_delete", "Whether to use multi-delete"); device_property_fill_and_register(&device_property_s3_reps, G_TYPE_STRING, "reps", "Number of replicas for data objects in CAStor"); device_property_fill_and_register(&device_property_s3_reps_bucket, G_TYPE_STRING, "reps_bucket", "Number of replicas for automatically created buckets in CAStor"); device_property_fill_and_register(&device_property_timeout, G_TYPE_UINT64, "timeout", "The timeout for one tranfer"); /* register the device itself */ register_device(s3_device_factory, device_prefix_list); } static GType s3_device_get_type(void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (S3DeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) s3_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (S3Device), 0 /* n_preallocs */, (GInstanceInitFunc) s3_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "S3Device", &info, (GTypeFlags)0); } return type; } static void s3_device_init(S3Device * self) { Device * dself = DEVICE(self); GValue response; self->s3_api = S3_API_S3; self->volume_bytes = 0; self->volume_limit = 0; self->leom = TRUE; self->enforce_volume_limit = FALSE; self->use_subdomain = FALSE; self->nb_threads = 1; self->nb_threads_backup = 1; self->nb_threads_recovery = 1; self->thread_pool_delete = NULL; self->thread_pool_write = NULL; self->thread_pool_read = NULL; self->thread_idle_cond = NULL; self->thread_idle_mutex = NULL; self->use_s3_multi_delete = 1; self->reps = NULL; self->reps_bucket = NULL; /* Register property values * Note: Some aren't added until s3_device_open_device() */ bzero(&response, sizeof(response)); g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_SHARED_READ); device_set_simple_property(dself, PROPERTY_CONCURRENCY, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); device_set_simple_property(dself, PROPERTY_STREAMING, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_APPENDABLE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_FULL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); /* well, there *is* no EOM on S3 .. */ device_set_simple_property(dself, PROPERTY_LEOM, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_ENFORCE_MAX_VOLUME_USAGE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_S3_SUBDOMAIN, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_COMPRESSION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); } static void s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED) { GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->open_device = s3_device_open_device; device_class->read_label = s3_device_read_label; device_class->start = s3_device_start; device_class->finish = s3_device_finish; device_class->get_bytes_read = s3_device_get_bytes_read; device_class->get_bytes_written = s3_device_get_bytes_written; device_class->start_file = s3_device_start_file; device_class->write_block = s3_device_write_block; device_class->finish_file = s3_device_finish_file; device_class->seek_file = s3_device_seek_file; device_class->seek_block = s3_device_seek_block; device_class->read_block = s3_device_read_block; device_class->recycle_file = s3_device_recycle_file; device_class->erase = s3_device_erase; g_object_class->finalize = s3_device_finalize; device_class_register_property(device_class, PROPERTY_S3_ACCESS_KEY, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_access_key_fn); device_class_register_property(device_class, PROPERTY_S3_SECRET_KEY, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_secret_key_fn); device_class_register_property(device_class, PROPERTY_SWIFT_ACCOUNT_ID, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_swift_account_id_fn); device_class_register_property(device_class, PROPERTY_SWIFT_ACCESS_KEY, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_swift_access_key_fn); device_class_register_property(device_class, PROPERTY_USERNAME, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_username); device_class_register_property(device_class, PROPERTY_PASSWORD, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_password); device_class_register_property(device_class, PROPERTY_TENANT_ID, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_tenant_id); device_class_register_property(device_class, PROPERTY_TENANT_NAME, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_tenant_name); device_class_register_property(device_class, PROPERTY_S3_HOST, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_host_fn); device_class_register_property(device_class, PROPERTY_S3_SERVICE_PATH, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_service_path_fn); device_class_register_property(device_class, PROPERTY_S3_USER_TOKEN, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_user_token_fn); device_class_register_property(device_class, PROPERTY_S3_BUCKET_LOCATION, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_bucket_location_fn); device_class_register_property(device_class, PROPERTY_S3_STORAGE_CLASS, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_storage_class_fn); device_class_register_property(device_class, PROPERTY_S3_SERVER_SIDE_ENCRYPTION, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_server_side_encryption_fn); device_class_register_property(device_class, PROPERTY_PROXY, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_proxy_fn); device_class_register_property(device_class, PROPERTY_SSL_CA_INFO, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_ca_info_fn); device_class_register_property(device_class, PROPERTY_VERBOSE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_verbose_fn); device_class_register_property(device_class, PROPERTY_CREATE_BUCKET, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_create_bucket_fn); device_class_register_property(device_class, PROPERTY_STORAGE_API, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_storage_api); device_class_register_property(device_class, PROPERTY_OPENSTACK_SWIFT_API, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_openstack_swift_api_fn); device_class_register_property(device_class, PROPERTY_S3_MULTI_DELETE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_s3_multi_delete_fn); device_class_register_property(device_class, PROPERTY_S3_SSL, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_ssl_fn); device_class_register_property(device_class, PROPERTY_REUSE_CONNECTION, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_reuse_connection_fn); device_class_register_property(device_class, PROPERTY_TIMEOUT, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_timeout_fn); device_class_register_property(device_class, PROPERTY_MAX_SEND_SPEED, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_max_send_speed_fn); device_class_register_property(device_class, PROPERTY_MAX_RECV_SPEED, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_max_recv_speed_fn); device_class_register_property(device_class, PROPERTY_NB_THREADS_BACKUP, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_nb_threads_backup); device_class_register_property(device_class, PROPERTY_NB_THREADS_RECOVERY, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_nb_threads_recovery); device_class_register_property(device_class, PROPERTY_COMPRESSION, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, NULL); device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, property_set_leom_fn); device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE, (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE), device_simple_property_get_fn, s3_device_set_max_volume_usage_fn); device_class_register_property(device_class, PROPERTY_ENFORCE_MAX_VOLUME_USAGE, (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE), device_simple_property_get_fn, s3_device_set_enforce_max_volume_usage_fn); device_class_register_property(device_class, PROPERTY_S3_SUBDOMAIN, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_use_subdomain_fn); device_class_register_property(device_class, PROPERTY_CLIENT_ID, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_client_id_fn); device_class_register_property(device_class, PROPERTY_CLIENT_SECRET, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_client_secret_fn); device_class_register_property(device_class, PROPERTY_REFRESH_TOKEN, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_refresh_token_fn); device_class_register_property(device_class, PROPERTY_PROJECT_ID, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_project_id_fn); device_class_register_property(device_class, PROPERTY_S3_REPS, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_reps_fn); device_class_register_property(device_class, PROPERTY_S3_REPS_BUCKET, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, s3_device_set_reps_bucket_fn); } static gboolean s3_device_set_access_key_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->access_key); self->access_key = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_secret_key_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->secret_key); self->secret_key = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_swift_account_id_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->swift_account_id); self->swift_account_id = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_swift_access_key_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->swift_access_key); self->swift_access_key = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_username(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->username); self->username = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_password(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->password); self->password = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_tenant_id(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->tenant_id); self->tenant_id = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_tenant_name(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->tenant_name); self->tenant_name = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_host_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->host); self->host = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_service_path_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->service_path); self->service_path = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_user_token_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->user_token); self->user_token = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_bucket_location_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); char *str_val = g_value_dup_string(val); if (str_val[0] && self->use_ssl && !s3_curl_location_compat()) { device_set_error(p_self, stralloc(_( "Location constraint given for Amazon S3 bucket, " "but libcurl is too old support wildcard certificates.")), DEVICE_STATUS_DEVICE_ERROR); goto fail; } if (str_val[0] && !s3_bucket_location_compat(self->bucket)) { device_set_error(p_self, g_strdup_printf(_( "Location constraint given for Amazon S3 bucket, " "but the bucket name (%s) is not usable as a subdomain."), self->bucket), DEVICE_STATUS_DEVICE_ERROR); goto fail; } amfree(self->bucket_location); self->bucket_location = str_val; device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); fail: g_free(str_val); return FALSE; } static gboolean s3_device_set_storage_class_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); char *str_val = g_value_dup_string(val); amfree(self->storage_class); self->storage_class = str_val; device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_server_side_encryption_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); char *str_val = g_value_dup_string(val); amfree(self->server_side_encryption); self->server_side_encryption = str_val; device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_proxy_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); char *str_val = g_value_dup_string(val); amfree(self->proxy); self->proxy = str_val; device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_ca_info_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->ca_info); self->ca_info = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_verbose_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); int thread; self->verbose = g_value_get_boolean(val); /* Our S3 handle may not yet have been instantiated; if so, it will * get the proper verbose setting when it is created */ if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].s3) s3_verbose(self->s3t[thread].s3, self->verbose); } } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_create_bucket_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); int thread; self->create_bucket = g_value_get_boolean(val); /* Our S3 handle may not yet have been instantiated; if so, it will * get the proper verbose setting when it is created */ if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].s3) s3_verbose(self->s3t[thread].s3, self->verbose); } } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_storage_api(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); const char *storage_api = g_value_get_string(val); if (g_str_equal(storage_api, "S3")) { self->s3_api = S3_API_S3; } else if (g_str_equal(storage_api, "SWIFT-1.0")) { self->s3_api = S3_API_SWIFT_1; } else if (g_str_equal(storage_api, "SWIFT-2.0")) { self->s3_api = S3_API_SWIFT_2; } else if (g_str_equal(storage_api, "OAUTH2")) { self->s3_api = S3_API_OAUTH2; } else if (g_str_equal(storage_api, "CASTOR")) { #if LIBCURL_VERSION_NUM >= 0x071301 curl_version_info_data *info; /* check the runtime version too */ info = curl_version_info(CURLVERSION_NOW); if (info->version_num >= 0x071301) { self->s3_api = S3_API_CASTOR; } else { device_set_error(p_self, g_strdup_printf(_( "Error setting STORAGE-API to castor " "(You must install libcurl 7.19.1 or newer)")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } #else device_set_error(p_self, g_strdup_printf(_( "Error setting STORAGE-API to castor " "This amanda is compiled with a too old libcurl, you must compile with libcurl 7.19.1 or newer")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; #endif } else { g_debug("Invalid STORAGE_API, using \"S3\"."); self->s3_api = S3_API_S3; } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_openstack_swift_api_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { const gboolean openstack_swift_api = g_value_get_boolean(val); if (openstack_swift_api) { GValue storage_api_val; g_value_init(&storage_api_val, G_TYPE_STRING); g_value_set_static_string(&storage_api_val, "SWIFT-1.0"); return s3_device_set_storage_api(p_self, base, &storage_api_val, surety, source); } return TRUE; } static gboolean s3_device_set_s3_multi_delete_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->use_s3_multi_delete = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_ssl_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); gboolean new_val; int thread; new_val = g_value_get_boolean(val); /* Our S3 handle may not yet have been instantiated; if so, it will * get the proper use_ssl setting when it is created */ if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].s3 && !s3_use_ssl(self->s3t[thread].s3, new_val)) { device_set_error(p_self, g_strdup_printf(_( "Error setting S3 SSL/TLS use " "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } } self->use_ssl = new_val; return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_reuse_connection_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->reuse_connection = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_timeout_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->timeout = g_value_get_uint64(val); if (self->timeout > 0 && self->timeout < 300) self->timeout = 300; return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_max_send_speed_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); guint64 new_val; int thread; new_val = g_value_get_uint64(val); if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].s3 && !s3_set_max_send_speed(self->s3t[thread].s3, new_val)) { device_set_error(p_self, g_strdup("Could not set S3 maximum send speed"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } } self->max_send_speed = new_val; return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_max_recv_speed_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); guint64 new_val; int thread; new_val = g_value_get_uint64(val); if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].s3 && !s3_set_max_recv_speed(self->s3t[thread].s3, new_val)) { device_set_error(p_self, g_strdup("Could not set S3 maximum recv speed"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } } self->max_recv_speed = new_val; return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_nb_threads_backup(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); guint64 new_val; new_val = g_value_get_uint64(val); self->nb_threads_backup = new_val; if (self->nb_threads_backup > self->nb_threads) { self->nb_threads = self->nb_threads_backup; } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_nb_threads_recovery(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); guint64 new_val; new_val = g_value_get_uint64(val); self->nb_threads_recovery = new_val; if (self->nb_threads_recovery > self->nb_threads) { self->nb_threads = self->nb_threads_recovery; } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->volume_limit = g_value_get_uint64(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_enforce_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->enforce_volume_limit = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_use_subdomain_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->use_subdomain = g_value_get_boolean(val); if (self->use_subdomain && !s3_bucket_location_compat(self->bucket)) { device_set_error(p_self, g_strdup_printf(_( "S3-SUBDOMAIN is set, " "but the bucket name (%s) is not usable as a subdomain."), self->bucket), DEVICE_STATUS_DEVICE_ERROR); self->use_subdomain = FALSE; return FALSE; } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean property_set_leom_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); self->leom = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_client_id_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->client_id); self->client_id = g_value_dup_string(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_client_secret_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->client_secret); self->client_secret = g_value_dup_string(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_refresh_token_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->refresh_token); self->refresh_token = g_value_dup_string(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_project_id_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->project_id); self->project_id = g_value_dup_string(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_reps_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->reps); self->reps = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean s3_device_set_reps_bucket_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { S3Device *self = S3_DEVICE(p_self); amfree(self->reps_bucket); self->reps_bucket = g_value_dup_string(val); device_clear_volume_details(p_self); return device_simple_property_set_fn(p_self, base, val, surety, source); } static Device* s3_device_factory(char * device_name, char * device_type, char * device_node) { Device *rval; g_assert(0 == strcmp(device_type, S3_DEVICE_NAME)); rval = DEVICE(g_object_new(TYPE_S3_DEVICE, NULL)); device_open_device(rval, device_name, device_type, device_node); return rval; } /* * Virtual function overrides */ static void s3_device_open_device(Device *pself, char *device_name, char * device_type, char * device_node) { S3Device *self = S3_DEVICE(pself); char * name_colon; GValue tmp_value; pself->min_block_size = S3_DEVICE_MIN_BLOCK_SIZE; pself->max_block_size = S3_DEVICE_MAX_BLOCK_SIZE; pself->block_size = S3_DEVICE_DEFAULT_BLOCK_SIZE; /* Device name may be bucket/prefix, to support multiple volumes in a * single bucket. */ name_colon = strchr(device_node, '/'); if (name_colon == NULL) { self->bucket = g_strdup(device_node); self->prefix = g_strdup(""); } else { self->bucket = g_strndup(device_node, name_colon - device_node); self->prefix = g_strdup(name_colon + 1); } if (self->bucket == NULL || self->bucket[0] == '\0') { device_set_error(pself, vstrallocf(_("Empty bucket name in device %s"), device_name), DEVICE_STATUS_DEVICE_ERROR); amfree(self->bucket); amfree(self->prefix); return; } if (self->reps == NULL) { self->reps = g_strdup(S3_DEVICE_REPS_DEFAULT); } if (self->reps_bucket == NULL) { self->reps_bucket = g_strdup(S3_DEVICE_REPS_BUCKET_DEFAULT); } g_debug(_("S3 driver using bucket '%s', prefix '%s'"), self->bucket, self->prefix); g_debug("curl version: %s", curl_version()); #ifdef LIBCURL_USE_OPENSSL g_debug("curl compiled for OPENSSL"); #else #if defined LIBCURL_USE_GNUTLS g_debug("curl compiled for GNUTLS"); #else g_debug("curl compiled for NSS"); #endif #endif /* default values */ self->verbose = FALSE; self->s3_api = S3_API_S3; /* use SSL if available */ self->use_ssl = s3_curl_supports_ssl(); bzero(&tmp_value, sizeof(GValue)); g_value_init(&tmp_value, G_TYPE_BOOLEAN); g_value_set_boolean(&tmp_value, self->use_ssl); device_set_simple_property(pself, device_property_s3_ssl.ID, &tmp_value, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); /* reuse connection */ self->reuse_connection = TRUE; bzero(&tmp_value, sizeof(GValue)); g_value_init(&tmp_value, G_TYPE_BOOLEAN); g_value_set_boolean(&tmp_value, self->reuse_connection); device_set_simple_property(pself, device_property_reuse_connection.ID, &tmp_value, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); /* timeout */ self->timeout = 0; bzero(&tmp_value, sizeof(GValue)); g_value_init(&tmp_value, G_TYPE_UINT64); g_value_set_uint64(&tmp_value, self->timeout); device_set_simple_property(pself, device_property_timeout.ID, &tmp_value, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); /* Set default create_bucket */ self->create_bucket = TRUE; bzero(&tmp_value, sizeof(GValue)); g_value_init(&tmp_value, G_TYPE_BOOLEAN); g_value_set_boolean(&tmp_value, self->create_bucket); device_set_simple_property(pself, device_property_create_bucket.ID, &tmp_value, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); if (parent_class->open_device) { parent_class->open_device(pself, device_name, device_type, device_node); } } static void s3_device_finalize(GObject * obj_self) { S3Device *self = S3_DEVICE (obj_self); int thread; if(G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); if (self->thread_pool_delete) { g_thread_pool_free(self->thread_pool_delete, 1, 1); self->thread_pool_delete = NULL; } if (self->thread_pool_write) { g_thread_pool_free(self->thread_pool_write, 1, 1); self->thread_pool_write = NULL; } if (self->thread_pool_read) { g_thread_pool_free(self->thread_pool_read, 1, 1); self->thread_pool_read = NULL; } if (self->thread_idle_mutex) { g_mutex_free(self->thread_idle_mutex); self->thread_idle_mutex = NULL; } if (self->thread_idle_cond) { g_cond_free(self->thread_idle_cond); self->thread_idle_cond = NULL; } if (self->s3t) { for (thread = 0; thread < self->nb_threads; thread++) { g_mutex_free(self->s3t[thread].now_mutex); if(self->s3t[thread].s3) s3_free(self->s3t[thread].s3); g_free(self->s3t[thread].curl_buffer.buffer); } g_free(self->s3t); } if(self->bucket) g_free(self->bucket); if(self->prefix) g_free(self->prefix); if(self->access_key) g_free(self->access_key); if(self->secret_key) g_free(self->secret_key); if(self->swift_account_id) g_free(self->swift_account_id); if(self->swift_access_key) g_free(self->swift_access_key); if(self->username) g_free(self->username); if(self->password) g_free(self->password); if(self->tenant_id) g_free(self->tenant_id); if(self->tenant_name) g_free(self->tenant_name); if(self->host) g_free(self->host); if(self->service_path) g_free(self->service_path); if(self->user_token) g_free(self->user_token); if(self->bucket_location) g_free(self->bucket_location); if(self->storage_class) g_free(self->storage_class); if(self->server_side_encryption) g_free(self->server_side_encryption); if(self->proxy) g_free(self->proxy); if(self->ca_info) g_free(self->ca_info); if(self->reps) g_free(self->reps); if(self->reps_bucket) g_free(self->reps_bucket); } static gboolean setup_handle(S3Device * self) { Device *d_self = DEVICE(self); int thread; guint response_code; s3_error_code_t s3_error_code; CURLcode curl_code; if (self->s3t == NULL) { if (self->s3_api == S3_API_S3) { if (self->access_key == NULL || self->access_key[0] == '\0') { device_set_error(d_self, g_strdup(_("No Amazon access key specified")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->secret_key == NULL || self->secret_key[0] == '\0') { device_set_error(d_self, g_strdup(_("No Amazon secret key specified")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else if (self->s3_api == S3_API_SWIFT_1) { if (self->swift_account_id == NULL || self->swift_account_id[0] == '\0') { device_set_error(d_self, g_strdup(_("No Swift account id specified")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->swift_access_key == NULL || self->swift_access_key[0] == '\0') { device_set_error(d_self, g_strdup(_("No Swift access key specified")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else if (self->s3_api == S3_API_SWIFT_2) { if (!((self->username && self->password && self->tenant_id) || (self->username && self->password && self->tenant_name) || (self->access_key && self->secret_key && self->tenant_id) || (self->access_key && self->secret_key && self->tenant_name))) { device_set_error(d_self, g_strdup(_("Missing authorization properties")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else if (self->s3_api == S3_API_OAUTH2) { if (self->client_id == NULL || self->client_id[0] == '\0') { device_set_error(d_self, g_strdup(_("Missing client_id properties")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->client_secret == NULL || self->client_secret[0] == '\0') { device_set_error(d_self, g_strdup(_("Missing client_secret properties")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->refresh_token == NULL || self->refresh_token[0] == '\0') { device_set_error(d_self, g_strdup(_("Missing refresh_token properties")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->project_id == NULL || self->project_id[0] == '\0') { device_set_error(d_self, g_strdup(_("Missing project_id properties")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else if (self->s3_api == S3_API_CASTOR) { self->use_s3_multi_delete = 0; self->use_subdomain = FALSE; if(self->service_path) { g_free(self->service_path); self->service_path = NULL; } } self->s3t = g_new0(S3_by_thread, self->nb_threads); if (self->s3t == NULL) { device_set_error(d_self, g_strdup(_("Can't allocate S3Handle array")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } self->thread_idle_cond = g_cond_new(); self->thread_idle_mutex = g_mutex_new(); for (thread = 0; thread < self->nb_threads; thread++) { self->s3t[thread].idle = 1; self->s3t[thread].done = 1; self->s3t[thread].eof = FALSE; self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS; self->s3t[thread].errmsg = NULL; self->s3t[thread].filename = NULL; self->s3t[thread].curl_buffer.buffer = NULL; self->s3t[thread].curl_buffer.buffer_len = 0; self->s3t[thread].now_mutex = g_mutex_new(); self->s3t[thread].s3 = s3_open(self->access_key, self->secret_key, self->swift_account_id, self->swift_access_key, self->host, self->service_path, self->use_subdomain, self->user_token, self->bucket_location, self->storage_class, self->ca_info, self->server_side_encryption, self->proxy, self->s3_api, self->username, self->password, self->tenant_id, self->tenant_name, self->client_id, self->client_secret, self->refresh_token, self->reuse_connection, self->timeout, self->reps, self->reps_bucket); if (self->s3t[thread].s3 == NULL) { device_set_error(d_self, stralloc(_("Internal error creating S3 handle")), DEVICE_STATUS_DEVICE_ERROR); self->nb_threads = thread+1; return FALSE; } } g_debug("Create %d threads", self->nb_threads); self->thread_pool_delete = g_thread_pool_new(s3_thread_delete_block, self, self->nb_threads, 0, NULL); self->thread_pool_write = g_thread_pool_new(s3_thread_write_block, self, self->nb_threads, 0, NULL); self->thread_pool_read = g_thread_pool_new(s3_thread_read_block, self, self->nb_threads, 0, NULL); for (thread = 0; thread < self->nb_threads; thread++) { s3_verbose(self->s3t[thread].s3, self->verbose); if (!s3_use_ssl(self->s3t[thread].s3, self->use_ssl)) { device_set_error(d_self, g_strdup_printf(_( "Error setting S3 SSL/TLS use " "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->max_send_speed && !s3_set_max_send_speed(self->s3t[thread].s3, self->max_send_speed)) { device_set_error(d_self, g_strdup("Could not set S3 maximum send speed"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (self->max_recv_speed && !s3_set_max_recv_speed(self->s3t[thread].s3, self->max_recv_speed)) { device_set_error(d_self, g_strdup("Could not set S3 maximum recv speed"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } for (thread = 0; thread < self->nb_threads; thread++) { if (!s3_open2(self->s3t[thread].s3)) { if (self->s3_api == S3_API_SWIFT_1 || self->s3_api == S3_API_SWIFT_2) { s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, &curl_code, NULL); device_set_error(d_self, g_strdup_printf(_("s3_open2 failed: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR); self->nb_threads = thread+1; return FALSE; } else { device_set_error(d_self, g_strdup("s3_open2 failed"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } } } return TRUE; } static gboolean make_bucket( Device * pself) { S3Device *self = S3_DEVICE(pself); guint response_code; s3_error_code_t s3_error_code; CURLcode curl_code; if (s3_is_bucket_exists(self->s3t[0].s3, self->bucket, self->project_id)) { return TRUE; } s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, &curl_code, NULL); if (response_code == 0 && s3_error_code == 0 && (curl_code == CURLE_COULDNT_CONNECT || curl_code == CURLE_COULDNT_RESOLVE_HOST)) { device_set_error(pself, g_strdup_printf(_("While connecting to S3 bucket: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (!self->create_bucket) { device_set_error(pself, g_strdup_printf(_("Can't list bucket: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (!s3_make_bucket(self->s3t[0].s3, self->bucket, self->project_id)) { s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); /* if it isn't an expected error (bucket already exists), * return FALSE */ if (response_code != 409 || (s3_error_code != S3_ERROR_BucketAlreadyExists && s3_error_code != S3_ERROR_BucketAlreadyOwnedByYou)) { device_set_error(pself, g_strdup_printf(_("While creating new S3 bucket: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } return TRUE; } static int progress_func( void *thread_data, double dltotal G_GNUC_UNUSED, double dlnow, double ultotal G_GNUC_UNUSED, double ulnow) { S3_by_thread *s3t = (S3_by_thread *)thread_data; g_mutex_lock(s3t->now_mutex); s3t->dlnow = dlnow; s3t->ulnow = ulnow; g_mutex_unlock(s3t->now_mutex); return 0; } static DeviceStatusFlags s3_device_read_label(Device *pself) { S3Device *self = S3_DEVICE(pself); char *key; CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE}; dumpfile_t *amanda_header; gboolean result; /* note that this may be called from s3_device_start, when * self->access_mode is not ACCESS_NULL */ amfree(pself->volume_label); amfree(pself->volume_time); dumpfile_free(pself->volume_header); pself->volume_header = NULL; if (device_in_error(self)) return pself->status; if (!setup_handle(self)) { /* setup_handle already set our error message */ return pself->status; } reset_thread(self); if (!make_bucket(pself)) { return pself->status; } key = special_file_to_key(self, "tapestart", -1); result = s3_read(self->s3t[0].s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL); g_free(key); if (!result) { guint response_code; s3_error_code_t s3_error_code; s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); /* if it's an expected error (not found), just return FALSE */ if (response_code == 404 && (s3_error_code == S3_ERROR_None || s3_error_code == S3_ERROR_Unknown || s3_error_code == S3_ERROR_NoSuchKey || s3_error_code == S3_ERROR_NoSuchEntity || s3_error_code == S3_ERROR_NoSuchBucket)) { g_debug(_("Amanda header not found while reading tapestart header (this is expected for empty tapes)")); device_set_error(pself, stralloc(_("Amanda header not found -- unlabeled volume?")), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_VOLUME_UNLABELED); return pself->status; } /* otherwise, log it and return */ device_set_error(pself, vstrallocf(_("While trying to read tapestart header: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return pself->status; } /* handle an empty file gracefully */ if (buf.buffer_len == 0) { device_set_error(pself, stralloc(_("Empty header file")), DEVICE_STATUS_VOLUME_ERROR); return pself->status; } pself->header_block_size = buf.buffer_len; g_assert(buf.buffer != NULL); amanda_header = g_new(dumpfile_t, 1); parse_file_header(buf.buffer, amanda_header, buf.buffer_pos); pself->volume_header = amanda_header; g_free(buf.buffer); if (amanda_header->type != F_TAPESTART) { device_set_error(pself, stralloc(_("Invalid amanda header")), DEVICE_STATUS_VOLUME_ERROR); return pself->status; } pself->volume_label = g_strdup(amanda_header->name); pself->volume_time = g_strdup(amanda_header->datestamp); /* pself->volume_header is already set */ device_set_error(pself, NULL, DEVICE_STATUS_SUCCESS); return pself->status; } static gboolean s3_device_start (Device * pself, DeviceAccessMode mode, char * label, char * timestamp) { S3Device * self; GSList *keys; guint64 total_size = 0; gboolean result; self = S3_DEVICE(pself); if (device_in_error(self)) return FALSE; if (!setup_handle(self)) { /* setup_handle already set our error message */ return FALSE; } reset_thread(self); pself->access_mode = mode; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); /* try creating the bucket, in case it doesn't exist */ if (!make_bucket(pself)) { return FALSE; } /* take care of any dirty work for this mode */ switch (mode) { case ACCESS_READ: if (pself->volume_label == NULL && s3_device_read_label(pself) != DEVICE_STATUS_SUCCESS) { /* s3_device_read_label already set our error message */ return FALSE; } break; case ACCESS_WRITE: if (!delete_all_files(self)) { return FALSE; } /* write a new amanda header */ if (!write_amanda_header(self, label, timestamp)) { return FALSE; } pself->volume_label = newstralloc(pself->volume_label, label); pself->volume_time = newstralloc(pself->volume_time, timestamp); /* unset the VOLUME_UNLABELED flag, if it was set */ device_set_error(pself, NULL, DEVICE_STATUS_SUCCESS); break; case ACCESS_APPEND: if (pself->volume_label == NULL && s3_device_read_label(pself) != DEVICE_STATUS_SUCCESS) { /* s3_device_read_label already set our error message */ return FALSE; } else { result = s3_list_keys(self->s3t[0].s3, self->bucket, NULL, NULL, &keys, &total_size); if(!result) { device_set_error(pself, vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_VOLUME_ERROR); return FALSE; } else { self->volume_bytes = total_size; } } return seek_to_end(self); break; case ACCESS_NULL: g_assert_not_reached(); } return TRUE; } static gboolean s3_device_finish ( Device * pself) { S3Device *self = S3_DEVICE(pself); reset_thread(self); /* we're not in a file anymore */ pself->access_mode = ACCESS_NULL; if (device_in_error(pself)) return FALSE; return TRUE; } /* functions for writing */ static guint64 s3_device_get_bytes_read( Device * pself) { S3Device *self = S3_DEVICE(pself); int thread; guint64 dltotal; g_mutex_unlock(pself->device_mutex); /* Add per thread */ g_mutex_lock(self->thread_idle_mutex); dltotal = self->dltotal; for (thread = 0; thread < self->nb_threads_recovery; thread++) { g_mutex_lock(self->s3t[thread].now_mutex); dltotal += self->s3t[thread].dlnow; g_mutex_unlock(self->s3t[thread].now_mutex); } g_mutex_unlock(self->thread_idle_mutex); g_mutex_lock(pself->device_mutex); return dltotal; } static guint64 s3_device_get_bytes_written( Device * pself) { S3Device *self = S3_DEVICE(pself); int thread; guint64 ultotal; g_mutex_unlock(pself->device_mutex); /* Add per thread */ g_mutex_lock(self->thread_idle_mutex); ultotal = self->ultotal; for (thread = 0; thread < self->nb_threads_backup; thread++) { g_mutex_lock(self->s3t[thread].now_mutex); ultotal += self->s3t[thread].ulnow; g_mutex_unlock(self->s3t[thread].now_mutex); } g_mutex_unlock(self->thread_idle_mutex); g_mutex_lock(pself->device_mutex); return ultotal; } static gboolean s3_device_start_file (Device *pself, dumpfile_t *jobInfo) { S3Device *self = S3_DEVICE(pself); CurlBuffer amanda_header = {NULL, 0, 0, 0}; gboolean result; size_t header_size; char *key; int thread; if (device_in_error(self)) return FALSE; reset_thread(self); pself->is_eom = FALSE; /* Set the blocksize to zero, since there's no header to skip (it's stored * in a distinct file, rather than block zero) */ jobInfo->blocksize = 0; /* Build the amanda header. */ header_size = 0; /* no minimum size */ amanda_header.buffer = device_build_amanda_header(pself, jobInfo, &header_size); if (amanda_header.buffer == NULL) { device_set_error(pself, stralloc(_("Amanda file header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } amanda_header.buffer_len = header_size; if(check_at_leom(self, header_size)) pself->is_eom = TRUE; if(check_at_peom(self, header_size)) { pself->is_eom = TRUE; device_set_error(pself, stralloc(_("No space left on device")), DEVICE_STATUS_DEVICE_ERROR); g_free(amanda_header.buffer); return FALSE; } for (thread = 0; thread < self->nb_threads; thread++) { self->s3t[thread].idle = 1; self->s3t[thread].ulnow = 0; } /* set the file and block numbers correctly */ pself->file = (pself->file > 0)? pself->file+1 : 1; pself->block = 0; g_mutex_lock(pself->device_mutex); pself->in_file = TRUE; pself->bytes_written = 0; g_mutex_unlock(pself->device_mutex); g_mutex_lock(self->thread_idle_mutex); self->ultotal = 0; g_mutex_unlock(self->thread_idle_mutex); /* write it out as a special block (not the 0th) */ key = special_file_to_key(self, "filestart", pself->file); result = s3_upload(self->s3t[0].s3, self->bucket, key, S3_BUFFER_READ_FUNCS, &amanda_header, NULL, NULL); g_free(amanda_header.buffer); g_free(key); if (!result) { device_set_error(pself, vstrallocf(_("While writing filestart header: %s"), s3_strerror(self->s3t[0].s3)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } self->volume_bytes += header_size; return TRUE; } static gboolean s3_device_write_block (Device * pself, guint size, gpointer data) { char *filename; S3Device * self = S3_DEVICE(pself); int idle_thread = 0; int thread = -1; int first_idle = -1; g_assert (self != NULL); g_assert (data != NULL); if (device_in_error(self)) return FALSE; if(check_at_leom(self, size)) pself->is_eom = TRUE; if(check_at_peom(self, size)) { pself->is_eom = TRUE; device_set_error(pself, stralloc(_("No space left on device")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } filename = file_and_block_to_key(self, pself->file, pself->block); g_mutex_lock(self->thread_idle_mutex); while (!idle_thread) { idle_thread = 0; for (thread = 0; thread < self->nb_threads_backup; thread++) { if (self->s3t[thread].idle == 1) { idle_thread++; /* Check if the thread is in error */ if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) { device_set_error(pself, (char *)self->s3t[thread].errmsg, self->s3t[thread].errflags); self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS; self->s3t[thread].errmsg = NULL; g_mutex_unlock(self->thread_idle_mutex); return FALSE; } if (first_idle == -1) { first_idle = thread; break; } } } if (!idle_thread) { g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); } } thread = first_idle; if (self->s3t[thread].curl_buffer.buffer && self->s3t[thread].curl_buffer.buffer_len < size) { g_free((char *)self->s3t[thread].curl_buffer.buffer); self->s3t[thread].curl_buffer.buffer = NULL; self->s3t[thread].curl_buffer.buffer_len = 0; self->s3t[thread].buffer_len = 0; } if (self->s3t[thread].curl_buffer.buffer == NULL) { self->s3t[thread].curl_buffer.buffer = g_try_malloc(size); if (self->s3t[thread].curl_buffer.buffer == NULL) { device_set_error(pself, g_strdup("Failed to allocate memory"), DEVICE_STATUS_DEVICE_ERROR); g_mutex_unlock(self->thread_idle_mutex); return FALSE; } self->s3t[thread].curl_buffer.buffer_len = size; self->s3t[thread].buffer_len = size; } self->s3t[thread].idle = 0; self->s3t[thread].done = 0; memcpy((char *)self->s3t[thread].curl_buffer.buffer, data, size); self->s3t[thread].curl_buffer.buffer_pos = 0; self->s3t[thread].curl_buffer.buffer_len = size; self->s3t[thread].curl_buffer.max_buffer_size = 0; self->s3t[thread].filename = filename; g_thread_pool_push(self->thread_pool_write, &self->s3t[thread], NULL); g_mutex_unlock(self->thread_idle_mutex); pself->block++; self->volume_bytes += size; return TRUE; } static void s3_thread_write_block( gpointer thread_data, gpointer data) { S3_by_thread *s3t = (S3_by_thread *)thread_data; Device *pself = (Device *)data; S3Device *self = S3_DEVICE(pself); gboolean result; result = s3_upload(s3t->s3, self->bucket, (char *)s3t->filename, S3_BUFFER_READ_FUNCS, (CurlBuffer *)&s3t->curl_buffer, progress_func, s3t); g_free((void *)s3t->filename); s3t->filename = NULL; if (!result) { s3t->errflags = DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR; s3t->errmsg = g_strdup_printf(_("While writing data block to S3: %s"), s3_strerror(s3t->s3)); } g_mutex_lock(self->thread_idle_mutex); s3t->idle = 1; s3t->done = 1; if (result) self->ultotal += s3t->curl_buffer.buffer_len; s3t->curl_buffer.buffer_len = s3t->buffer_len; s3t->ulnow = 0; g_cond_broadcast(self->thread_idle_cond); g_mutex_unlock(self->thread_idle_mutex); } static gboolean s3_device_finish_file (Device * pself) { S3Device *self = S3_DEVICE(pself); /* Check all threads are done */ int idle_thread = 0; int thread; if (!pself->in_file) return TRUE; g_mutex_lock(self->thread_idle_mutex); while (idle_thread != self->nb_threads) { idle_thread = 0; for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].idle == 1) { idle_thread++; } /* check thread status */ if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) { device_set_error(pself, (char *)self->s3t[thread].errmsg, self->s3t[thread].errflags); self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS; self->s3t[thread].errmsg = NULL; } } if (idle_thread != self->nb_threads) { g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); } } self->ultotal = 0; g_mutex_unlock(self->thread_idle_mutex); /* we're not in a file anymore */ g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; pself->bytes_written = 0;; g_mutex_unlock(pself->device_mutex); if (pself->status != DEVICE_STATUS_SUCCESS) { return FALSE; } return TRUE; } static gboolean s3_device_recycle_file(Device *pself, guint file) { S3Device *self = S3_DEVICE(pself); if (device_in_error(self)) return FALSE; reset_thread(self); delete_file(self, file); s3_wait_thread_delete(self); return !device_in_error(self); /* delete_file already set our error message if necessary */ } static gboolean s3_device_erase(Device *pself) { S3Device *self = S3_DEVICE(pself); char *key = NULL; const char *errmsg = NULL; guint response_code; s3_error_code_t s3_error_code; if (!setup_handle(self)) { /* error set by setup_handle */ return FALSE; } reset_thread(self); key = special_file_to_key(self, "tapestart", -1); if (!s3_delete(self->s3t[0].s3, self->bucket, key)) { s3_error(self->s3t[0].s3, &errmsg, NULL, NULL, NULL, NULL, NULL); device_set_error(pself, stralloc(errmsg), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } g_free(key); dumpfile_free(pself->volume_header); pself->volume_header = NULL; if (!delete_all_files(self)) return FALSE; device_set_error(pself, g_strdup("Unlabeled volume"), DEVICE_STATUS_VOLUME_UNLABELED); if (self->create_bucket && !s3_delete_bucket(self->s3t[0].s3, self->bucket)) { s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); /* * ignore the error if the bucket isn't empty (there may be data from elsewhere) * or the bucket not existing (already deleted perhaps?) */ if (!( (response_code == 409 && s3_error_code == S3_ERROR_BucketNotEmpty) || (response_code == 404 && s3_error_code == S3_ERROR_NoSuchBucket))) { device_set_error(pself, stralloc(errmsg), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } self->volume_bytes = 0; return TRUE; } /* functions for reading */ static dumpfile_t* s3_device_seek_file(Device *pself, guint file) { S3Device *self = S3_DEVICE(pself); gboolean result; char *key; CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE}; dumpfile_t *amanda_header; const char *errmsg = NULL; int thread; if (device_in_error(self)) return NULL; reset_thread(self); pself->file = file; pself->is_eof = FALSE; pself->block = 0; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; pself->bytes_read = 0; g_mutex_unlock(pself->device_mutex); self->next_block_to_read = 0; g_mutex_lock(self->thread_idle_mutex); self->dltotal = 0; g_mutex_unlock(self->thread_idle_mutex); /* read it in */ key = special_file_to_key(self, "filestart", pself->file); result = s3_read(self->s3t[0].s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL); g_free(key); if (!result) { guint response_code; s3_error_code_t s3_error_code; s3_error(self->s3t[0].s3, &errmsg, &response_code, &s3_error_code, NULL, NULL, NULL); /* if it's an expected error (not found), check what to do. */ if (response_code == 404 && (s3_error_code == S3_ERROR_None || s3_error_code == S3_ERROR_NoSuchKey || s3_error_code == S3_ERROR_NoSuchEntity)) { int next_file; next_file = find_next_file(self, pself->file); if (next_file > 0) { /* Note short-circut of dispatcher. */ return s3_device_seek_file(pself, next_file); } else if (next_file == 0) { /* No next file. Check if we are one past the end. */ key = special_file_to_key(self, "filestart", pself->file - 1); result = s3_read(self->s3t[0].s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL); g_free(key); if (result) { /* pself->file, etc. are already correct */ return make_tapeend_header(); } else { device_set_error(pself, stralloc(_("Attempt to read past tape-end file")), DEVICE_STATUS_SUCCESS); return NULL; } } } else { /* An unexpected error occured finding out if we are the last file. */ device_set_error(pself, stralloc(errmsg), DEVICE_STATUS_DEVICE_ERROR); return NULL; } } /* and make a dumpfile_t out of it */ g_assert(buf.buffer != NULL); amanda_header = g_new(dumpfile_t, 1); fh_init(amanda_header); parse_file_header(buf.buffer, amanda_header, buf.buffer_pos); g_free(buf.buffer); switch (amanda_header->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: break; default: device_set_error(pself, stralloc(_("Invalid amanda header while reading file header")), DEVICE_STATUS_VOLUME_ERROR); g_free(amanda_header); return NULL; } for (thread = 0; thread < self->nb_threads; thread++) { self->s3t[thread].idle = 1; self->s3t[thread].eof = FALSE; self->s3t[thread].ulnow = 0; } g_mutex_lock(pself->device_mutex); pself->in_file = TRUE; g_mutex_unlock(pself->device_mutex); return amanda_header; } static gboolean s3_device_seek_block(Device *pself, guint64 block) { S3Device * self = S3_DEVICE(pself); if (device_in_error(pself)) return FALSE; reset_thread(self); pself->block = block; self->next_block_to_read = block; return TRUE; } static int s3_device_read_block (Device * pself, gpointer data, int *size_req) { S3Device * self = S3_DEVICE(pself); char *key; int thread; int done = 0; g_assert (self != NULL); if (device_in_error(self)) return -1; g_mutex_lock(self->thread_idle_mutex); /* start a read ahead for each thread */ for (thread = 0; thread < self->nb_threads_recovery; thread++) { S3_by_thread *s3t = &self->s3t[thread]; if (s3t->idle) { key = file_and_block_to_key(self, pself->file, self->next_block_to_read); s3t->filename = key; s3t->done = 0; s3t->idle = 0; s3t->eof = FALSE; s3t->dlnow = 0; s3t->ulnow = 0; s3t->errflags = DEVICE_STATUS_SUCCESS; if (self->s3t[thread].curl_buffer.buffer && (int)self->s3t[thread].curl_buffer.buffer_len < *size_req) { g_free(self->s3t[thread].curl_buffer.buffer); self->s3t[thread].curl_buffer.buffer = NULL; self->s3t[thread].curl_buffer.buffer_len = 0; self->s3t[thread].buffer_len = 0; } if (!self->s3t[thread].curl_buffer.buffer) { self->s3t[thread].curl_buffer.buffer = g_try_malloc(*size_req); if (self->s3t[thread].curl_buffer.buffer == NULL) { device_set_error(pself, stralloc("Failed to allocate memory"), DEVICE_STATUS_DEVICE_ERROR); g_mutex_unlock(self->thread_idle_mutex); return -1; } self->s3t[thread].curl_buffer.buffer_len = *size_req; self->s3t[thread].buffer_len = *size_req; } s3t->curl_buffer.buffer_pos = 0; s3t->curl_buffer.max_buffer_size = S3_DEVICE_MAX_BLOCK_SIZE; self->next_block_to_read++; g_thread_pool_push(self->thread_pool_read, s3t, NULL); } } /* get the file*/ key = file_and_block_to_key(self, pself->file, pself->block); g_assert(key != NULL); while (!done) { /* find which thread read the key */ for (thread = 0; thread < self->nb_threads_recovery; thread++) { S3_by_thread *s3t; s3t = &self->s3t[thread]; if (!s3t->idle && s3t->done && strcmp(key, (char *)s3t->filename) == 0) { if (s3t->eof) { /* return eof */ g_free(key); pself->is_eof = TRUE; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); device_set_error(pself, stralloc(_("EOF")), DEVICE_STATUS_SUCCESS); g_mutex_unlock(self->thread_idle_mutex); return -1; } else if (s3t->errflags != DEVICE_STATUS_SUCCESS) { /* return the error */ device_set_error(pself, (char *)s3t->errmsg, s3t->errflags); g_free(key); g_mutex_unlock(self->thread_idle_mutex); return -1; } else if ((guint)*size_req >= s3t->curl_buffer.buffer_pos) { /* return the buffer */ g_mutex_unlock(self->thread_idle_mutex); memcpy(data, s3t->curl_buffer.buffer, s3t->curl_buffer.buffer_pos); *size_req = s3t->curl_buffer.buffer_pos; g_free(key); s3t->idle = 1; g_free((char *)s3t->filename); pself->block++; done = 1; g_mutex_lock(self->thread_idle_mutex); break; } else { /* buffer not enough large */ *size_req = s3t->curl_buffer.buffer_len; g_free(key); g_mutex_unlock(self->thread_idle_mutex); return 0; } } } if (!done) { g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); } } /* start a read ahead for the thread */ for (thread = 0; thread < self->nb_threads_recovery; thread++) { S3_by_thread *s3t = &self->s3t[thread]; if (s3t->idle) { key = file_and_block_to_key(self, pself->file, self->next_block_to_read); s3t->filename = key; s3t->done = 0; s3t->idle = 0; s3t->eof = FALSE; s3t->dlnow = 0; s3t->ulnow = 0; s3t->errflags = DEVICE_STATUS_SUCCESS; if (!self->s3t[thread].curl_buffer.buffer) { self->s3t[thread].curl_buffer.buffer = g_try_malloc(*size_req); if (self->s3t[thread].curl_buffer.buffer == NULL) { device_set_error(pself, stralloc("Failed to allocate memory"), DEVICE_STATUS_DEVICE_ERROR); g_mutex_unlock(self->thread_idle_mutex); return -1; } self->s3t[thread].curl_buffer.buffer_len = *size_req; } s3t->curl_buffer.buffer_pos = 0; self->next_block_to_read++; g_thread_pool_push(self->thread_pool_read, s3t, NULL); } } g_mutex_unlock(self->thread_idle_mutex); if (device_in_error(self)) { return -1; } return *size_req; } static void s3_thread_read_block( gpointer thread_data, gpointer data) { S3_by_thread *s3t = (S3_by_thread *)thread_data; Device *pself = (Device *)data; S3Device *self = S3_DEVICE(pself); gboolean result; result = s3_read(s3t->s3, self->bucket, (char *)s3t->filename, S3_BUFFER_WRITE_FUNCS, (CurlBuffer *)&s3t->curl_buffer, progress_func, s3t); g_mutex_lock(self->thread_idle_mutex); if (!result) { guint response_code; s3_error_code_t s3_error_code; s3_error(s3t->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); /* if it's an expected error (not found), just return -1 */ if (response_code == 404 && (s3_error_code == S3_ERROR_None || s3_error_code == S3_ERROR_Unknown || s3_error_code == S3_ERROR_NoSuchKey || s3_error_code == S3_ERROR_NoSuchEntity)) { s3t->eof = TRUE; } else { /* otherwise, log it and return FALSE */ s3t->errflags = DEVICE_STATUS_VOLUME_ERROR; s3t->errmsg = g_strdup_printf(_("While reading data block from S3: %s"), s3_strerror(s3t->s3)); } } else { self->dltotal += s3t->curl_buffer.buffer_len; } s3t->dlnow = 0; s3t->ulnow = 0; s3t->done = 1; g_cond_broadcast(self->thread_idle_cond); g_mutex_unlock(self->thread_idle_mutex); return; } static gboolean check_at_peom(S3Device *self, guint64 size) { if(self->enforce_volume_limit && (self->volume_limit > 0)) { guint64 newtotal = self->volume_bytes + size; if(newtotal > self->volume_limit) { return TRUE; } } return FALSE; } static gboolean check_at_leom(S3Device *self, guint64 size) { guint64 block_size = DEVICE(self)->block_size; guint64 eom_warning_buffer = block_size * (EOM_EARLY_WARNING_ZONE_BLOCKS + self->nb_threads); if(!self->leom) return FALSE; if(self->enforce_volume_limit && (self->volume_limit > 0)) { guint64 newtotal = self->volume_bytes + size + eom_warning_buffer; if(newtotal > self->volume_limit) { return TRUE; } } return FALSE; } static void reset_thread( S3Device *self) { int thread; int nb_done = 0; if (self->thread_idle_mutex) { g_mutex_lock(self->thread_idle_mutex); while(nb_done != self->nb_threads) { nb_done = 0; for (thread = 0; thread < self->nb_threads; thread++) { if (self->s3t[thread].done == 1) nb_done++; } if (nb_done != self->nb_threads) { g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex); } } g_mutex_unlock(self->thread_idle_mutex); } } amanda-3.3.6/device-src/xfer-source-recovery.c0000664000076400007640000005172012357250004022731 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "device.h" #include "property.h" #include "xfer-device.h" #include "arglist.h" #include "conffile.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_recovery() references * it directly. */ GType xfer_source_recovery_get_type(void); #define XFER_SOURCE_RECOVERY_TYPE (xfer_source_recovery_get_type()) #define XFER_SOURCE_RECOVERY(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_recovery_get_type(), XferSourceRecovery) #define XFER_SOURCE_RECOVERY_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_recovery_get_type(), XferSourceRecovery const) #define XFER_SOURCE_RECOVERY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_recovery_get_type(), XferSourceRecoveryClass) #define IS_XFER_SOURCE_RECOVERY(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_recovery_get_type ()) #define XFER_SOURCE_RECOVERY_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_recovery_get_type(), XferSourceRecoveryClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceRecovery { XferElement __parent__; /* thread for monitoring directtcp transfers */ GThread *thread; /* this mutex in this condition variable governs all variables below */ GCond *start_part_cond; GMutex *start_part_mutex; /* is this device currently paused and awaiting a new part? */ gboolean paused; /* device to read from (refcounted) */ Device *device; /* TRUE if use_device found the device unsuitable; this makes start_part * a no-op, allowing the cancellation to be handled normally */ gboolean device_bad; /* directtcp connection (only valid after XMSG_READY) */ DirectTCPConnection *conn; gboolean listen_ok; /* and the block size for that device (reset to zero at the start of each * part) */ size_t block_size; /* bytes read for this image */ guint64 bytes_read; /* part size (potentially including any zero-padding from the * device) */ guint64 part_size; /* timer for the duration; NULL while paused or cancelled */ GTimer *part_timer; gint64 size; GCond *abort_cond; /* condition to trigger to abort ndmp command */ } XferSourceRecovery; /* * Class definition */ typedef struct { XferElementClass __parent__; /* start reading the part at which DEVICE is positioned, sending an * XMSG_PART_DONE when the part has been read */ void (*start_part)(XferSourceRecovery *self, Device *device); /* use the given device, much like the same method for xfer-dest-taper */ void (*use_device)(XferSourceRecovery *self, Device *device); } XferSourceRecoveryClass; /* * Debug Logging */ #define DBG(LEVEL, ...) if (debug_recovery >= LEVEL) { _xsr_dbg(__VA_ARGS__); } static void _xsr_dbg(const char *fmt, ...) { va_list argp; char msg[1024]; arglist_start(argp, fmt); g_vsnprintf(msg, sizeof(msg), fmt, argp); arglist_end(argp); g_debug("XSR: %s", msg); } /* * Implementation */ /* common code for both directtcp_listen_thread and directtcp_connect_thread; * this is called after self->conn is filled in and carries out the data * transfer over that connection. NOTE: start_part_mutex is HELD when this * function begins */ static gpointer directtcp_common_thread( XferSourceRecovery *self) { XferElement *elt = XFER_ELEMENT(self); char *errmsg = NULL; int result; /* send XMSG_READY to indicate it's OK to call start_part now */ DBG(2, "sending XMSG_READY"); xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0)); /* now we sit around waiting for signals to write a part */ while (1) { guint64 actual_size; XMsg *msg; while (self->paused && !elt->cancelled) { DBG(9, "waiting to be un-paused"); g_cond_wait(self->start_part_cond, self->start_part_mutex); } DBG(9, "done waiting"); if (elt->cancelled) { g_mutex_unlock(self->start_part_mutex); goto close_conn_and_send_done; } /* if the device is NULL, we're done */ if (!self->device) break; /* read the part */ self->part_timer = g_timer_new(); while (1) { DBG(2, "reading part from %s", self->device->device_name); result = device_read_to_connection(self->device, G_MAXUINT64, &actual_size, &elt->cancelled, self->start_part_mutex, self->abort_cond); if (result == 1 && !elt->cancelled) { xfer_cancel_with_error(elt, _("error reading from device: %s"), device_error_or_status(self->device)); g_mutex_unlock(self->start_part_mutex); goto close_conn_and_send_done; } else if (result == 2 || elt->cancelled) { g_mutex_unlock(self->start_part_mutex); goto close_conn_and_send_done; } /* break on EOF; otherwise do another read_to_connection */ if (self->device->is_eof) { break; } } DBG(2, "done reading part; sending XMSG_PART_DONE"); /* the device has signalled EOF (really end-of-part), so clean up instance * variables and report the EOP to the caller in the form of an xmsg */ msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = actual_size; msg->duration = g_timer_elapsed(self->part_timer, NULL); msg->partnum = 0; msg->fileno = self->device->file; msg->successful = TRUE; msg->eof = FALSE; self->paused = TRUE; g_object_unref(self->device); self->device = NULL; self->part_size = 0; self->block_size = 0; g_timer_destroy(self->part_timer); self->part_timer = NULL; xfer_queue_message(elt->xfer, msg); } g_mutex_unlock(self->start_part_mutex); close_conn_and_send_done: if (self->conn) { errmsg = directtcp_connection_close(self->conn); g_object_unref(self->conn); self->conn = NULL; if (errmsg) { xfer_cancel_with_error(elt, _("error closing DirectTCP connection: %s"), errmsg); wait_until_xfer_cancelled(elt->xfer); } } xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0)); return NULL; } static gpointer directtcp_connect_thread( gpointer data) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(data); XferElement *elt = XFER_ELEMENT(self); int result; DBG(1, "(this is directtcp_connect_thread)") /* first, we need to accept the incoming connection; we do this while * holding the start_part_mutex, so that a part doesn't get started until * we're finished with the device */ g_mutex_lock(self->start_part_mutex); if (elt->cancelled) { g_mutex_unlock(self->start_part_mutex); goto send_done; } g_assert(self->device != NULL); /* have a device */ g_assert(elt->output_listen_addrs != NULL); /* listening on it */ g_assert(self->listen_ok); DBG(2, "accepting DirectTCP connection on device %s", self->device->device_name); result = device_accept(self->device, &self->conn, &elt->cancelled, self->start_part_mutex, self->abort_cond); if (result == 1 && !elt->cancelled) { xfer_cancel_with_error(elt, _("error accepting DirectTCP connection: %s"), device_error_or_status(self->device)); g_mutex_unlock(self->start_part_mutex); wait_until_xfer_cancelled(elt->xfer); goto send_done; } else if (result == 2 || elt->cancelled) { g_mutex_unlock(self->start_part_mutex); goto send_done; } DBG(2, "DirectTCP connection accepted"); return directtcp_common_thread(self); send_done: xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0)); return NULL; } static gpointer directtcp_listen_thread( gpointer data) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(data); XferElement *elt = XFER_ELEMENT(self); int result; DBG(1, "(this is directtcp_listen_thread)"); /* we need to make an outgoing connection to downstream; we do this while * holding the start_part_mutex, so that a part doesn't get started until * we're finished with the device */ g_mutex_lock(self->start_part_mutex); if (elt->cancelled) { g_mutex_unlock(self->start_part_mutex); goto send_done; } g_assert(self->device != NULL); /* have a device */ g_assert(elt->downstream->input_listen_addrs != NULL); /* downstream listening */ DBG(2, "making DirectTCP connection on device %s", self->device->device_name); result = device_connect(self->device, FALSE, elt->downstream->input_listen_addrs, &self->conn, &elt->cancelled, self->start_part_mutex, self->abort_cond); if (result == 1 && !elt->cancelled) { xfer_cancel_with_error(elt, _("error making DirectTCP connection: %s"), device_error_or_status(self->device)); g_mutex_unlock(self->start_part_mutex); wait_until_xfer_cancelled(elt->xfer); goto send_done; } else if (result == 2 || elt->cancelled) { g_mutex_unlock(self->start_part_mutex); wait_until_xfer_cancelled(elt->xfer); goto send_done; } DBG(2, "DirectTCP connect succeeded"); return directtcp_common_thread(self); send_done: xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0)); return NULL; } static gboolean setup_impl( XferElement *elt) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); if (elt->output_mech == XFER_MECH_DIRECTTCP_CONNECT) { g_assert(self->device != NULL); DBG(2, "listening for DirectTCP connection on device %s", self->device->device_name); if (!device_listen(self->device, FALSE, &elt->output_listen_addrs)) { xfer_cancel_with_error(elt, _("error listening for DirectTCP connection: %s"), device_error_or_status(self->device)); return FALSE; } self->listen_ok = TRUE; } else { /* no output_listen_addrs for either XFER_MECH_DIRECTTCP_LISTEN or * XFER_MECH_PULL_BUFFER */ elt->output_listen_addrs = NULL; } return TRUE; } static gboolean start_impl( XferElement *elt) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); if (elt->output_mech == XFER_MECH_DIRECTTCP_CONNECT) { g_assert(elt->output_listen_addrs != NULL); self->thread = g_thread_create(directtcp_connect_thread, (gpointer)self, FALSE, NULL); return TRUE; /* we'll send XMSG_DONE */ } else if (elt->output_mech == XFER_MECH_DIRECTTCP_LISTEN) { g_assert(elt->output_listen_addrs == NULL); self->thread = g_thread_create(directtcp_listen_thread, (gpointer)self, FALSE, NULL); return TRUE; /* we'll send XMSG_DONE */ } else { /* nothing to prepare for - we're ready already! */ DBG(2, "not using DirectTCP: sending XMSG_READY immediately"); xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0)); return FALSE; /* we won't send XMSG_DONE */ } } static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); gpointer buf = NULL; int result; int devsize; XMsg *msg; g_assert(elt->output_mech == XFER_MECH_PULL_BUFFER); g_mutex_lock(self->start_part_mutex); while (1) { /* make sure we have a device */ while (self->paused && !elt->cancelled) g_cond_wait(self->start_part_cond, self->start_part_mutex); /* indicate EOF on an cancel or when there are no more parts */ if (elt->cancelled || !self->device) { goto error; } /* start the timer if this is the first pull_buffer of this part */ if (!self->part_timer) { DBG(2, "first pull_buffer of new part"); self->part_timer = g_timer_new(); } /* loop until we read a full block, in case the blocks are larger than * expected */ if (self->block_size == 0) self->block_size = (size_t)self->device->block_size; do { buf = g_malloc(self->block_size); if (buf == NULL) { xfer_cancel_with_error(elt, _("%s: cannot allocate memory"), self->device->device_name); g_mutex_unlock(self->start_part_mutex); wait_until_xfer_cancelled(elt->xfer); goto error_unlocked; } devsize = (int)self->block_size; result = device_read_block(self->device, buf, &devsize); *size = devsize; if (result == 0) { g_assert(*size > self->block_size); self->block_size = devsize; amfree(buf); } } while (result == 0); /* if this block was successful, return it */ if (result > 0) { self->part_size += *size; break; } if (result < 0) { amfree(buf); /* if we're not at EOF, it's an error */ if (!self->device->is_eof) { xfer_cancel_with_error(elt, _("error reading from %s: %s"), self->device->device_name, device_error_or_status(self->device)); g_mutex_unlock(self->start_part_mutex); wait_until_xfer_cancelled(elt->xfer); goto error_unlocked; } /* the device has signalled EOF (really end-of-part), so clean up instance * variables and report the EOP to the caller in the form of an xmsg */ DBG(2, "pull_buffer hit EOF; sending XMSG_PART_DONE"); msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = self->part_size; msg->duration = g_timer_elapsed(self->part_timer, NULL); msg->partnum = 0; msg->fileno = self->device->file; msg->successful = TRUE; msg->eof = FALSE; self->paused = TRUE; g_object_unref(self->device); self->device = NULL; self->bytes_read += self->part_size; self->part_size = 0; self->block_size = 0; if (self->part_timer) { g_timer_destroy(self->part_timer); self->part_timer = NULL; } /* don't queue the XMSG_PART_DONE until we've adjusted all of our * instance variables appropriately */ xfer_queue_message(elt->xfer, msg); } } g_mutex_unlock(self->start_part_mutex); if (elt->size > 0) { /* initialize on first pass */ if (self->size == 0) self->size = elt->size; if (self->size == -1) { *size = 0; amfree(buf); return NULL; } if (*size > (guint64)self->size) { /* return only self->size bytes */ *size = self->size; self->size = -1; } else { self->size -= *size; } } return buf; error: g_mutex_unlock(self->start_part_mutex); error_unlocked: *size = 0; return NULL; } static gboolean cancel_impl( XferElement *elt, gboolean expect_eof G_GNUC_UNUSED) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); elt->cancelled = TRUE; /* trigger the condition variable, in case the thread is waiting on it */ g_mutex_lock(self->start_part_mutex); g_cond_broadcast(self->start_part_cond); g_cond_broadcast(self->abort_cond); g_mutex_unlock(self->start_part_mutex); return TRUE; } static void start_part_impl( XferSourceRecovery *self, Device *device) { g_assert(!device || device->in_file); DBG(2, "start_part called"); if (self->device_bad) { /* use_device didn't like the device it got, but the xfer cancellation * has not completed yet, so do nothing */ return; } g_mutex_lock(self->start_part_mutex); /* make sure we're ready to go */ g_assert(self->paused); if (XFER_ELEMENT(self)->output_mech == XFER_MECH_DIRECTTCP_CONNECT || XFER_ELEMENT(self)->output_mech == XFER_MECH_DIRECTTCP_LISTEN) { g_assert(self->conn != NULL); } /* if we already have a device, it should have been given to use_device */ if (device && self->device) g_assert(self->device == device); if (self->device) g_object_unref(self->device); if (device) g_object_ref(device); self->device = device; self->paused = FALSE; DBG(2, "triggering condition variable"); g_cond_broadcast(self->start_part_cond); g_mutex_unlock(self->start_part_mutex); } static void use_device_impl( XferSourceRecovery *xdtself, Device *device) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(xdtself); g_assert(self->paused); /* short-circuit if nothing is changing */ if (self->device == device) return; if (self->device) g_object_unref(self->device); self->device = NULL; /* if we already have a connection, then make this device use it */ if (self->conn) { if (!device_use_connection(device, self->conn)) { /* queue up an error for later, and set device_bad. * start_part will see this and fail silently */ self->device_bad = TRUE; xfer_cancel_with_error(XFER_ELEMENT(self), _("Cannot continue onto new volume: %s"), device_error_or_status(device)); return; } } self->device = device; g_object_ref(device); } static xfer_element_mech_pair_t * get_mech_pairs_impl( XferElement *elt) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); static xfer_element_mech_pair_t basic_mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 1, 0}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; static xfer_element_mech_pair_t directtcp_mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, 0, 1}, { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, 0, 1}, /* devices which support DirectTCP are usually not very efficient * at delivering data via device_read_block, so this counts an extra * byte operation in the cost metrics (2 here vs. 1 in basic_mech_pairs). * This is a hack, but it will do for now. */ { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 2, 0}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; return device_directtcp_supported(self->device)? directtcp_mech_pairs : basic_mech_pairs; } static void finalize_impl( GObject * obj_self) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(obj_self); if (self->conn) g_object_unref(self->conn); if (self->device) g_object_unref(self->device); g_cond_free(self->start_part_cond); g_cond_free(self->abort_cond); g_mutex_free(self->start_part_mutex); } static void instance_init( XferElement *elt) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); self->paused = TRUE; self->start_part_cond = g_cond_new(); self->abort_cond = g_cond_new(); self->start_part_mutex = g_mutex_new(); } static void class_init( XferSourceRecoveryClass * xsr_klass) { XferElementClass *klass = XFER_ELEMENT_CLASS(xsr_klass); GObjectClass *gobject_klass = G_OBJECT_CLASS(xsr_klass); klass->pull_buffer = pull_buffer_impl; klass->cancel = cancel_impl; klass->start = start_impl; klass->setup = setup_impl; klass->get_mech_pairs = get_mech_pairs_impl; klass->perl_class = "Amanda::Xfer::Source::Recovery"; klass->mech_pairs = NULL; /* see get_mech_pairs_impl, above */ xsr_klass->start_part = start_part_impl; xsr_klass->use_device = use_device_impl; gobject_klass->finalize = finalize_impl; parent_class = g_type_class_peek_parent(xsr_klass); } GType xfer_source_recovery_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceRecoveryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceRecovery), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceRecovery", &info, 0); } return type; } /* * Public methods and stubs */ void xfer_source_recovery_start_part( XferElement *elt, Device *device) { XferSourceRecoveryClass *klass; g_assert(IS_XFER_SOURCE_RECOVERY(elt)); klass = XFER_SOURCE_RECOVERY_GET_CLASS(elt); klass->start_part(XFER_SOURCE_RECOVERY(elt), device); } /* create an element of this class; prototype is in xfer-device.h */ XferElement * xfer_source_recovery(Device *first_device) { XferSourceRecovery *self = (XferSourceRecovery *)g_object_new(XFER_SOURCE_RECOVERY_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); g_assert(first_device != NULL); g_object_ref(first_device); self->device = first_device; return elt; } void xfer_source_recovery_use_device( XferElement *elt, Device *device) { XferSourceRecoveryClass *klass; g_assert(IS_XFER_SOURCE_RECOVERY(elt)); klass = XFER_SOURCE_RECOVERY_GET_CLASS(elt); klass->use_device(XFER_SOURCE_RECOVERY(elt), device); } guint64 xfer_source_recovery_get_bytes_read( XferElement *elt) { XferSourceRecovery *self = XFER_SOURCE_RECOVERY(elt); guint64 bytes_read = self->bytes_read; if (self->device) bytes_read += device_get_bytes_read(self->device); return bytes_read; } amanda-3.3.6/device-src/activate-devpay.c0000664000076400007640000001614012357250004021716 0ustar00martineamartinea00000000000000/* This program creates the token and certificate files for Amazon Devpay's * Simple Token Service (STS). Right now you can then use those files with * the S3 device. */ #include "amanda.h" #include #include #include #include #include "base64.h" #include "s3.h" #define MAX_RESPONSE_SIZE (1024*1024) typedef struct { GString * user_token; GString * access_key; GString * secret_key; } Credentials; static void usage(void) { g_fprintf(stderr, "USAGE: activate-devpay KEY [ >> amanda.conf ]\n" " This tool uses an Amazon Devpay activation key to retrieve an\n" " user token, access key, and secret key for use with Amazon S3. Output\n" " is in a form suitable for placement in an Amanda configuration file\n"); exit(EXIT_FAILURE); } /* This function is **not** thread-safe. Sorry. */ static const char * parse_commandline(int argc, char ** argv) { if (argc != 2) { usage(); return NULL; } else { return argv[1]; } } static char * activation_url(const char *key) { char * url; char * encoded_key; encoded_key = curl_escape(key, 0); url = g_strdup_printf(STS_BASE_URL "?Action=ActivateDesktopProduct&ActivationKey=%s&ProductToken=" STS_PRODUCT_TOKEN "&Version=2007-06-05", encoded_key); curl_free(encoded_key); return url; } /* This function is a CURLOPT_WRITEFUNCTION and a wrapper for g_markup_parse_context_parse(). It's not very smart about errors. */ static size_t libcurl_gmarkup_glue(void *ptr, size_t size1, size_t size2, void *stream) { GMarkupParseContext *context = stream; /* If this overflows, we have real problems, because we are expected to * return the result of this multiplication in a size_t. */ size_t read_size = size1 * size2; GError * error = NULL; read_size = size1 * size2; if (g_markup_parse_context_parse(context, ptr, read_size, &error)) { return read_size; } else { if (error == NULL) { g_fprintf(stderr, "Internal error parsing XML.\n"); } else { g_fprintf(stderr, "Error parsing XML: %s\n", error->message); g_error_free(error); } exit(EXIT_FAILURE); } } static void do_server_stuff(const char * key, GMarkupParseContext * parser) { char * url; CURL* handle; char curl_error_buffer[CURL_ERROR_SIZE]; handle = curl_easy_init(); curl_easy_setopt(handle, CURLOPT_NOPROGRESS, TRUE); curl_easy_setopt(handle, CURLOPT_NOSIGNAL, TRUE); curl_easy_setopt(handle, CURLOPT_AUTOREFERER, TRUE); curl_easy_setopt(handle, CURLOPT_ENCODING, ""); /* Support everything. */ #ifdef CURLOPT_MAXFILESIZE curl_easy_setopt(handle, CURLOPT_MAXFILESIZE, MAX_RESPONSE_SIZE); #endif curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, curl_error_buffer); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, libcurl_gmarkup_glue); curl_easy_setopt(handle, CURLOPT_WRITEDATA, parser); url = activation_url(key); curl_easy_setopt(handle, CURLOPT_URL, url); if (curl_easy_perform(handle) != 0) { g_error("Problem fetching data from server:\n%s", curl_error_buffer); exit(EXIT_FAILURE); } g_free(url); } static void parser_got_text(GMarkupParseContext * context, const char * text, size_t text_len, gpointer user_data, GError ** error) { Credentials * rval = user_data; const char * current_tag = g_markup_parse_context_get_element(context); g_assert(rval != NULL); g_assert(*error == NULL); /* We use strrstr instead of strcmp because Amazon uses namespaces * that I don't want to deal with. */ if (g_strrstr(current_tag, "UserToken")) { g_string_append_len(rval->user_token, text, text_len); return; } else if (g_strrstr(current_tag, "AWSAccessKeyId")) { g_string_append_len(rval->access_key, text, text_len); return; } else if (g_strrstr(current_tag, "SecretAccessKey")) { g_string_append_len(rval->secret_key, text, text_len); return; } else if (g_strrstr(current_tag, "Code")) { /* Is it a code we know? */ if (strncmp(text, "ExpiredActivationKey", text_len) == 0) { g_set_error(error, G_MARKUP_ERROR, -1, "Activation key has expired; get a new one."); } else if (strncmp(text, "InvalidActivationKey", text_len) == 0) { g_set_error(error, G_MARKUP_ERROR, -1, "Activation key is not valid; double-check."); } else { /* Do nothing; wait for the message. */ } } else if (g_strrstr(current_tag, "Message")) { g_set_error(error, G_MARKUP_ERROR, -1, "%.*s", (int)text_len, text); } } static void parser_got_error(GMarkupParseContext * context G_GNUC_UNUSED, GError * error, gpointer user_data G_GNUC_UNUSED) { g_fprintf (stderr, "Problem with Amazon response: %s\n", error->message); exit(EXIT_FAILURE); } static GMarkupParseContext * parser_init(Credentials * credentials) { static const GMarkupParser parser_settings = { NULL, /* start_element */ NULL, /* end_element */ parser_got_text, /* text */ NULL, /* passthrough */ parser_got_error /* error */ }; bzero(credentials, sizeof(*credentials)); credentials->user_token = g_string_new(""); credentials->access_key = g_string_new(""); credentials->secret_key = g_string_new(""); return g_markup_parse_context_new(&parser_settings, 0, credentials, NULL); } static void parser_cleanup(GMarkupParseContext * context) { GError * error = NULL; g_markup_parse_context_end_parse(context, &error); if (error != NULL) { g_fprintf (stderr, "Unexpected end of Amazon response: %s\n", error->message); exit(EXIT_FAILURE); } g_markup_parse_context_free(context); } /* This function is responsible for the whole output thing. */ static void do_output(Credentials * rare) { if (rare == NULL || rare->user_token == NULL || !rare->user_token->len || rare->access_key == NULL || !rare->access_key->len || rare->secret_key == NULL || !rare->secret_key->len) { g_fprintf(stderr, "Missing authentication data in response!\n"); exit(EXIT_FAILURE); } g_printf("device-property \"S3_USER_TOKEN\" \"%s\"\n" "device-property \"S3_ACCESS_KEY\" \"%s\"\n" "device-property \"S3_SECRET_KEY\" \"%s\"\n", rare->user_token->str, rare->access_key->str, rare->secret_key->str); } int main(int argc, char ** argv) { const char * key; GMarkupParseContext * parser; Credentials credentials; key = parse_commandline(argc, argv); curl_global_init(CURL_GLOBAL_ALL); parser = parser_init(&credentials); do_server_stuff(key, parser); curl_global_cleanup(); parser_cleanup(parser); do_output(&credentials); return 0; } amanda-3.3.6/device-src/xfer-source-device.c0000664000076400007640000001175012357250004022331 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "device.h" #include "property.h" #include "xfer-device.h" /* * Class declaration * * This declaration is entirely private; nothing but xfer_source_device() references * it directly. */ GType xfer_source_device_get_type(void); #define XFER_SOURCE_DEVICE_TYPE (xfer_source_device_get_type()) #define XFER_SOURCE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_device_get_type(), XferSourceDevice) #define XFER_SOURCE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_source_device_get_type(), XferSourceDevice const) #define XFER_SOURCE_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_source_device_get_type(), XferSourceDeviceClass) #define IS_XFER_SOURCE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_source_device_get_type ()) #define XFER_SOURCE_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_source_device_get_type(), XferSourceDeviceClass) static GObjectClass *parent_class = NULL; /* * Main object structure */ typedef struct XferSourceDevice { XferElement __parent__; Device *device; size_t block_size; gboolean cancelled; } XferSourceDevice; /* * Class definition */ typedef struct { XferElementClass __parent__; } XferSourceDeviceClass; /* * Implementation */ static gpointer pull_buffer_impl( XferElement *elt, size_t *size) { XferSourceDevice *self = (XferSourceDevice *)elt; gpointer buf = NULL; int result; int devsize; /* indicate EOF on an cancel */ if (elt->cancelled) { *size = 0; return NULL; } /* get the device block size */ if (self->block_size == 0) { self->block_size = self->device->block_size; } do { buf = g_try_malloc(self->block_size); if (buf == NULL) { xfer_cancel_with_error(elt, _("%s: cannot allocate memory"), self->device->device_name); wait_until_xfer_cancelled(elt->xfer); return NULL; } devsize = (int)self->block_size; result = device_read_block(self->device, buf, &devsize); *size = devsize; /* if the buffer was too small, loop around again */ if (result == 0) { g_assert(*size > self->block_size); self->block_size = devsize; amfree(buf); } } while (result == 0); if (result < 0) { amfree(buf); /* if we're not at EOF, it's an error */ if (!self->device->is_eof) { xfer_cancel_with_error(elt, _("error reading from %s: %s"), self->device->device_name, device_error_or_status(self->device)); wait_until_xfer_cancelled(elt->xfer); } *size = 0; return NULL; } return buf; } static void instance_init( XferElement *elt) { elt->can_generate_eof = TRUE; } static void class_init( XferSourceDeviceClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 0, 1}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; klass->pull_buffer = pull_buffer_impl; klass->perl_class = "Amanda::Xfer::Source::Device"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } GType xfer_source_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferSourceDeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferSourceDevice), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_ELEMENT_TYPE, "XferSourceDevice", &info, 0); } return type; } /* create an element of this class; prototype is in xfer-device.h */ XferElement * xfer_source_device( Device *device) { XferSourceDevice *self = (XferSourceDevice *)g_object_new(XFER_SOURCE_DEVICE_TYPE, NULL); XferElement *elt = XFER_ELEMENT(self); g_assert(device != NULL); self->device = device; return elt; } amanda-3.3.6/device-src/s3-util.h0000664000076400007640000000625712357250004020145 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef __S3_UTIL_H__ #define __S3_UTIL_H__ #ifdef HAVE_REGEX_H # ifdef HAVE_SYS_TYPES_H # include # endif #include #endif #include /* * Constants */ /* number of raw bytes in MD5 hash */ #define S3_MD5_HASH_BYTE_LEN 16 /* length of an MD5 hash encoded as base64 (not including terminating NULL) */ #define S3_MD5_HASH_B64_LEN 25 /* length of an MD5 hash encoded as hexadecimal (not including terminating NULL) */ #define S3_MD5_HASH_HEX_LEN 32 /* * Types */ #ifndef HAVE_REGEX_H typedef GRegex* regex_t; typedef gint regoff_t; typedef struct { regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ } regmatch_t; typedef enum { REG_NOERROR = 0, /* Success. */ REG_NOMATCH /* Didn't find a match (for regexec). */ } reg_errcode_t; #endif /* * Functions */ #ifndef USE_GETTEXT /* we don't use gettextize, so hack around this ... */ #define _(str) (str) #endif /* * Wrapper around regexec to handle programmer errors. * Only returns if the regexec returns 0 (match) or REG_NOMATCH. * See regexec(3) documentation for the rest. */ int s3_regexec_wrap(regex_t *regex, const char *str, size_t nmatch, regmatch_t pmatch[], int eflags); #ifndef HAVE_AMANDA_H char* find_regex_substring(const char* base_string, const regmatch_t match); #endif /* * Encode bytes using Base-64 * * @note: GLib 2.12+ has a function for this (g_base64_encode) * but we support much older versions. gnulib does as well, but its * hard to use correctly (see its notes). * * @param to_enc: The data to encode. * @returns: A new, null-terminated string or NULL if to_enc is NULL. */ gchar* s3_base64_encode(const GByteArray *to_enc); /* * Encode bytes using hexadecimal * * @param to_enc: The data to encode. * @returns: A new, null-terminated string or NULL if to_enc is NULL. */ gchar* s3_hex_encode(const GByteArray *to_enc); /* * Compute the MD5 hash of a blob of data. * * @param to_hash: The data to compute the hash for. * @returns: A new GByteArray containing the MD5 hash of data or * NULL if to_hash is NULL. */ GByteArray* s3_compute_md5_hash(const GByteArray *to_hash); #endif amanda-3.3.6/device-src/amtapetype.pl0000664000076400007640000005504512357250004021201 0ustar00martineamartinea00000000000000#! @PERL@ # Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # This is a tool to examine a device and generate a reasonable tapetype # entry accordingly. use lib '@amperldir@'; use strict; use warnings; use File::Basename; use Getopt::Long; use Math::BigInt; use Amanda::BigIntCompat; use Amanda::Device qw( :constants ); use Amanda::Debug qw( :logging ); use Amanda::Util qw( :constants ); use Amanda::Config qw( :init :getconf config_dir_relative ); use Amanda::MainLoop; use Amanda::Xfer; use Amanda::Constants; use Amanda::Header; # command-line options my $opt_only_compression = 0; my $opt_blocksize; my $opt_tapetype_name = 'unknown-tapetype'; my $opt_force = 0; my $opt_label = "amtapetype-".(int rand 2**31); my $opt_device_name; my $opt_config; my $opt_property; # global "hint" from the compression heuristic as to how fast this # drive is. my $device_speed_estimate; # open up a device, optionally check its label on the first invocation, # and start it in ACCESS_WRITE. my $_label_checked = 0; sub open_device { my $device = Amanda::Device->new($opt_device_name); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die("Could not open device $opt_device_name: ".$device->error()."\n"); } if (!$device->configure(0)) { die("Errors configuring $opt_device_name: " . $device->error_or_status()); } if (defined $opt_blocksize) { $device->property_set('BLOCK_SIZE', $opt_blocksize) or die "Error setting blocksize: " . $device->error_or_status(); } if (!$opt_force and !$_label_checked) { my $read_label_status = $device->read_label(); if ($read_label_status & $DEVICE_STATUS_VOLUME_UNLABELED) { # unlabeled is OK } elsif ($read_label_status != $DEVICE_STATUS_SUCCESS) { die "Error reading label: " . $device->error_or_status(); } elsif ($device->volume_label) { die "Volume in device $opt_device_name has Amanda label '" . $device->volume_label . "'. Giving up."; } $_label_checked = 1; } my $start_time = time; my $retries = 0; my $backoff = 1; while (1) { last if ($device->start($ACCESS_WRITE, $opt_label, undef)); if (!($device->status & $DEVICE_STATUS_DEVICE_BUSY)) { die("Error writing label '$opt_label': ". $device->error_or_status()); } if ($retries == 0) { print STDERR "Device is busy. Amtapetype will retry forever; hit ctrl-C to quit.\n"; } sleep($backoff); $backoff *= 2; $backoff = 120 if $backoff > 120; $retries++; } if ($retries) { my $elapsed = time - $start_time; print STDERR "Drive was busy for $elapsed seconds.\n"; print STDERR "If this device is used in a changer, you may want to set timeouts appropriately.\n"; } return $device; } # Write a single file to the device, and record the results in STATS. # write_one_file( # STATS => $stats_hashref, (see below) # DEVICE => $dev, (device to write to) # PATTERN => RANDOM or FIXED, (data pattern to write) # BYTES => nn, (number of bytes; optional) # MAX_TIME => secs); (cancel write after this time; optional) # # Returns 0 on success (including EOM), "TIMEOUT" on timeout, or an error message # on failure. # # STATS is a multi-level hashref; write_one_file adds to any values # already in the data structure. # $stats->{$pattern}->{TIME} - number of seconds spent writing # $stats->{$pattern}->{FILES} - number of files written # $stats->{$pattern}->{BYTES} - number of bytes written (approximate) # sub write_one_file(%) { my %options = @_; my $stats = $options{'STATS'} || { }; my $device = $options{'DEVICE'}; my $bytes = $options{'MAX_BYTES'} || 0; my $pattern = $options{'PATTERN'} || 'FIXED'; my $max_time = $options{'MAX_TIME'} || 0; # get the block size now, while the device is still working my $block_size = $device->property_get("block_size"); # start the device my $hdr = Amanda::Header->new(); $hdr->{type} = $Amanda::Header::F_DUMPFILE; $hdr->{name} = "amtapetype"; $hdr->{disk} = "/test"; $hdr->{datestamp} = "X"; $hdr->{program} = "AMTAPETYPE"; $device->start_file($hdr) or return $device->error_or_status(); # set up the transfer my ($source, $dest, $xfer); if ($pattern eq 'FIXED') { # a simple 256-byte pattern to dodge run length encoding. my $non_random_pattern = pack("C*", 0..255); $source = Amanda::Xfer::Source::Pattern->new($bytes, $non_random_pattern); } elsif ($pattern eq 'RANDOM') { $source = Amanda::Xfer::Source::Random->new($bytes, 1 + int rand 100); } else { die "Unknown PATTERN $pattern"; } $dest = Amanda::Xfer::Dest::Device->new($device, 1); $xfer = Amanda::Xfer->new([$source, $dest]); # set up the relevant callbacks my ($timeout_src, $spinner_src); my $got_error = 0; my $got_timeout = 0; if ($max_time) { $timeout_src = Amanda::MainLoop::timeout_source($max_time * 1000); $timeout_src->set_callback(sub { my ($src) = @_; $got_timeout = 1; $xfer->cancel(); # will result in an XFER_DONE }); } $spinner_src = Amanda::MainLoop::timeout_source(1000); $spinner_src->set_callback(sub { my ($src) = @_; my ($file, $block) = ($device->file(), $device->block()); print STDERR "File $file, block $block \r"; }); my $start_time = time(); $xfer->start(sub { my ($src, $xmsg, $xfer) = @_; if ($xmsg->{type} == $Amanda::Xfer::XMSG_ERROR) { $got_error = $xmsg->{message}; } elsif ($xmsg->{'type'} == $Amanda::Xfer::XMSG_DONE) { Amanda::MainLoop::quit(); } }); Amanda::MainLoop::run(); $spinner_src->remove(); $timeout_src->remove() if ($timeout_src); print STDERR " " x 60, "\r"; my $duration = time() - $start_time; # OK, we finished, update statistics (even if we saw an error) my $blocks_written = $device->block(); $stats->{$pattern}->{BYTES} += $blocks_written * $block_size; $stats->{$pattern}->{FILES} += 1; $stats->{$pattern}->{TIME} += $duration; # make sure the time is nonzero if ($stats->{$pattern}->{TIME} == 0) { $stats->{$pattern}->{TIME}++; } if ($device->status() != $Amanda::Device::DEVICE_STATUS_SUCCESS) { return $device->error_or_status(); } if ($got_error && $got_error =~ /LEOM detected/) { return "LEOM"; } if ($got_error) { return $got_error; } if ($got_timeout) { return "TIMEOUT"; } return 0; } sub check_compression { my $device = open_device(); # Check compression status here by property query. If the device can answer # the question, there's no reason to investigate further. my $compression_enabled = $device->property_get("compression"); if (defined $compression_enabled) { return $compression_enabled; } # Need to use heuristic to find out if compression is enabled. Also, we # rewind between passes so that the second pass doesn't get some kind of # buffering advantage. print STDERR "Applying heuristic check for compression.\n"; # We base our determination on whether it's faster to write random data or # patterned data. That starts by writing random data for a short length of # time, then measuring the elapsed time and total data written. Due to # potential delay in cancelling a transfer, the elapsed time will be a bit # longer than the intended time. We then write the same amount of # patterned data, and again measure the elapsed time. We can then # calculate the speeds of the two operations. If the compressible speed # was faster by more than min_ratio, then we assume compression is enabled. my $compression_check_time = 60; my $compression_check_min_ratio = 1.2; my $stats = { }; my $err = write_one_file( DEVICE => $device, STATS => $stats, MAX_TIME => $compression_check_time, PATTERN => 'RANDOM'); if ($err != 'TIMEOUT') { die $err; } $device->finish(); # speed calculations are a little tricky: BigInt * float comes out to NaN, so we # cast the BigInts to float first my $random_speed = ($stats->{RANDOM}->{BYTES} . "") / $stats->{RANDOM}->{TIME}; print STDERR "Wrote random (uncompressible) data at $random_speed bytes/sec\n"; # sock this away for make_tapetype's use $device_speed_estimate = $random_speed; # restart the device to clear any errors and rewind it $device = open_device(); $err = write_one_file( DEVICE => $device, STATS => $stats, MAX_BYTES => $stats->{'RANDOM'}->{'BYTES'}, PATTERN => 'FIXED'); if ($err) { die $err; } $device->finish(); my $fixed_speed = ($stats->{FIXED}->{BYTES} . "") / $stats->{FIXED}->{TIME}; print STDERR "Wrote fixed (compressible) data at $fixed_speed bytes/sec\n"; $compression_enabled = ($fixed_speed / $random_speed > $compression_check_min_ratio); return $compression_enabled; } sub data_to_null { my ($device) = @_; my $got_error = 0; my $xfer = Amanda::Xfer->new([ Amanda::Xfer::Source::Device->new($device), Amanda::Xfer::Dest::Null->new(0), ]); $xfer->start(sub { my ($src, $xmsg, $xfer) = @_; if ($xmsg->{type} == $Amanda::Xfer::XMSG_ERROR) { $got_error = $xmsg->{message}; } elsif ($xmsg->{'type'} == $Amanda::Xfer::XMSG_DONE) { Amanda::MainLoop::quit(); } }); Amanda::MainLoop::run(); } sub check_property { my $device = open_device(); print STDERR "Checking for FSF_AFTER_FILEMARK requirement\n"; my $fsf_after_filemark = $device->property_get("FSF_AFTER_FILEMARK"); # not a 'tape:' device return if !defined $fsf_after_filemark; $device->start($ACCESS_WRITE, "TEST-001", "20080706050403"); my $hdr = new Amanda::Header; $hdr->{type} = $Amanda::Header::F_DUMPFILE; $hdr->{name} = "localhost"; $hdr->{disk} = "/test1"; $hdr->{datestamp} = "20080706050403"; $hdr->{program} = "AMTAPETYPE"; $device->start_file($hdr); $device->finish_file(); $hdr->{type} = $Amanda::Header::F_DUMPFILE; $hdr->{name} = "localhost"; $hdr->{disk} = "/test2"; $hdr->{datestamp} = "20080706050403"; $hdr->{program} = "AMTAPETYPE"; $device->start_file($hdr); $device->finish_file(); $hdr->{type} = $Amanda::Header::F_DUMPFILE; $hdr->{name} = "localhost"; $hdr->{disk} = "/test3"; $hdr->{datestamp} = "20080706050403"; $hdr->{program} = "AMTAPETYPE"; $device->start_file($hdr); $device->finish_file(); $device->finish(); #set fsf_after_filemark to false $device->property_set('FSF_AFTER_FILEMARK', 0) or die "Error setting FSF_AFTER_FILEMARK: " . $device->error_or_status(); my $need_fsf_after_filemark = 0; if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(1); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(1) failed"); } if ($hdr->{disk} ne "/test1") { die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); } data_to_null($device); $hdr = $device->seek_file(2); if ($device->status() == $DEVICE_STATUS_SUCCESS) { if ($hdr->{disk} ne "/test2") { die ("Wrong disk: " . $hdr->{disk} . " expected /test2"); } data_to_null($device); $hdr = $device->seek_file(3); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die("seek_file(3) failed"); } if ($hdr->{disk} ne "/test3") { die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); } data_to_null($device); $device->finish(); } else { $need_fsf_after_filemark = 1; # $device is in error, so open a new one $device->finish(); $device = open_device(); } #verify need_fsf_after_filemark my $fsf_after_filemark_works = 0; if ($need_fsf_after_filemark) { #set fsf_after_filemark to true $device->property_set('FSF_AFTER_FILEMARK', 1) or die "Error setting FSF_AFTER_FILEMARK: " . $device->error_or_status(); if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(1); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(1) failed"); } if ($hdr->{disk} ne "/test1") { die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); } data_to_null($device); $hdr = $device->seek_file(2); if ($device->status() == $DEVICE_STATUS_SUCCESS) { if ($hdr->{disk} ne "/test2") { die ("Wrong disk: " . $hdr->{disk} . " expected /test2"); } data_to_null($device); $hdr = $device->seek_file(3); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die("seek_file(3) failed"); } if ($hdr->{disk} ne "/test3") { die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); } data_to_null($device); $fsf_after_filemark_works = 1; } else { die("seek_file(2) failed"); } $device->finish(); } if ($need_fsf_after_filemark == 0 && $fsf_after_filemark_works == 0) { if (defined $opt_property || $fsf_after_filemark) { print STDOUT "device-property \"FSF_AFTER_FILEMARK\" \"false\"\n"; } $device->property_set('FSF_AFTER_FILEMARK', 0); } elsif ($need_fsf_after_filemark == 1 && $fsf_after_filemark_works == 1) { if (defined $opt_property || !$fsf_after_filemark) { print STDOUT "device-property \"FSF_AFTER_FILEMARK\" \"true\"\n"; } $device->property_set('FSF_AFTER_FILEMARK', 1); } else { die ("Broken seek_file"); } #Check seek to file 1 from header if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(1); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(1) failed"); } if ($hdr->{disk} ne "/test1") { die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); } $device->finish(); #Check seek to file 2 from header if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(2); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(2) failed"); } if ($hdr->{disk} ne "/test2") { die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); } $device->finish(); #Check seek to file 3 from header if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(3); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(3) failed"); } if ($hdr->{disk} ne "/test3") { die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); } $device->finish(); #Check seek to file 3 from eof of 1 if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { die ("Could not read label from: " . $device->error_or_status()); } if ($device->volume_label != "TEST-001") { die ("wrong label: ", $device->volume_label); } $device->start($ACCESS_READ, undef, undef) or die ("Could not start device: " . $device->error_or_status()); $hdr = $device->seek_file(1); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(1) failed"); } data_to_null($device); $hdr = $device->seek_file(3); if ($device->status() != $DEVICE_STATUS_SUCCESS) { die ("seek_file(3) failed"); } if ($hdr->{disk} ne "/test3") { die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); } $device->finish(); } sub make_tapetype { my ($compression_enabled) = @_; my $device = open_device(); my $blocksize = $device->property_get("BLOCK_SIZE"); # First, write one very long file to get the total tape length print STDERR "Writing one file to fill the volume.\n"; my $stats = {}; my $err = write_one_file( DEVICE => $device, STATS => $stats, PATTERN => 'RANDOM'); # if we wrote almost no data, then there's probably a problem # with the device, so error out if ($stats->{RANDOM}->{BYTES} < 1024 * 1024) { die "Wrote less than 1MB to the device: $err\n"; } my $volume_size_estimate = $stats->{RANDOM}->{BYTES}; my $speed_estimate = (($stats->{RANDOM}->{BYTES}."") / 1024) / $stats->{RANDOM}->{TIME}; $speed_estimate = int $speed_estimate; print STDERR "Wrote $volume_size_estimate bytes at $speed_estimate kb/sec\n"; my $leom = 0; if ($err eq 'LEOM') { print STDERR "Got LEOM indication, so drive and kernel together support LEOM\n"; $leom = 1; } # now we want to write about 100 filemarks; round down to the blocksize # to avoid counting padding as part of the filemark my $file_size = $volume_size_estimate / 100; $file_size -= $file_size % $blocksize; print STDERR "Writing smaller files ($file_size bytes) to determine filemark.\n"; $device->finish(); $device = open_device(); # re-open to rewind and clear errors $stats = {}; while (!write_one_file( DEVICE => $device, STATS => $stats, MAX_BYTES => $file_size, PATTERN => 'RANDOM')) { } my $filemark_estimate = ($volume_size_estimate - $stats->{RANDOM}->{BYTES}) / ($stats->{RANDOM}->{FILES} - 1); if ($filemark_estimate < 0) { $filemark_estimate = 0; } my $comment = "Created by amtapetype; compression " . ($compression_enabled? "enabled" : "disabled"); # round these parameters to the nearest kb, since the parameters' units # are kb, not bytes my $volume_size_estimate_kb = $volume_size_estimate/1024; my $filemark_kb = $filemark_estimate/1024; # and suggest using device-property for blocksize if it's not an even multiple # of 1kb my $blocksize_line; if ($blocksize % 1024 == 0) { $blocksize_line = "blocksize " . $blocksize/1024 . " kbytes"; } else { $blocksize_line = "# add device-property \"BLOCK_SIZE\" \"$blocksize\" to the device"; } print < \&Amanda::Util::version_opt, 'help|usage|?|h' => \&usage, 'c' => \$opt_only_compression, 'b=s' => sub { my ($num, $suff) = ($_[1] =~ /^([0-9]+)\s*(.*)$/); die "Invalid blocksize '$_[1]'" unless (defined $num); my $mult = (defined $suff)? Amanda::Config::find_multiplier($suff) : 1; die "Invalid suffix '$suff'" unless ($mult); $opt_blocksize = $num * $mult; }, 't=s' => \$opt_tapetype_name, 'f' => \$opt_force, 'l' => \$opt_label, 'p' => \$opt_property, 'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); }, ) or usage(); usage() if (@ARGV < 1 or @ARGV > 2); set_config_overrides($config_overrides); if (@ARGV == 2) { $opt_config = shift @ARGV; config_init($CONFIG_INIT_EXPLICIT_NAME, $opt_config); } else { config_init(0, undef); } $opt_device_name= shift @ARGV; my ($cfgerr_level, @cfgerr_errors) = config_errors(); if ($cfgerr_level >= $CFGERR_WARNINGS) { config_print_errors(); if ($cfgerr_level >= $CFGERR_ERRORS) { die("errors processing config file"); } } Amanda::Util::finish_setup($RUNNING_AS_ANY); # Find property of the device. check_property(); if (!defined $opt_property) { my $compression_enabled = check_compression(); print STDERR "Compression: ", $compression_enabled? "enabled" : "disabled", "\n"; if ($compression_enabled and !$opt_force) { print STDERR "Turn off compression or run amtapetype with the -f option\n"; exit(1); } if (!$opt_only_compression) { make_tapetype($compression_enabled); } } Amanda::Util::finish_application(); amanda-3.3.6/device-src/property.c0000664000076400007640000002372012357250004020516 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "property.h" #include "glib-util.h" /***** * Property-specific Types, etc. */ static const GEnumValue _concurrency_paradigm_values[] = { { CONCURRENCY_PARADIGM_EXCLUSIVE, "CONCURRENCY_PARADIGM_EXCLUSIVE", "exclusive" }, { CONCURRENCY_PARADIGM_SHARED_READ, "CONCURRENCY_PARADIGM_SHARED_READ", "shared-read" }, { CONCURRENCY_PARADIGM_RANDOM_ACCESS, "CONCURRENCY_PARADIGM_RANDOM_ACCESS", "random-access" }, { 0, NULL, NULL } }; GType concurrency_paradigm_get_type (void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { type = g_enum_register_static ("ConcurrencyParadigm", _concurrency_paradigm_values); } return type; } static const GEnumValue _streaming_requirement_values[] = { { STREAMING_REQUIREMENT_NONE, "STREAMING_REQUIREMENT_NONE", "none" }, { STREAMING_REQUIREMENT_DESIRED, "STREAMING_REQUIREMENT_DESIRED", "desired" }, { STREAMING_REQUIREMENT_REQUIRED, "STREAMING_REQUIREMENT_REQUIRED", "required" }, { 0, NULL, NULL } }; GType streaming_requirement_get_type (void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { type = g_enum_register_static ("StreamingRequirement", _streaming_requirement_values); } return type; } static const GEnumValue _media_access_mode_values[] = { { MEDIA_ACCESS_MODE_READ_ONLY, "MEDIA_ACCESS_MODE_READ_ONLY", (char *)"read-only" }, { MEDIA_ACCESS_MODE_WORM, "MEDIA_ACCESS_MODE_WORM", (char *)"write-once-read-many" }, { MEDIA_ACCESS_MODE_READ_WRITE, "MEDIA_ACCESS_MODE_READ_WRITE", (char *)"read-write" }, { MEDIA_ACCESS_MODE_WRITE_ONLY, "MEDIA_ACCESS_MODE_WRITE_ONLY", (char *)"write-many-read-never" }, { 0, NULL, NULL } }; GType media_access_mode_get_type (void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { type = g_enum_register_static ("MediaAccessMode", _media_access_mode_values); } return type; } /****** * Property registration and lookup */ static GPtrArray *device_property_bases = NULL; static GHashTable *device_property_bases_by_name = NULL; DevicePropertyBase* device_property_get_by_id(DevicePropertyId id) { if (!device_property_bases || id >= device_property_bases->len) return NULL; return g_ptr_array_index(device_property_bases, id); } DevicePropertyBase* device_property_get_by_name(const char *name) { gpointer rv; if (!device_property_bases_by_name) return NULL; rv = g_hash_table_lookup(device_property_bases_by_name, name); if (rv) return (DevicePropertyBase *)rv; return NULL; } #define toupper_and_underscore(c) (((c)=='-')? '_' : g_ascii_toupper((c))) static guint device_property_hash( gconstpointer key) { /* modified version of glib's hash function, copyright * GLib Team and others 1997-2000. */ const char *p = key; guint h = toupper_and_underscore(*p); if (h) for (p += 1; *p != '\0'; p++) h = (h << 5) - h + toupper_and_underscore(*p); return h; } static gboolean device_property_equal( gconstpointer v1, gconstpointer v2) { const char *s1 = v1, *s2 = v2; while (*s1 && *s2) { if (toupper_and_underscore(*s1) != toupper_and_underscore(*s2)) return FALSE; s1++, s2++; } if (*s1 || *s2) return FALSE; return TRUE; } void device_property_fill_and_register(DevicePropertyBase *base, GType type, const char * name, const char * desc) { /* create the hash table and array if necessary */ if (!device_property_bases) { device_property_bases = g_ptr_array_new(); device_property_bases_by_name = g_hash_table_new(device_property_hash, device_property_equal); } /* check for a duplicate */ if (device_property_get_by_name(name)) { g_critical("A property named '%s' already exists!", name); } /* allocate space for this DPB and fill it in */ base->ID = device_property_bases->len; base->type = type; base->name = name; /* no strdup -- it's statically allocated */ base->description = desc; /* ditto */ /* add it to the array and hash table; note that its array index and its * ID are the same. */ g_ptr_array_add(device_property_bases, base); g_hash_table_insert(device_property_bases_by_name, (gpointer)name, (gpointer)base); } /****** * Initialization */ void device_property_init(void) { device_property_fill_and_register(&device_property_concurrency, CONCURRENCY_PARADIGM_TYPE, "concurrency", "Supported concurrency mode (none, multiple readers, multiple writers)"); device_property_fill_and_register(&device_property_streaming, STREAMING_REQUIREMENT_TYPE, "streaming", "Streaming desirability (unnecessary, desired, required)"); device_property_fill_and_register(&device_property_compression, G_TYPE_BOOLEAN, "compression", "Is device performing data compression?"); device_property_fill_and_register(&device_property_compression_rate, G_TYPE_DOUBLE, "compression_rate", "Compression rate, " "averaged for some (currently undefined) period of time)"); device_property_fill_and_register(&device_property_block_size, G_TYPE_INT, "block_size", "Block size to use while writing."); device_property_fill_and_register(&device_property_min_block_size, G_TYPE_UINT, "min_block_size", "Minimum supported blocking factor."); device_property_fill_and_register(&device_property_max_block_size, G_TYPE_UINT, "max_block_size", "Maximum supported blocking factor."); device_property_fill_and_register(&device_property_read_block_size, G_TYPE_UINT, "read_block_size", "Minimum size of a read for this device (maximum expected block size)"); device_property_fill_and_register(&device_property_appendable, G_TYPE_BOOLEAN, "appendable", "Does device support appending to previously-written media?"); device_property_fill_and_register(&device_property_canonical_name, G_TYPE_STRING, "canonical_name", "The most reliable device name to use to refer to this device."); device_property_fill_and_register(&device_property_medium_access_type, MEDIA_ACCESS_MODE_TYPE, "medium_access_type", "What kind of media (RO/WORM/RW/WORN) do we have here?"); device_property_fill_and_register(&device_property_partial_deletion, G_TYPE_BOOLEAN, "partial_deletion", "Does this device support recycling just part of a volume?" ); device_property_fill_and_register(&device_property_full_deletion, G_TYPE_BOOLEAN, "full_deletion", "Does this device support recycling the entire volume?" ); device_property_fill_and_register(&device_property_max_volume_usage, G_TYPE_UINT64, "max_volume_usage", "Artificial limit to data written to volume."); device_property_fill_and_register(&device_property_enforce_max_volume_usage, G_TYPE_BOOLEAN, "enforce_max_volume_usage", "Does max_volume_usage enabled?"); device_property_fill_and_register(&device_property_verbose, G_TYPE_BOOLEAN, "verbose", "Should the device produce verbose output?"); device_property_fill_and_register(&device_property_comment, G_TYPE_STRING, "comment", "User-specified comment for the device"); device_property_fill_and_register(&device_property_leom, G_TYPE_BOOLEAN, "leom", "Does this device support LEOM?"); } DevicePropertyBase device_property_concurrency; DevicePropertyBase device_property_streaming; DevicePropertyBase device_property_compression; DevicePropertyBase device_property_compression_rate; DevicePropertyBase device_property_block_size; DevicePropertyBase device_property_min_block_size; DevicePropertyBase device_property_max_block_size; DevicePropertyBase device_property_read_block_size; DevicePropertyBase device_property_appendable; DevicePropertyBase device_property_canonical_name; DevicePropertyBase device_property_medium_access_type; DevicePropertyBase device_property_partial_deletion; DevicePropertyBase device_property_full_deletion; DevicePropertyBase device_property_max_volume_usage; DevicePropertyBase device_property_enforce_max_volume_usage; DevicePropertyBase device_property_comment; DevicePropertyBase device_property_leom; DevicePropertyBase device_property_verbose; amanda-3.3.6/device-src/dvdrw-device.c0000664000076400007640000005273212357250004021222 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Sam Couter */ #include "amanda.h" #include "vfs-device.h" /* * Type checking and casting macros */ #define TYPE_DVDRW_DEVICE (dvdrw_device_get_type()) #define DVDRW_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_DVDRW_DEVICE, DvdRwDevice) #define DVDRW_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_DVDRW_DEVICE, DvdRwDevice const) #define DVDRW_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), TYPE_DVDRW_DEVICE, DvdRwDeviceClass) #define IS_DVDRW_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_DVDRW_DEVICE) #define DVDRW_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_DVDRW_DEVICE, DvdRwDeviceClass) /* Forward declaration */ static GType dvdrw_device_get_type(void); /* * Main object structure */ typedef struct _DvdRwDevice DvdRwDevice; struct _DvdRwDevice { VfsDevice __parent__; gchar *dvdrw_device; gchar *cache_dir; gchar *cache_data; gchar *mount_point; gchar *mount_data; gboolean mounted; gboolean keep_cache; gboolean unlabelled_when_unmountable; gchar *growisofs_command; gchar *mount_command; gchar *umount_command; }; /* * Class definition */ typedef struct _DvdRwDeviceClass DvdRwDeviceClass; struct _DvdRwDeviceClass { VfsDeviceClass __parent__; }; /* Where the DVD-RW can be mounted */ static DevicePropertyBase device_property_dvdrw_mount_point; #define PROPERTY_DVDRW_MOUNT_POINT (device_property_dvdrw_mount_point.ID) /* Should the on-disk version be kept after the optical disc has been written? */ static DevicePropertyBase device_property_dvdrw_keep_cache; #define PROPERTY_DVDRW_KEEP_CACHE (device_property_dvdrw_keep_cache.ID) /* Should a mount failure (eg, a freshly formatted disc) when reading a label be treated like an unlabelled volume? */ static DevicePropertyBase device_property_dvdrw_unlabelled_when_unmountable; #define PROPERTY_DVDRW_UNLABELLED_WHEN_UNMOUNTABLE (device_property_dvdrw_unlabelled_when_unmountable.ID) /* Where to find the growisofs command */ static DevicePropertyBase device_property_dvdrw_growisofs_command; #define PROPERTY_DVDRW_GROWISOFS_COMMAND (device_property_dvdrw_growisofs_command.ID) /* Where to find the filesystem mount command */ static DevicePropertyBase device_property_dvdrw_mount_command; #define PROPERTY_DVDRW_MOUNT_COMMAND (device_property_dvdrw_mount_command.ID) /* Where to find the filesystem unmount command */ static DevicePropertyBase device_property_dvdrw_umount_command; #define PROPERTY_DVDRW_UMOUNT_COMMAND (device_property_dvdrw_umount_command.ID) /* GObject housekeeping */ void dvdrw_device_register(void); static Device* dvdrw_device_factory(char *device_name, char *device_type, char *device_node); static void dvdrw_device_class_init (DvdRwDeviceClass *c); static void dvdrw_device_init (DvdRwDevice *self); /* Properties */ static gboolean dvdrw_device_set_mount_point_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean dvdrw_device_set_keep_cache_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean dvdrw_device_set_unlabelled_when_unmountable_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean dvdrw_device_set_growisofs_command_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean dvdrw_device_set_mount_command_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean dvdrw_device_set_umount_command_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); /* Methods */ static void dvdrw_device_open_device(Device *dself, char *device_name, char *device_type, char *device_node); static DeviceStatusFlags dvdrw_device_read_label(Device *dself); static gboolean dvdrw_device_start(Device *dself, DeviceAccessMode mode, char *label, char *timestamp); static gboolean dvdrw_device_finish(Device *dself); static void dvdrw_device_finalize(GObject *gself); /* Helper functions */ static gboolean check_access_mode(DvdRwDevice *self, DeviceAccessMode mode); static gboolean check_readable(DvdRwDevice *self); static DeviceStatusFlags mount_disc(DvdRwDevice *self, gboolean report_error); static void unmount_disc(DvdRwDevice *self); static gboolean burn_disc(DvdRwDevice *self); static DeviceStatusFlags execute_command(DvdRwDevice *self, gchar **argv, gint *status); static GType dvdrw_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DvdRwDeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dvdrw_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (DvdRwDevice), 0 /* n_preallocs */, (GInstanceInitFunc) dvdrw_device_init, NULL }; type = g_type_register_static (TYPE_VFS_DEVICE, "DvdRwDevice", &info, (GTypeFlags)0); } return type; } void dvdrw_device_register(void) { const char *device_prefix_list[] = { "dvdrw", NULL }; device_property_fill_and_register(&device_property_dvdrw_mount_point, G_TYPE_STRING, "dvdrw_mount_point", "Directory to mount DVD-RW for reading"); device_property_fill_and_register(&device_property_dvdrw_keep_cache, G_TYPE_BOOLEAN, "dvdrw_keep_cache", "Keep on-disk cache after DVD-RW has been written"); device_property_fill_and_register(&device_property_dvdrw_unlabelled_when_unmountable, G_TYPE_BOOLEAN, "dvdrw_unlabelled_when_unmountable", "Treat unmountable volumes as unlabelled when reading label"); device_property_fill_and_register(&device_property_dvdrw_growisofs_command, G_TYPE_BOOLEAN, "dvdrw_growisofs_command", "The location of the growisofs command used to write the DVD-RW"); device_property_fill_and_register(&device_property_dvdrw_mount_command, G_TYPE_BOOLEAN, "dvdrw_mount_command", "The location of the mount command used to mount the DVD-RW filesystem for reading"); device_property_fill_and_register(&device_property_dvdrw_umount_command, G_TYPE_BOOLEAN, "dvdrw_umount_command", "The location of the umount command used to unmount the DVD-RW filesystem after reading"); register_device(dvdrw_device_factory, device_prefix_list); } static Device * dvdrw_device_factory(char *device_name, char *device_type, char *device_node) { Device *device; g_assert(0 == strncmp(device_type, "dvdrw", strlen("dvdrw"))); device = DEVICE(g_object_new(TYPE_DVDRW_DEVICE, NULL)); device_open_device(device, device_name, device_type, device_node); return device; } static void dvdrw_device_class_init (DvdRwDeviceClass *c) { DeviceClass *device_class = DEVICE_CLASS(c); GObjectClass *g_object_class = G_OBJECT_CLASS(c); device_class->open_device = dvdrw_device_open_device; device_class->read_label = dvdrw_device_read_label; device_class->start = dvdrw_device_start; device_class->finish = dvdrw_device_finish; g_object_class->finalize = dvdrw_device_finalize; device_class_register_property(device_class, PROPERTY_DVDRW_MOUNT_POINT, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_mount_point_fn); device_class_register_property(device_class, PROPERTY_DVDRW_KEEP_CACHE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_keep_cache_fn); device_class_register_property(device_class, PROPERTY_DVDRW_UNLABELLED_WHEN_UNMOUNTABLE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_unlabelled_when_unmountable_fn); device_class_register_property(device_class, PROPERTY_DVDRW_GROWISOFS_COMMAND, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_growisofs_command_fn); device_class_register_property(device_class, PROPERTY_DVDRW_MOUNT_COMMAND, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_mount_command_fn); device_class_register_property(device_class, PROPERTY_DVDRW_UMOUNT_COMMAND, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, dvdrw_device_set_umount_command_fn); } static void dvdrw_device_init (DvdRwDevice *self) { Device *dself = DEVICE(self); GValue val; self->dvdrw_device = NULL; self->cache_dir = NULL; self->cache_data = NULL; self->mount_point = NULL; self->mount_data = NULL; self->mounted = FALSE; self->keep_cache = FALSE; self->growisofs_command = NULL; self->mount_command = NULL; self->umount_command = NULL; bzero(&val, sizeof(val)); g_value_init(&val, G_TYPE_BOOLEAN); g_value_set_boolean(&val, FALSE); device_set_simple_property(dself, PROPERTY_APPENDABLE, &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&val); g_value_init(&val, G_TYPE_BOOLEAN); g_value_set_boolean(&val, FALSE); device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&val); g_value_init(&val, G_TYPE_BOOLEAN); g_value_set_boolean(&val, FALSE); device_set_simple_property(dself, PROPERTY_FULL_DELETION, &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&val); g_value_init(&val, G_TYPE_BOOLEAN); g_value_set_boolean(&val, TRUE); device_set_simple_property(dself, PROPERTY_LEOM, &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&val); } static gboolean dvdrw_device_set_mount_point_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); amfree(self->mount_point); amfree(self->mount_data); self->mount_point = g_value_dup_string(val); self->mount_data = g_strconcat(self->mount_point, "/data/", NULL); device_clear_volume_details(dself); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean dvdrw_device_set_keep_cache_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); self->keep_cache = g_value_get_boolean(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean dvdrw_device_set_unlabelled_when_unmountable_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); self->unlabelled_when_unmountable = g_value_get_boolean(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean dvdrw_device_set_growisofs_command_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); self->growisofs_command = g_value_dup_string(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean dvdrw_device_set_mount_command_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); self->mount_command = g_value_dup_string(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static gboolean dvdrw_device_set_umount_command_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { DvdRwDevice *self = DVDRW_DEVICE(dself); self->umount_command = g_value_dup_string(val); return device_simple_property_set_fn(dself, base, val, surety, source); } static void dvdrw_device_open_device(Device *dself, char *device_name, char *device_type, char *device_node) { DvdRwDevice *self = DVDRW_DEVICE(dself); DeviceClass *parent_class = DEVICE_CLASS(g_type_class_peek_parent(DVDRW_DEVICE_GET_CLASS(dself))); GValue val; char *colon; g_debug("Opening device: %s", device_node); bzero(&val, sizeof(val)); colon = index(device_node, ':'); if (!colon) { device_set_error(dself, stralloc(_("DVDRW device requires cache directory and DVD-RW device separated by a colon (:) in tapedev")), DEVICE_STATUS_DEVICE_ERROR); return; } self->cache_dir = g_strndup(device_node, colon - device_node); self->cache_data = g_strconcat(self->cache_dir, "/data/", NULL); self->dvdrw_device = g_strdup(colon + 1); parent_class->open_device(dself, device_name, device_type, device_node); } static DeviceStatusFlags dvdrw_device_read_label(Device *dself) { DvdRwDevice *self = DVDRW_DEVICE(dself); VfsDevice *vself = VFS_DEVICE(dself); gboolean mounted = FALSE; DeviceStatusFlags status; struct stat dir_status; DeviceClass *parent_class = DEVICE_CLASS(g_type_class_peek_parent(DVDRW_DEVICE_GET_CLASS(dself))); g_debug("Reading label from media at %s", self->mount_point); if (device_in_error(dself)) return DEVICE_STATUS_DEVICE_ERROR; if (!check_readable(self)) return DEVICE_STATUS_DEVICE_ERROR; if (!self->mounted) { status = mount_disc(self, !self->unlabelled_when_unmountable); if (status != DEVICE_STATUS_SUCCESS) { /* Not mountable. May be freshly formatted or corrupted, drive may be empty. */ return (self->unlabelled_when_unmountable) ? DEVICE_STATUS_VOLUME_UNLABELED : status; } mounted = TRUE; } if ((stat(self->mount_data, &dir_status) < 0) && (errno == ENOENT)) { /* No data directory, consider the DVD unlabelled */ g_debug("Media contains no data directory and therefore no label"); unmount_disc(self); return DEVICE_STATUS_VOLUME_UNLABELED; } amfree(vself->dir_name); vself->dir_name = g_strdup(self->mount_data); status = parent_class->read_label(dself); if (mounted) { unmount_disc(self); } return status; } static gboolean dvdrw_device_start(Device *dself, DeviceAccessMode mode, char *label, char *timestamp) { DvdRwDevice *self = DVDRW_DEVICE(dself); VfsDevice *vself = VFS_DEVICE(dself); DeviceClass *parent_class = DEVICE_CLASS(g_type_class_peek_parent(DVDRW_DEVICE_GET_CLASS(dself))); g_debug("Start DVDRW device"); if (device_in_error(dself)) return FALSE; if (!check_access_mode(self, mode)) return FALSE; dself->access_mode = mode; /* We'll replace this with our own value */ amfree(vself->dir_name); if (mode == ACCESS_READ) { if (mount_disc(self, TRUE) != DEVICE_STATUS_SUCCESS) { return FALSE; } vself->dir_name = g_strdup(self->mount_data); } else if (mode == ACCESS_WRITE) { vself->dir_name = g_strdup(self->cache_data); } return parent_class->start(dself, mode, label, timestamp); } static gboolean dvdrw_device_finish(Device *dself) { DvdRwDevice *self = DVDRW_DEVICE(dself); VfsDevice *vself = VFS_DEVICE(dself); gboolean result; DeviceClass *parent_class = DEVICE_CLASS(g_type_class_peek_parent(DVDRW_DEVICE_GET_CLASS(dself))); DeviceAccessMode mode; g_debug("Finish DVDRW device"); /* Save access mode before parent class messes with it */ mode = dself->access_mode; result = parent_class->finish(dself); if (mode == ACCESS_READ) { unmount_disc(self); } if (!result || device_in_error(dself)) { return FALSE; } if (mode == ACCESS_WRITE) { result = burn_disc(self); if (result && !self->keep_cache) { delete_vfs_files(vself); } return result; } return TRUE; } static gboolean burn_disc(DvdRwDevice *self) { gint status; char *burn_argv[] = {NULL, "-use-the-force-luke", "-Z", self->dvdrw_device, "-J", "-R", "-pad", "-quiet", self->cache_dir, NULL}; if (self->growisofs_command == NULL) { burn_argv[0] = "growisofs"; } else { burn_argv[0] = self->growisofs_command; } g_debug("Burning media in %s", self->dvdrw_device); if (execute_command(self, burn_argv, &status) != DEVICE_STATUS_SUCCESS) { return FALSE; } g_debug("Burn completed successfully"); return TRUE; } static void dvdrw_device_finalize(GObject *gself) { DvdRwDevice *self = DVDRW_DEVICE(gself); GObjectClass *parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(DVDRW_DEVICE_GET_CLASS(gself))); if (parent_class->finalize) { parent_class->finalize(gself); } amfree(self->dvdrw_device); amfree(self->cache_dir); amfree(self->cache_data); amfree(self->mount_point); amfree(self->mount_data); amfree(self->growisofs_command); amfree(self->mount_command); amfree(self->umount_command); } static gboolean check_access_mode(DvdRwDevice *self, DeviceAccessMode mode) { Device *dself = DEVICE(self); if (mode == ACCESS_READ) { return check_readable(self); } else if (mode == ACCESS_WRITE) { return TRUE; } device_set_error(dself, stralloc(_("DVDRW device can only be opened in READ or WRITE mode")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } static gboolean check_readable(DvdRwDevice *self) { Device *dself = DEVICE(self); GValue value; bzero(&value, sizeof(value)); if (! device_get_simple_property(dself, PROPERTY_DVDRW_MOUNT_POINT, &value, NULL, NULL)) { device_set_error(dself, stralloc(_("DVDRW device requires DVDRW_MOUNT_POINT to open device for reading")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } return TRUE; } static DeviceStatusFlags mount_disc(DvdRwDevice *self, gboolean report_error) { Device *dself = DEVICE(self); gchar *mount_argv[] = { NULL, self->mount_point, NULL }; DeviceStatusFlags status; if (self->mounted) { return DEVICE_STATUS_SUCCESS; } if (self->mount_command == NULL) { mount_argv[0] = "mount"; } else { mount_argv[0] = self->mount_command; } g_debug("Mounting media at %s", self->mount_point); status = execute_command(report_error ? self : NULL, mount_argv, NULL); if (status != DEVICE_STATUS_SUCCESS) { /* Wait a few seconds and try again - The tray may still be out after burning */ sleep(3); if (execute_command(report_error ? self : NULL, mount_argv, NULL) == DEVICE_STATUS_SUCCESS) { /* Clear error */ device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); self->mounted = TRUE; return DEVICE_STATUS_SUCCESS; } else { return status; } } self->mounted = TRUE; return DEVICE_STATUS_SUCCESS; } static void unmount_disc(DvdRwDevice *self) { gchar *unmount_argv[] = { NULL, self->mount_point, NULL }; DeviceStatusFlags status; if (! self->mounted) { return; } if (self->umount_command == NULL) { unmount_argv[0] = "umount"; } else { unmount_argv[0] = self->umount_command; } g_debug("Unmounting media at %s", self->mount_point); status = execute_command(NULL, unmount_argv, NULL); if (status == DEVICE_STATUS_SUCCESS) { self->mounted = FALSE; } } static DeviceStatusFlags execute_command(DvdRwDevice *self, gchar **argv, gint *result) { Device *dself = DEVICE(self); gchar *std_output = NULL; gchar *std_error = NULL; gint errnum = 0; GError *error = NULL; gboolean success; /* g_debug("Executing: %s", argv[0]); */ g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &std_output, &std_error, &errnum, &error); /* g_debug("Execution complete"); */ if (WIFSIGNALED(errnum)) { success = FALSE; } else if (WIFEXITED(errnum)) { success = (WEXITSTATUS(errnum) == 0); } else { success = FALSE; } if (!success) { gchar *error_message = vstrallocf(_("DVDRW device cannot execute '%s': %s (status: %d) (stderr: %s)"), argv[0], error ? error->message : _("Unknown error"), errnum, std_error ? std_error: "No stderr"); if (dself != NULL) { device_set_error(dself, error_message, DEVICE_STATUS_DEVICE_ERROR); } if (std_output) { g_free(std_output); } if (std_error) { g_free(std_error); } if (error) { g_error_free(error); } if (result != NULL) { *result = errnum; } return DEVICE_STATUS_DEVICE_ERROR; } return DEVICE_STATUS_SUCCESS; } amanda-3.3.6/device-src/property.h0000664000076400007640000002320012357250004020514 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef DEVICE_PROPERTY_H #define DEVICE_PROPERTY_H #include #include /* The properties interface defines define capabilities and other interesting * properties. */ typedef enum { PROPERTY_PHASE_BEFORE_START = (1 << 0), PROPERTY_PHASE_BETWEEN_FILE_WRITE = (1 << 1), PROPERTY_PHASE_INSIDE_FILE_WRITE = (1 << 2), PROPERTY_PHASE_BETWEEN_FILE_READ = (1 << 3), PROPERTY_PHASE_INSIDE_FILE_READ = (1 << 4), PROPERTY_PHASE_MAX = (1 << 5) } PropertyPhaseFlags; #define PROPERTY_PHASE_MASK (PROPERTY_PHASE_MAX-1) #define PROPERTY_PHASE_SHIFT 8 typedef enum { PROPERTY_ACCESS_GET_BEFORE_START = (PROPERTY_PHASE_BEFORE_START), PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE = (PROPERTY_PHASE_BETWEEN_FILE_WRITE), PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE = (PROPERTY_PHASE_INSIDE_FILE_WRITE), PROPERTY_ACCESS_GET_BETWEEN_FILE_READ = (PROPERTY_PHASE_BETWEEN_FILE_READ), PROPERTY_ACCESS_GET_INSIDE_FILE_READ = (PROPERTY_PHASE_INSIDE_FILE_READ), PROPERTY_ACCESS_SET_BEFORE_START = (PROPERTY_PHASE_BEFORE_START << PROPERTY_PHASE_SHIFT), PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE = (PROPERTY_PHASE_BETWEEN_FILE_WRITE << PROPERTY_PHASE_SHIFT), PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE = (PROPERTY_PHASE_INSIDE_FILE_WRITE << PROPERTY_PHASE_SHIFT), PROPERTY_ACCESS_SET_BETWEEN_FILE_READ = (PROPERTY_PHASE_BETWEEN_FILE_READ << PROPERTY_PHASE_SHIFT), PROPERTY_ACCESS_SET_INSIDE_FILE_READ = (PROPERTY_PHASE_INSIDE_FILE_READ << PROPERTY_PHASE_SHIFT) } PropertyAccessFlags; #define PROPERTY_ACCESS_GET_MASK (PROPERTY_PHASE_MASK) #define PROPERTY_ACCESS_SET_MASK (PROPERTY_PHASE_MASK << PROPERTY_PHASE_SHIFT) /* Some properties can only be occasionally (or unreliably) detected, so * this enum allows the user to override the detected or default * setting. Surety indicates a level of confidence in the value, while * source describes how we found out about it. */ typedef enum { /* Support is not based on conclusive evidence. */ PROPERTY_SURETY_BAD, /* Support is based on conclusive evidence. */ PROPERTY_SURETY_GOOD, } PropertySurety; typedef enum { /* property is from default setting. */ PROPERTY_SOURCE_DEFAULT, /* property is from device query. */ PROPERTY_SOURCE_DETECTED, /* property is from user override (configuration). */ PROPERTY_SOURCE_USER, } PropertySource; /***** * Initialization */ /* This should be called exactly once from device_api_init(). */ extern void device_property_init(void); /* This structure is usually statically allocated. It holds information about * a property that is common across all devices. */ typedef guint DevicePropertyId; typedef struct { DevicePropertyId ID; /* Set by device_property_register() */ GType type; const char *name; const char *description; } DevicePropertyBase; /* Registers a new property and returns its ID. This function takes ownership * of its argument; it must not be freed later. It should be called from a * device driver's registration function. */ extern DevicePropertyId device_property_register(DevicePropertyBase*); /* Does the same thing, but fills in a new DevicePropertyBase with the given * values first, and does not return the ID. This is more convenient for * device-specific properties. */ extern void device_property_fill_and_register( DevicePropertyBase * base, GType type, const char * name, const char * desc); /* Gets a DevicePropertyBase from its ID. */ DevicePropertyBase* device_property_get_by_id(DevicePropertyId); DevicePropertyBase* device_property_get_by_name(const char*); /***** * Class-level Property Information */ /* This structure is held inside a Device object. It holds information about a * property that is specific to the device driver, but not to a specific * instance of the driver. */ struct Device; /* forward declaration */ typedef gboolean (*PropertySetFn)( struct Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); typedef gboolean (*PropertyGetFn)( struct Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); typedef struct { DevicePropertyBase *base; PropertyAccessFlags access; PropertySetFn setter; PropertyGetFn getter; } DeviceProperty; /***** * Property-specific Types, etc. */ /* Standard property value types here. * Important: see property.c for the other half of type declarations.*/ typedef enum { CONCURRENCY_PARADIGM_EXCLUSIVE, CONCURRENCY_PARADIGM_SHARED_READ, CONCURRENCY_PARADIGM_RANDOM_ACCESS } ConcurrencyParadigm; #define CONCURRENCY_PARADIGM_TYPE concurrency_paradigm_get_type() GType concurrency_paradigm_get_type (void); #define STREAMING_REQUIREMENT_TYPE streaming_requirement_get_type() GType streaming_requirement_get_type (void); typedef enum { MEDIA_ACCESS_MODE_READ_ONLY, MEDIA_ACCESS_MODE_WORM, MEDIA_ACCESS_MODE_READ_WRITE, MEDIA_ACCESS_MODE_WRITE_ONLY } MediaAccessMode; #define MEDIA_ACCESS_MODE_TYPE media_access_mode_get_type() GType media_access_mode_get_type (void); /* Standard property definitions follow. See also property.c. */ /* Value is a ConcurrencyParadigm */ extern DevicePropertyBase device_property_concurrency; #define PROPERTY_CONCURRENCY (device_property_concurrency.ID) /* Value is a StreamingRequirement */ typedef enum { STREAMING_REQUIREMENT_NONE, STREAMING_REQUIREMENT_DESIRED, STREAMING_REQUIREMENT_REQUIRED } StreamingRequirement; extern DevicePropertyBase device_property_streaming; #define PROPERTY_STREAMING (device_property_streaming.ID) /* Value is a gboolean. */ extern DevicePropertyBase device_property_compression; #define PROPERTY_COMPRESSION (device_property_compression.ID) /* Value is a gdouble, representing (compressed size)/(original size). The period over which this value is measured is undefined. */ extern DevicePropertyBase device_property_compression_rate; #define PROPERTY_COMPRESSION_RATE (device_property_compression_rate.ID) /* Value is a gint; gives the write block size. */ extern DevicePropertyBase device_property_block_size; #define PROPERTY_BLOCK_SIZE (device_property_block_size.ID) /* Read-only. Value is a guint. */ extern DevicePropertyBase device_property_min_block_size; extern DevicePropertyBase device_property_max_block_size; #define PROPERTY_MIN_BLOCK_SIZE (device_property_min_block_size.ID) #define PROPERTY_MAX_BLOCK_SIZE (device_property_max_block_size.ID) /* Value is a guint; gives the minimum buffer size for reads. Only * the tape device implements this, but it corresponds to the tapetype * readblocksize parameter, so it's a global property*/ extern DevicePropertyBase device_property_read_block_size; #define PROPERTY_READ_BLOCK_SIZE (device_property_read_block_size.ID) /* Value is a gboolean. */ extern DevicePropertyBase device_property_appendable; #define PROPERTY_APPENDABLE (device_property_appendable.ID) /* Value is a string. */ extern DevicePropertyBase device_property_canonical_name; #define PROPERTY_CANONICAL_NAME (device_property_canonical_name.ID) /* Value is MediaAccessMode. */ extern DevicePropertyBase device_property_medium_access_type; #define PROPERTY_MEDIUM_ACCESS_TYPE (device_property_medium_access_type.ID) /* Value is a gboolean. */ extern DevicePropertyBase device_property_partial_deletion; #define PROPERTY_PARTIAL_DELETION (device_property_partial_deletion.ID) /* Value is a gboolean. */ extern DevicePropertyBase device_property_full_deletion; #define PROPERTY_FULL_DELETION (device_property_full_deletion.ID) /* Value is a guint64. On devices that support it, this property will limit the total amount of data written to a volume; attempts to write beyond this point will cause the device to simulate "out of space". Zero means no limit. */ extern DevicePropertyBase device_property_max_volume_usage; #define PROPERTY_MAX_VOLUME_USAGE (device_property_max_volume_usage.ID) /* For devices supporting max_volume_usage this property will be used disable/enable property max_volume_usage. If FALSE, max_volume_usage will not be verified while writing to the device */ extern DevicePropertyBase device_property_enforce_max_volume_usage; #define PROPERTY_ENFORCE_MAX_VOLUME_USAGE (device_property_enforce_max_volume_usage.ID) /* Should the device produce verbose output? Value is a gboolean. Not * present in all devices. */ extern DevicePropertyBase device_property_verbose; #define PROPERTY_VERBOSE (device_property_verbose.ID) /* A comment for the use of the user. */ extern DevicePropertyBase device_property_comment; #define PROPERTY_COMMENT (device_property_comment.ID) /* Does this device support LEOM? */ extern DevicePropertyBase device_property_leom; #define PROPERTY_LEOM (device_property_leom.ID) #endif amanda-3.3.6/device-src/s3-util.c0000664000076400007640000001151312357250004020127 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifdef HAVE_CONFIG_H /* use a relative path here to avoid conflicting with Perl's config.h. */ #include "../config/config.h" #endif #ifdef HAVE_REGEX_H #include #include #endif #ifdef HAVE_AMANDA_H #include "amanda.h" #endif #include #include #include #include #include #include "s3-util.h" #ifdef HAVE_REGEX_H int s3_regexec_wrap(regex_t *regex, const char *str, size_t nmatch, regmatch_t pmatch[], int eflags) { char *message; int size; int reg_result; reg_result = regexec(regex, str, nmatch, pmatch, eflags); if (reg_result != 0 && reg_result != REG_NOMATCH) { size = regerror(reg_result, regex, NULL, 0); message = g_malloc(size); regerror(reg_result, regex, message, size); /* this is programmer error (bad regexp), so just log * and abort(). There's no good way to signal a * permanaent error from interpret_response. */ g_critical(_("Regex error: %s"), message); } return reg_result; } #else int s3_regexec_wrap(regex_t *regex, const char *str, size_t nmatch, regmatch_t pmatch[], int eflags) { GMatchInfo *match_info; int ret = REG_NOERROR; guint i; g_assert(regex && *regex); g_regex_match(*regex, str, eflags, &match_info); if (g_match_info_matches(match_info)) { g_assert(g_match_info_get_match_count(match_info) <= (glong) nmatch); for (i = 0; i < nmatch; i++) { pmatch[i].rm_eo = pmatch[i].rm_so = -1; g_match_info_fetch_pos(match_info, i, &pmatch[i].rm_so, &pmatch[i].rm_eo); } } else { ret = REG_NOMATCH; } g_match_info_free(match_info); return ret; } #endif #ifndef HAVE_AMANDA_H char* find_regex_substring(const char* base_string, const regmatch_t match) { g_assert(match.rm_eo >= match.rm_so); return g_strndup(base_string+match.rm_so, match.rm_eo - match.rm_so); } #endif gchar* s3_base64_encode(const GByteArray *to_enc) { BIO *bio_b64 = NULL, *bio_buff = NULL; long bio_b64_len; char *bio_b64_data = NULL, *ret = NULL; if (!to_enc) return NULL; /* Initialize base64 encoding filter */ bio_b64 = BIO_new(BIO_f_base64()); g_assert(bio_b64); BIO_set_flags(bio_b64, BIO_FLAGS_BASE64_NO_NL); /* Initialize memory buffer for the base64 encoding */ bio_buff = BIO_new(BIO_s_mem()); g_assert(bio_buff); bio_buff = BIO_push(bio_b64, bio_buff); /* Write the MD5 hash into the buffer to encode it in base64 */ BIO_write(bio_buff, to_enc->data, to_enc->len); /* BIO_flush is a macro and GCC 4.1.2 complains without this cast*/ (void) BIO_flush(bio_buff); /* Pull out the base64 encoding of the MD5 hash */ bio_b64_len = BIO_get_mem_data(bio_buff, &bio_b64_data); g_assert(bio_b64_data); ret = g_strndup(bio_b64_data, bio_b64_len); /* If bio_b64 is freed separately, freeing bio_buff will * invalidly free memory and potentially segfault. */ BIO_free_all(bio_buff); return ret; } gchar* s3_hex_encode(const GByteArray *to_enc) { guint i; gchar *ret = NULL, table[] = "0123456789abcdef"; if (!to_enc) return NULL; ret = g_new(gchar, to_enc->len*2 + 1); for (i = 0; i < to_enc->len; i++) { /* most significant 4 bits */ ret[i*2] = table[to_enc->data[i] >> 4]; /* least significant 4 bits */ ret[i*2 + 1] = table[to_enc->data[i] & 0xf]; } ret[to_enc->len*2] = '\0'; return ret; } GByteArray* s3_compute_md5_hash(const GByteArray *to_hash) { MD5_CTX md5_ctx; GByteArray *ret; if (!to_hash) return NULL; ret = g_byte_array_sized_new(S3_MD5_HASH_BYTE_LEN); g_byte_array_set_size(ret, S3_MD5_HASH_BYTE_LEN); MD5_Init(&md5_ctx); MD5_Update(&md5_ctx, to_hash->data, to_hash->len); MD5_Final(ret->data, &md5_ctx); return ret; } amanda-3.3.6/device-src/xfer-dest-taper.h0000664000076400007640000001010512357250004021642 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef XFER_DEST_TAPER_H #define XFER_DEST_TAPER_H #include "amxfer.h" #include "device.h" /* * class declaration for XferDestTaper (an abstract base class) */ GType xfer_dest_taper_get_type(void); #define XFER_DEST_TAPER_TYPE (xfer_dest_taper_get_type()) #define XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper) #define XFER_DEST_TAPER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper const) #define XFER_DEST_TAPER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_get_type(), XferDestTaperClass) #define IS_XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_get_type ()) #define XFER_DEST_TAPER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_get_type(), XferDestTaperClass) typedef struct XferDestTaper_ { XferElement __parent__; } XferDestTaper; typedef struct { XferElementClass __parent__; /* see xfer-device.h for details of these methods */ void (*start_part)(XferDestTaper *self, gboolean retry_part, dumpfile_t *header); void (*use_device)(XferDestTaper *self, Device *device); void (*cache_inform)(XferDestTaper *self, const char *filename, off_t offset, off_t length); guint64 (*get_part_bytes_written)(XferDestTaper *self); } XferDestTaperClass; /* Start writing the next part to the given device. The part will be written * to the device given to use_device, which should be open and properly positioned. * It should not have a file open yet. * * @param self: the XferDestTaper object * @param retry_part: retry the previous (incomplete) part if true * @param header: part header */ void xfer_dest_taper_start_part( XferElement *self, gboolean retry_part, dumpfile_t *header); /* Prepare to write subsequent parts to the given device. The device must * not be started yet. It is not necessary to call this method for the first * device used in a transfer. * * @param self: the XferDestTaper object * @param device: the device */ void xfer_dest_taper_use_device( XferElement *self, Device *device); /* Add a slice of data to the cache for the element. This is used by the taper * when reading from holding disk, to tell the element which holding disk files * contain the data that might be needed when rewinding, but can be used in any * situation where the part data is already on-disk. The order of calls to this * function dictates the order in whch the files will be read, and no gaps or * overlaps are supported. Note, too, that this must be called *before* any of * the data in the new file is sent into the transfer. * * @param self: the XferDestTaper object * @param filename: the fully qualified filename of the cache file * @param offset: offset into the file at which data begins * @param length: length of data in file */ void xfer_dest_taper_cache_inform( XferElement *self, const char *filename, off_t offset, off_t length); /* Return the number of bytes written for the current part. * * @param self: the XferDestTaper object */ guint64 xfer_dest_taper_get_part_bytes_written( XferElement *self); #endif amanda-3.3.6/device-src/vfs-device.c0000664000076400007640000013543712357250004020676 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include /* memset() */ #include "fsusage.h" #include "util.h" #include #include "vfs-device.h" /* This regex will match all VfsDevice files in a directory. We use it for cleanup and verification. Note that this regex does NOT match the volume label. */ #define VFS_DEVICE_FILE_REGEX "^[0-9]+[\\.-]" /* The name of the volume lockfile. Should be the same as that generated by lockfile_name(0). */ #define VOLUME_LOCKFILE_NAME "00000-lock" #define VFS_DEVICE_MIN_BLOCK_SIZE (1) #define VFS_DEVICE_MAX_BLOCK_SIZE (INT_MAX) #define VFS_DEVICE_DEFAULT_BLOCK_SIZE (DISK_BLOCK_BYTES) #define VFS_DEVICE_LABEL_SIZE (32768) /* Allow comfortable room for another block and a header before PEOM */ #define EOM_EARLY_WARNING_ZONE_BLOCKS 4 /* Constants for free-space monitoring */ #define MONITOR_FREE_SPACE_EVERY_SECONDS 5 #define MONITOR_FREE_SPACE_EVERY_KB 102400 #define MONITOR_FREE_SPACE_CLOSELY_WITHIN_BLOCKS 128 /* This looks dangerous, but is actually modified by the umask. */ #define VFS_DEVICE_CREAT_MODE 0666 /* Possible (abstracted) results from a system I/O operation. */ typedef enum { RESULT_SUCCESS, RESULT_ERROR, /* Undefined error. */ RESULT_NO_DATA, /* End of File, while reading */ RESULT_NO_SPACE, /* Out of space. Sometimes we don't know if it was this or I/O error, but this is the preferred explanation. */ RESULT_MAX } IoResult; void vfs_device_register(void); /* here are local prototypes */ static void vfs_device_init (VfsDevice * o); static void vfs_device_class_init (VfsDeviceClass * c); static void vfs_device_base_init (VfsDeviceClass * c); static void vfs_device_finalize (GObject * o); static gboolean vfs_device_start(Device * pself, DeviceAccessMode mode, char * label, char * timestamp); static gboolean vfs_device_finish (Device * pself); static void vfs_device_open_device (Device * pself, char * device_name, char * device_type, char * device_node); static gboolean vfs_device_start_file (Device * pself, dumpfile_t * ji); static gboolean vfs_device_finish_file (Device * dself); static dumpfile_t * vfs_device_seek_file (Device * self, guint file); static gboolean vfs_device_seek_block (Device * self, guint64 block); static gboolean vfs_device_recycle_file (Device * pself, guint filenum); static gboolean vfs_device_erase (Device * pself); static Device * vfs_device_factory(char * device_name, char * device_type, char * device_node); static DeviceStatusFlags vfs_device_read_label(Device * dself); static gboolean vfs_device_write_block(Device * self, guint size, gpointer data); static int vfs_device_read_block(Device * self, gpointer data, int * size_req); static IoResult vfs_device_robust_write(VfsDevice * self, char *buf, int count); static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, int *count); /* Various helper functions. */ static void release_file(VfsDevice * self); static gboolean check_is_dir(VfsDevice * self, const char * name); static char * file_number_to_file_name(VfsDevice * self, guint file); static gboolean file_number_to_file_name_functor(const char * filename, gpointer datap); static gboolean vfs_device_set_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean vfs_device_set_enforce_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean property_get_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_set_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean property_set_leom_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); //static char* lockfile_name(VfsDevice * self, guint file); static gboolean open_lock(VfsDevice * self, int file, gboolean exclusive); static void promote_volume_lock(VfsDevice * self); static void demote_volume_lock(VfsDevice * self); static gboolean delete_vfs_files_functor(const char * filename, gpointer self); static gboolean check_dir_empty_functor(const char * filename, gpointer self); static gboolean clear_and_prepare_label(VfsDevice * self, char * label, char * timestamp); static int search_vfs_directory(VfsDevice *self, const char * regex, SearchDirectoryFunctor functor, gpointer user_data); static gint get_last_file_number(VfsDevice * self); static gboolean get_last_file_number_functor(const char * filename, gpointer datap); static char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji); static gboolean try_unlink(const char * file); /* return TRUE if the device is going to hit ENOSPC "soon" - this is used to * detect LEOM as represented by actually running out of space on the * underlying filesystem. Size is the size of the buffer that is about to * be written. */ static gboolean check_at_leom(VfsDevice *self, guint64 size); /* Similar, but for PEOM */ static gboolean check_at_peom(VfsDevice *self, guint64 size); /* pointer to the classes of our parents */ static DeviceClass *parent_class = NULL; /* device-specific properties */ DevicePropertyBase device_property_monitor_free_space; #define PROPERTY_MONITOR_FREE_SPACE (device_property_monitor_free_space.ID) void vfs_device_register(void) { static const char * device_prefix_list[] = { "file", NULL }; device_property_fill_and_register(&device_property_monitor_free_space, G_TYPE_BOOLEAN, "monitor_free_space", "Should VFS device monitor the filesystem's available free space?"); register_device(vfs_device_factory, device_prefix_list); } GType vfs_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (VfsDeviceClass), (GBaseInitFunc) vfs_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vfs_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (VfsDevice), 0 /* n_preallocs */, (GInstanceInitFunc) vfs_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "VfsDevice", &info, (GTypeFlags)0); } return type; } static void vfs_device_init (VfsDevice * self) { Device * dself = DEVICE(self); GValue response; self->dir_name = self->file_name = NULL; self->open_file_fd = -1; self->volume_bytes = 0; self->volume_limit = 0; self->leom = TRUE; self->enforce_volume_limit = TRUE; self->monitor_free_space = TRUE; self->checked_fs_free_bytes = G_MAXUINT64; self->checked_fs_free_time = 0; self->checked_fs_free_bytes = G_MAXUINT64; /* Register Properties */ bzero(&response, sizeof(response)); g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); device_set_simple_property(dself, PROPERTY_CONCURRENCY, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); device_set_simple_property(dself, PROPERTY_STREAMING, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_APPENDABLE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_FULL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_LEOM, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(dself, PROPERTY_ENFORCE_MAX_VOLUME_USAGE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(dself, PROPERTY_COMPRESSION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); } static void vfs_device_class_init (VfsDeviceClass * c) { GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = DEVICE_CLASS(c); parent_class = g_type_class_ref(TYPE_DEVICE); device_class->open_device = vfs_device_open_device; device_class->start = vfs_device_start; device_class->start_file = vfs_device_start_file; device_class->read_label = vfs_device_read_label; device_class->write_block = vfs_device_write_block; device_class->read_block = vfs_device_read_block; device_class->finish_file = vfs_device_finish_file; device_class->seek_file = vfs_device_seek_file; device_class->seek_block = vfs_device_seek_block; device_class->recycle_file = vfs_device_recycle_file; device_class->erase = vfs_device_erase; device_class->finish = vfs_device_finish; g_object_class->finalize = vfs_device_finalize; } static void vfs_device_base_init (VfsDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; device_class_register_property(device_class, PROPERTY_MONITOR_FREE_SPACE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK, property_get_monitor_free_space_fn, property_set_monitor_free_space_fn); device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE, (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE), device_simple_property_get_fn, vfs_device_set_max_volume_usage_fn); device_class_register_property(device_class, PROPERTY_ENFORCE_MAX_VOLUME_USAGE, (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE), device_simple_property_get_fn, vfs_device_set_enforce_max_volume_usage_fn); device_class_register_property(device_class, PROPERTY_COMPRESSION, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, NULL); /* add the ability to set LEOM to FALSE, for testing purposes */ device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, property_set_leom_fn); } static gboolean vfs_device_set_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { VfsDevice *self = VFS_DEVICE(p_self); self->volume_limit = g_value_get_uint64(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean vfs_device_set_enforce_max_volume_usage_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { VfsDevice *self = VFS_DEVICE(p_self); self->enforce_volume_limit = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean property_get_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { VfsDevice *self = VFS_DEVICE(p_self); g_value_unset_init(val, G_TYPE_BOOLEAN); g_value_set_boolean(val, self->monitor_free_space); if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DEFAULT; return TRUE; } static gboolean property_set_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { VfsDevice *self = VFS_DEVICE(p_self); self->monitor_free_space = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean property_set_leom_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { VfsDevice *self = VFS_DEVICE(p_self); self->leom = g_value_get_boolean(val); return device_simple_property_set_fn(p_self, base, val, surety, source); } /* Drops everything associated with the volume file: Its name and fd. */ void release_file(VfsDevice * self) { /* Doesn't hurt. */ if (self->open_file_fd != -1) robust_close(self->open_file_fd); amfree(self->file_name); self->open_file_fd = -1; } static void vfs_device_finalize(GObject * obj_self) { VfsDevice *self = VFS_DEVICE (obj_self); Device * d_self = (Device*)self; if (d_self->access_mode != ACCESS_NULL) { device_finish(d_self); } if(G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); amfree(self->dir_name); release_file(self); } static Device * vfs_device_factory(char * device_name, char * device_type, char * device_node) { Device * rval; g_assert(0 == strcmp(device_type, "file")); rval = DEVICE(g_object_new(TYPE_VFS_DEVICE, NULL)); device_open_device(rval, device_name, device_type, device_node); return rval; } static gboolean check_is_dir(VfsDevice * self, const char * name) { Device *dself = DEVICE(self); struct stat dir_status; if (stat(name, &dir_status) < 0) { #ifdef EINTR if (errno == EINTR) { return check_is_dir(self, name); } #endif /* EINTR */ device_set_error(dself, vstrallocf(_("Error checking directory %s: %s"), name, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else if (!S_ISDIR(dir_status.st_mode)) { device_set_error(dself, vstrallocf(_("VFS Device path %s is not a directory"), name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else { return TRUE; } } typedef struct { VfsDevice * self; int count; char * result; } fnfn_data; /* A SearchDirectoryFunctor. */ static gboolean file_number_to_file_name_functor(const char * filename, gpointer datap) { char * result_tmp; struct stat file_status; fnfn_data *data = (fnfn_data*)datap; result_tmp = vstralloc(data->self->dir_name, "/", filename, NULL); /* Just to be thorough, let's check that it's a real file. */ if (0 != stat(result_tmp, &file_status)) { g_warning(_("Cannot stat file %s (%s), ignoring it"), result_tmp, strerror(errno)); } else if (!S_ISREG(file_status.st_mode)) { g_warning(_("%s is not a regular file, ignoring it"), result_tmp); } else { data->count ++; if (data->result == NULL) { data->result = result_tmp; result_tmp = NULL; } } amfree(result_tmp); return TRUE; } /* This function finds the filename for a given file number. We search * for a filesystem file matching the regex /^0*$device_file\./; if * there is more than one such file we make a warning and take an * arbitrary one. */ static char * file_number_to_file_name(VfsDevice * self, guint device_file) { char * regex; fnfn_data data; data.self = self; data.count = 0; data.result = NULL; regex = g_strdup_printf("^0*%u\\.", device_file); search_vfs_directory(self, regex, file_number_to_file_name_functor, &data); amfree(regex); if (data.count == 0) { g_assert(data.result == NULL); return NULL; } else if (data.count > 1) { g_warning("Found multiple names for file number %d, choosing file %s", device_file, data.result); return data.result; } else { g_assert(data.result != NULL); return data.result; } g_assert_not_reached(); } /* This function returns the dynamically-allocated lockfile name for a given file number. */ /* static char * lockfile_name(VfsDevice * self, guint number) { return g_strdup_printf("%s/%05d-lock", self->dir_name, number); } */ /* Does what you expect. If the lock already exists, it is released * and regained, in case the mode is changing. * The file field has several options: * - file > 0: Open a lock on a real volume file. * - file = 0: Open the volume lock as a volume file (for setup). * - file < 0: Open the volume lock as a volume lock (persistantly). */ static gboolean open_lock(G_GNUC_UNUSED VfsDevice * self, G_GNUC_UNUSED int file, G_GNUC_UNUSED gboolean exclusive) { /* At the moment, file locking is horribly broken. */ return TRUE; } /* For now, does it the bad way. */ static void promote_volume_lock(VfsDevice * self G_GNUC_UNUSED) { } static void demote_volume_lock(VfsDevice * self G_GNUC_UNUSED) { } /* A SearchDirectoryFunctor */ static gboolean update_volume_size_functor(const char * filename, gpointer user_data) { char * full_filename; struct stat stat_buf; VfsDevice * self = VFS_DEVICE(user_data); full_filename = vstralloc(self->dir_name, "/", filename, NULL); if (stat(full_filename, &stat_buf) < 0) { /* Log it and keep going. */ g_warning(_("Couldn't stat file %s: %s"), full_filename, strerror(errno)); amfree(full_filename); return TRUE; } amfree(full_filename); self->volume_bytes += stat_buf.st_size; return TRUE; } static void update_volume_size(VfsDevice * self) { self->volume_bytes = 0; search_vfs_directory(self, "^[0-9]+\\.", update_volume_size_functor, self); } static void vfs_device_open_device (Device * pself, char * device_name, char * device_type, char * device_node) { VfsDevice * self; self = VFS_DEVICE(pself); pself->min_block_size = VFS_DEVICE_MIN_BLOCK_SIZE; pself->max_block_size = VFS_DEVICE_MAX_BLOCK_SIZE; pself->block_size = VFS_DEVICE_DEFAULT_BLOCK_SIZE; /* We don't have to free this ourselves; it will be freed by * vfs_device_finalize whether we succeed here or not. */ self->dir_name = g_strconcat(device_node, "/data/", NULL); if (parent_class->open_device) { parent_class->open_device(pself, device_name, device_type, device_node); } } /* A SearchDirectoryFunctor */ static gboolean delete_vfs_files_functor(const char * filename, gpointer user_data) { VfsDevice * self; char * path_name; self = VFS_DEVICE(user_data); /* Skip the volume lock. */ if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0) return TRUE; path_name = vstralloc(self->dir_name, "/", filename, NULL); if (unlink(path_name) != 0) { g_warning(_("Error unlinking %s: %s"), path_name, strerror(errno)); } amfree(path_name); return TRUE; } /* delete_vfs_files deletes all VfsDevice files in the directory except the volume lockfile. */ void delete_vfs_files(VfsDevice * self) { g_assert(self != NULL); /* This function assumes that the volume is locked! */ search_vfs_directory(self, VFS_DEVICE_FILE_REGEX, delete_vfs_files_functor, self); } /* This is a functor suitable for search_directory. It simply prints a warning. It also dodges the volume lockfile. */ static gboolean check_dir_empty_functor(const char * filename, gpointer user_data) { VfsDevice * self = VFS_DEVICE(user_data); char * path_name; if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0) return TRUE; path_name = vstralloc(self->dir_name, "/", filename, NULL); g_warning(_("Found spurious storage file %s"), path_name); amfree(path_name); return TRUE; } /* This function is used to write volume and dump headers. */ static gboolean write_amanda_header(VfsDevice * self, const dumpfile_t * header) { char * label_buffer; IoResult result; Device *d_self = DEVICE(self); g_assert(header != NULL); label_buffer = device_build_amanda_header(d_self, header, NULL); if (!label_buffer) { amfree(label_buffer); device_set_error(d_self, stralloc(_("Amanda file header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } result = vfs_device_robust_write(self, label_buffer, VFS_DEVICE_LABEL_SIZE); /* vfs_device_robust_write sets error status if necessary */ amfree(label_buffer); return (result == RESULT_SUCCESS); } /* clear_and_label will erase the contents of the directory, and write * this label in its place. This function assumes we already have a volume * label write lock in place (e.g., promote_lock() has been called.) */ static gboolean clear_and_prepare_label(VfsDevice * self, char * label, char * timestamp) { dumpfile_t * label_header; Device *d_self = DEVICE(self); release_file(self); /* Delete any extant data, except our volume lock. */ delete_vfs_files(self); /* Print warnings about any remaining files. */ search_vfs_directory(self, VFS_DEVICE_FILE_REGEX, check_dir_empty_functor, self); self->file_name = g_strdup_printf("%s/00000.%s", self->dir_name, label); self->open_file_fd = robust_open(self->file_name, O_CREAT | O_EXCL | O_WRONLY, VFS_DEVICE_CREAT_MODE); if (self->open_file_fd < 0) { device_set_error(d_self, vstrallocf(_("Can't open file %s: %s"), self->file_name, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } label_header = make_tapestart_header(DEVICE(self), label, timestamp); if (!write_amanda_header(self, label_header)) { /* write_amanda_header sets error status if necessary */ dumpfile_free(label_header); return FALSE; } dumpfile_free(d_self->volume_header); d_self->header_block_size = VFS_DEVICE_LABEL_SIZE; d_self->volume_header = label_header; self->volume_bytes = VFS_DEVICE_LABEL_SIZE; return TRUE; } /* Just like search_directory, but returns -1 in the event of an error */ static int search_vfs_directory( VfsDevice *self, const char * regex, SearchDirectoryFunctor functor, gpointer user_data) { Device *dself = DEVICE(self); DIR *dir_handle; int result = -1; dir_handle = opendir(self->dir_name); if (dir_handle == NULL) { device_set_error(dself, vstrallocf(_("Couldn't open device %s (directory %s) for reading: %s"), dself->device_name, self->dir_name, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); goto error; } /* TODO: is this the right moment to acquire a lock?? */ result = search_directory(dir_handle, regex, functor, user_data); error: if (dir_handle) closedir(dir_handle); return result; } static DeviceStatusFlags vfs_device_read_label(Device * dself) { VfsDevice * self = VFS_DEVICE(dself); dumpfile_t * amanda_header; g_assert(self != NULL); if (!check_is_dir(self, self->dir_name)) { /* error message set by check_is_dir */ return dself->status; } amfree(dself->volume_label); amfree(dself->volume_time); dumpfile_free(dself->volume_header); dself->volume_header = NULL; if (device_in_error(dself)) return dself->status; amanda_header = dself->volume_header = vfs_device_seek_file(dself, 0); release_file(self); if (amanda_header == NULL) { /* This means an error occured getting locks or opening the header * file. */ device_set_error(dself, stralloc("Error loading device header -- unlabeled volume?"), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_VOLUME_UNLABELED); return dself->status; } /* close the fd we just opened */ vfs_device_finish_file(dself); if (amanda_header->type != F_TAPESTART && amanda_header->type != F_EMPTY) { /* This is an error, and should not happen. */ device_set_error(dself, stralloc(_("Got a bad volume label")), DEVICE_STATUS_VOLUME_ERROR); amfree(amanda_header); return dself->status; } /* self->volume_header is already set */ if (amanda_header->type == F_TAPESTART) { dself->volume_label = g_strdup(amanda_header->name); dself->volume_time = g_strdup(amanda_header->datestamp); device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); } update_volume_size(self); return dself->status; } static gboolean vfs_device_write_block(Device * pself, guint size, gpointer data) { VfsDevice * self = VFS_DEVICE(pself); IoResult result; if (device_in_error(self)) return FALSE; g_assert(self->open_file_fd >= 0); if (check_at_leom(self, size)) pself->is_eom = TRUE; if (check_at_peom(self, size)) { /* check_at_peom() only checks against MAX_VOLUME_USAGE limit */ pself->is_eom = TRUE; device_set_error(pself, stralloc(_("No space left on device: more than MAX_VOLUME_USAGE bytes written")), DEVICE_STATUS_VOLUME_ERROR); return FALSE; } result = vfs_device_robust_write(self, data, size); if (result != RESULT_SUCCESS) { /* vfs_device_robust_write set error status appropriately */ return FALSE; } self->volume_bytes += size; self->checked_bytes_used += size; pself->block ++; g_mutex_lock(pself->device_mutex); pself->bytes_written += size; g_mutex_unlock(pself->device_mutex); return TRUE; } static int vfs_device_read_block(Device * pself, gpointer data, int * size_req) { VfsDevice * self; int size; IoResult result; self = VFS_DEVICE(pself); if (device_in_error(self)) return -1; if (data == NULL || (gsize)*size_req < pself->block_size) { /* Just a size query. */ g_assert(pself->block_size < INT_MAX); *size_req = (int)pself->block_size; return 0; } size = pself->block_size; result = vfs_device_robust_read(self, data, &size); switch (result) { case RESULT_SUCCESS: *size_req = size; g_mutex_lock(pself->device_mutex); pself->bytes_read += size; g_mutex_unlock(pself->device_mutex); pself->block++; return size; case RESULT_NO_DATA: pself->is_eof = TRUE; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); device_set_error(pself, stralloc(_("EOF")), DEVICE_STATUS_SUCCESS); return -1; default: device_set_error(pself, vstrallocf(_("Error reading from data file: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return -1; } g_assert_not_reached(); } static gboolean vfs_device_start(Device * dself, DeviceAccessMode mode, char * label, char * timestamp) { VfsDevice * self = VFS_DEVICE(dself); if (!check_is_dir(self, self->dir_name)) { /* error message set by check_is_dir */ return FALSE; } g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); if (mode == ACCESS_WRITE) { promote_volume_lock(self); if (!clear_and_prepare_label(self, label, timestamp)) { /* clear_and_prepare_label sets error status if necessary */ demote_volume_lock(self); return FALSE; } dself->volume_label = newstralloc(dself->volume_label, label); dself->volume_time = newstralloc(dself->volume_time, timestamp); /* unset the VOLUME_UNLABELED flag, if it was set */ device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); demote_volume_lock(self); dself->access_mode = mode; } else { if (dself->volume_label == NULL && device_read_label(dself) != DEVICE_STATUS_SUCCESS) { /* device_read_label already set our error message */ return FALSE; } else { dself->access_mode = mode; } } release_file(self); return TRUE; } static gboolean vfs_device_finish (Device * pself) { VfsDevice * self; self = VFS_DEVICE(pself); release_file(self); pself->access_mode = ACCESS_NULL; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); if (device_in_error(self)) return FALSE; return TRUE; } typedef struct { VfsDevice * self; int rval; } glfn_data; /* A SearchDirectoryFunctor. */ static gboolean get_last_file_number_functor(const char * filename, gpointer datap) { guint64 file; glfn_data * data = (glfn_data*)datap; file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ if (file > G_MAXINT) { g_warning(_("Super-large device file %s found, ignoring"), filename); return TRUE; } /* This condition is needlessly complex due to sign issues. */ if (data->rval < 0 || ((guint)data->rval) < file) { data->rval = file; } return TRUE; } static gint get_last_file_number(VfsDevice * self) { glfn_data data; int count; Device *d_self = DEVICE(self); data.self = self; data.rval = -1; count = search_vfs_directory(self, "^[0-9]+\\.", get_last_file_number_functor, &data); if (count <= 0) { /* Somebody deleted something important while we weren't looking. */ device_set_error(d_self, stralloc(_("Error identifying VFS device contents!")), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } else { g_assert(data.rval >= 0); } return data.rval; } typedef struct { VfsDevice * self; guint request; int best_found; } gnfn_data; /* A SearchDirectoryFunctor. */ static gboolean get_next_file_number_functor(const char * filename, gpointer datap) { guint file; gnfn_data * data = (gnfn_data*)datap; file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ if (file > G_MAXINT) { g_warning(_("Super-large device file %s found, ignoring"), filename); return TRUE; } /* This condition is needlessly complex due to sign issues. */ if (file >= data->request && (data->best_found < 0 || file < (guint)data->best_found)) { data->best_found = file; } return TRUE; } /* Returns the file number equal to or greater than the given requested * file number. */ static gint get_next_file_number(VfsDevice * self, guint request) { gnfn_data data; int count; Device *d_self = DEVICE(self); data.self = self; data.request = request; data.best_found = -1; count = search_vfs_directory(self, "^[0-9]+\\.", get_next_file_number_functor, &data); if (count <= 0) { /* Somebody deleted something important while we weren't looking. */ device_set_error(d_self, stralloc(_("Error identifying VFS device contents!")), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } /* Could be -1. */ return data.best_found; } /* Finds the file number, acquires a lock, and returns the new file name. */ static char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji) { char * rval; char *base, *sanitary_base; int fileno; for (;;) { fileno = 1 + get_last_file_number(self); if (fileno <= 0) return NULL; if (open_lock(self, fileno, TRUE)) { break; } else { continue; } } /* record that we're at this filenum now */ DEVICE(self)->file = fileno; base = g_strdup_printf("%05d.%s.%s.%d", fileno, ji->name, ji->disk, ji->dumplevel); sanitary_base = sanitise_filename(base); amfree(base); rval = g_strdup_printf("%s/%s", self->dir_name, sanitary_base); amfree(sanitary_base); return rval; } static gboolean vfs_device_start_file (Device * dself, dumpfile_t * ji) { VfsDevice * self = VFS_DEVICE(dself); dself->is_eom = FALSE; if (device_in_error(self)) return FALSE; /* set the blocksize in the header to 32k, since the VFS header is always * 32k regardless of the block_size setting */ ji->blocksize = 32768; if (check_at_leom(self, VFS_DEVICE_LABEL_SIZE)) dself->is_eom = TRUE; if (check_at_peom(self, VFS_DEVICE_LABEL_SIZE)) { /* check_at_peom() only checks against MAX_VOLUME_USAGE limit */ dself->is_eom = TRUE; device_set_error(dself, stralloc(_("No space left on device: more than MAX_VOLUME_USAGE bytes written")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } /* The basic idea here is thus: 1) Try to get a lock on the next filenumber. 2) If that fails, update our idea of "next filenumber" and try again. 3) Then open the file itself. 4) Write the label. 5) Chain up. */ self->file_name = make_new_file_name(self, ji); if (self->file_name == NULL) { device_set_error(dself, stralloc(_("Could not create header filename")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } self->open_file_fd = robust_open(self->file_name, O_CREAT | O_EXCL | O_RDWR, VFS_DEVICE_CREAT_MODE); if (self->open_file_fd < 0) { device_set_error(dself, vstrallocf(_("Can't create file %s: %s"), self->file_name, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); release_file(self); return FALSE; } if (!write_amanda_header(self, ji)) { /* write_amanda_header sets error status if necessary */ release_file(self); return FALSE; } /* handle some accounting business */ self->volume_bytes += VFS_DEVICE_LABEL_SIZE; self->checked_bytes_used += VFS_DEVICE_LABEL_SIZE; dself->block = 0; g_mutex_lock(dself->device_mutex); dself->in_file = TRUE; dself->bytes_written = 0; g_mutex_unlock(dself->device_mutex); /* make_new_file_name set pself->file for us */ return TRUE; } static gboolean vfs_device_finish_file(Device * dself) { VfsDevice * self = VFS_DEVICE(dself); if (!dself->in_file) return TRUE; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); release_file(self); if (device_in_error(self)) return FALSE; return TRUE; } /* This function is used for two purposes, rather than one. In * addition to its documented behavior, we also use it to open the * volume label for reading at startup. In that second case, we avoid * FdDevice-related side effects. */ static dumpfile_t * vfs_device_seek_file (Device * dself, guint requested_file) { VfsDevice *self = VFS_DEVICE(dself); int file; dumpfile_t * rval; char header_buffer[VFS_DEVICE_LABEL_SIZE]; int header_buffer_size = sizeof(header_buffer); IoResult result; if (device_in_error(self)) return NULL; dself->is_eof = FALSE; dself->block = 0; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; dself->bytes_read = 0; g_mutex_unlock(dself->device_mutex); release_file(self); if (requested_file > 0) { file = get_next_file_number(self, requested_file); } else { file = requested_file; } if (file < 0) { /* Did they request one past the end? */ char * tmp_file_name; tmp_file_name = file_number_to_file_name(self, requested_file - 1); if (tmp_file_name != NULL) { free(tmp_file_name); dself->file = requested_file; /* other attributes are already correct */ return make_tapeend_header(); } else { device_set_error(dself, stralloc(_("Attempt to read past tape-end file")), DEVICE_STATUS_SUCCESS); return NULL; } } if (!open_lock(self, file, FALSE)) { device_set_error(dself, stralloc(_("could not acquire lock")), DEVICE_STATUS_DEVICE_ERROR); return NULL; } self->file_name = file_number_to_file_name(self, file); if (self->file_name == NULL) { device_set_error(dself, vstrallocf(_("File %d not found"), file), file == 0 ? DEVICE_STATUS_VOLUME_UNLABELED : DEVICE_STATUS_VOLUME_ERROR); release_file(self); rval = g_new(dumpfile_t, 1); fh_init(rval); return rval; } self->open_file_fd = robust_open(self->file_name, O_RDONLY, 0); if (self->open_file_fd < 0) { device_set_error(dself, vstrallocf(_("Couldn't open file %s: %s"), self->file_name, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); amfree(self->file_name); release_file(self); return NULL; } result = vfs_device_robust_read(self, header_buffer, &header_buffer_size); if (result != RESULT_SUCCESS) { device_set_error(dself, vstrallocf(_("Problem reading Amanda header: %s"), device_error(dself)), DEVICE_STATUS_VOLUME_ERROR); release_file(self); return NULL; } rval = g_new(dumpfile_t, 1); parse_file_header(header_buffer, rval, header_buffer_size); switch (rval->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: break; case F_TAPESTART: /* file 0 should have a TAPESTART header; vfs_device_read_label * uses this */ if (requested_file == 0) break; /* FALLTHROUGH */ default: device_set_error(dself, stralloc(_("Invalid amanda header while reading file header")), DEVICE_STATUS_VOLUME_ERROR); amfree(rval); release_file(self); return NULL; } /* update our state */ if (requested_file == 0) { dself->header_block_size = header_buffer_size; } g_mutex_lock(dself->device_mutex); dself->in_file = TRUE; g_mutex_unlock(dself->device_mutex); dself->file = file; return rval; } static gboolean vfs_device_seek_block (Device * pself, guint64 block) { VfsDevice * self; off_t result; self = VFS_DEVICE(pself); g_assert(self->open_file_fd >= 0); g_assert(sizeof(off_t) >= sizeof(guint64)); if (device_in_error(self)) return FALSE; /* Pretty simple. We figure out the blocksize and use that. */ result = lseek(self->open_file_fd, (block) * pself->block_size + VFS_DEVICE_LABEL_SIZE, SEEK_SET); pself->block = block; if (result == (off_t)(-1)) { device_set_error(pself, vstrallocf(_("Error seeking within file: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } return TRUE; } static gboolean try_unlink(const char * file) { if (unlink(file) < 0) { return FALSE; } else { return TRUE; } } static gboolean check_at_leom(VfsDevice *self, guint64 size) { gboolean recheck = FALSE; guint64 est_avail_now; struct fs_usage fsusage; guint64 block_size = DEVICE(self)->block_size; guint64 eom_warning_buffer = EOM_EARLY_WARNING_ZONE_BLOCKS * block_size; if (!self->leom || !self->monitor_free_space) return FALSE; /* handle VOLUME_LIMIT */ if (self->enforce_volume_limit && self->volume_limit && self->volume_bytes + size + eom_warning_buffer > self->volume_limit) { return TRUE; } /* handle actual filesystem available space, using some heuristics to avoid polling this * too frequently */ est_avail_now = 0; if (self->checked_fs_free_bytes >= self->checked_bytes_used + size) est_avail_now = self->checked_fs_free_bytes - self->checked_bytes_used - size; /* is it time to check again? */ if (est_avail_now <= block_size * MONITOR_FREE_SPACE_CLOSELY_WITHIN_BLOCKS) { recheck = TRUE; } else if (self->checked_bytes_used > MONITOR_FREE_SPACE_EVERY_KB * 1024) { recheck = TRUE; } else if (self->checked_fs_free_time + MONITOR_FREE_SPACE_EVERY_SECONDS <= time(NULL)) { recheck = TRUE; } if (!recheck) return FALSE; if (get_fs_usage(self->dir_name, NULL, &fsusage) < 0 || fsusage.fsu_bavail_top_bit_set) { g_warning("Filesystem cannot provide free space: %s; setting MONITOR_FREE_SPACE false", fsusage.fsu_bavail_top_bit_set? "no result" : strerror(errno)); self->monitor_free_space = FALSE; return FALSE; } self->checked_fs_free_bytes = fsusage.fsu_bavail * fsusage.fsu_blocksize; self->checked_bytes_used = 0; self->checked_fs_free_time = time(NULL); if (self->checked_fs_free_bytes - size <= eom_warning_buffer) { g_debug("%s: at LEOM", DEVICE(self)->device_name); return TRUE; } return FALSE; } static gboolean check_at_peom(VfsDevice *self, guint64 size) { if (self->enforce_volume_limit && (self->volume_limit > 0)) { guint64 newtotal = self->volume_bytes + size; if (newtotal > self->volume_limit) { return TRUE; } } return FALSE; } static gboolean vfs_device_recycle_file (Device * dself, guint filenum) { VfsDevice * self = VFS_DEVICE(dself); struct stat file_status; off_t file_size; if (device_in_error(self)) return FALSE; /* Game Plan: * 1) Get a write lock on the file in question. * 2) Unlink the file in question. * 3) Unlink the lock. * 4) Release the lock. * FIXME: Is it OK to unlink the lockfile? */ self->file_name = file_number_to_file_name(self, filenum); if (self->file_name == NULL) { device_set_error(dself, vstrallocf(_("File %d not found"), filenum), DEVICE_STATUS_VOLUME_ERROR); return FALSE; } if (!open_lock(self, filenum, FALSE)) { device_set_error(dself, stralloc(_("could not acquire lock")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (0 != stat(self->file_name, &file_status)) { device_set_error(dself, vstrallocf(_("Cannot stat file %s (%s), so not removing"), self->file_name, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR); return FALSE; } file_size = file_status.st_size; if (!try_unlink(self->file_name)) { device_set_error(dself, vstrallocf(_("Unlink of %s failed: %s"), self->file_name, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR); release_file(self); return FALSE; } self->volume_bytes -= file_size; release_file(self); return TRUE; } static gboolean vfs_device_erase (Device * dself) { VfsDevice *self = VFS_DEVICE(dself); if (!open_lock(self, 0, TRUE)) return FALSE; delete_vfs_files(self); release_file(self); dumpfile_free(dself->volume_header); dself->volume_header = NULL; device_set_error(dself, g_strdup("Unlabeled volume"), DEVICE_STATUS_VOLUME_UNLABELED); return TRUE; } static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, int *count) { int fd = self->open_file_fd; Device *d_self = DEVICE(self); int want = *count, got = 0; while (got < want) { int result; result = read(fd, buf + got, want - got); if (result > 0) { got += result; } else if (result == 0) { /* end of file */ if (got == 0) { return RESULT_NO_DATA; } else { *count = got; return RESULT_SUCCESS; } } else if (0 #ifdef EAGAIN || errno == EAGAIN #endif #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif #ifdef EINTR || errno == EINTR #endif ) { /* Try again. */ continue; } else { /* Error occured. */ device_set_error(d_self, vstrallocf(_("Error reading fd %d: %s"), fd, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR); *count = got; return RESULT_ERROR; } } *count = got; return RESULT_SUCCESS; } static IoResult vfs_device_robust_write(VfsDevice * self, char *buf, int count) { int fd = self->open_file_fd; Device *d_self = DEVICE(self); int rval = 0; while (rval < count) { int result; result = write(fd, buf + rval, count - rval); if (result > 0) { rval += result; continue; } else if (0 #ifdef EAGAIN || errno == EAGAIN #endif #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif #ifdef EINTR || errno == EINTR #endif ) { /* Try again. */ continue; } else if (0 #ifdef EFBIG || errno == EFBIG #endif #ifdef ENOSPC || errno == ENOSPC #endif ) { /* We are definitely out of space. */ device_set_error(d_self, vstrallocf(_("No space left on device: %s"), strerror(errno)), DEVICE_STATUS_VOLUME_ERROR); return RESULT_NO_SPACE; } else { /* Error occured. Note that here we handle EIO as an error. */ device_set_error(d_self, vstrallocf(_("Error writing device fd %d: %s"), fd, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR); return RESULT_ERROR; } } return RESULT_SUCCESS; } /* TODO: add prop */ amanda-3.3.6/device-src/device.c0000664000076400007640000012621112357250004020070 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* The Device API abstracts device workings, interaction, properties, and * capabilities from the rest of the Amanda code base. It supports * pluggable modules for different kinds of devices. */ #include "amanda.h" #include "conffile.h" #include #include "device.h" #include "property.h" #include "timestamp.h" #include "util.h" /* * Prototypes for subclass registration functions */ void null_device_register (void); void rait_device_register (void); #ifdef WANT_S3_DEVICE void s3_device_register (void); #endif #ifdef WANT_TAPE_DEVICE void tape_device_register (void); #endif void vfs_device_register (void); #ifdef WANT_DVDRW_DEVICE void dvdrw_device_register (void); #endif #ifdef WANT_NDMP_DEVICE void ndmp_device_register (void); #endif /* * Registration infrastructure */ static GHashTable* driverList = NULL; void device_api_init(void) { glib_init(); device_property_init(); driverList = g_hash_table_new(g_str_hash, g_str_equal); device_status_flags_get_type(); /* to register it */ device_get_type(); /* to register it */ /* register other types and devices. */ null_device_register(); vfs_device_register(); #ifdef WANT_TAPE_DEVICE tape_device_register(); #endif rait_device_register(); #ifdef WANT_S3_DEVICE s3_device_register(); #endif #ifdef WANT_DVDRW_DEVICE dvdrw_device_register(); #endif #ifdef WANT_NDMP_DEVICE ndmp_device_register(); #endif } void register_device( DeviceFactory factory, const char ** device_prefix_list) { char ** tmp; g_assert(driverList != NULL); g_assert(factory != NULL); g_return_if_fail(device_prefix_list != NULL); g_return_if_fail(*device_prefix_list != NULL); tmp = (char**)device_prefix_list; while (*tmp != NULL) { g_hash_table_insert(driverList, *tmp, (gpointer)factory); tmp ++; } } static DeviceFactory lookup_device_factory(const char *device_type) { gpointer key, value; g_assert(driverList != NULL); if (g_hash_table_lookup_extended(driverList, device_type, &key, &value)) { return (DeviceFactory)value; } else { return NULL; } } static const GFlagsValue device_status_flags_values[] = { { DEVICE_STATUS_SUCCESS, "DEVICE_STATUS_SUCCESS", "Success" }, { DEVICE_STATUS_DEVICE_ERROR, "DEVICE_STATUS_DEVICE_ERROR", "Device error" }, { DEVICE_STATUS_DEVICE_BUSY, "DEVICE_STATUS_DEVICE_BUSY", "Device busy" }, { DEVICE_STATUS_VOLUME_MISSING, "DEVICE_STATUS_VOLUME_MISSING", "Volume not found" }, { DEVICE_STATUS_VOLUME_UNLABELED, "DEVICE_STATUS_VOLUME_UNLABELED", "Volume not labeled" }, { DEVICE_STATUS_VOLUME_ERROR, "DEVICE_STATUS_VOLUME_ERROR", "Volume error" }, { 0, NULL, NULL } }; GType device_status_flags_get_type(void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { type = g_flags_register_static("DeviceStatusFlags", device_status_flags_values); } return type; } /* Device class definition starts here. */ struct DevicePrivate_s { /* hash table mapping ID to SimpleProperty object */ GHashTable * simple_properties; /* In writing mode, after a short block is written, no additional blocks * are allowed the file is finished and a new file started. This is only * used for assertions. */ gboolean wrote_short_block; /* Holds an error message if the function returned an error. */ char * errmsg; /* temporary holding place for device_status_error() */ char * statusmsg; DeviceStatusFlags last_status; }; /* This holds the default response to a particular property. */ typedef struct { DeviceProperty *prop; GValue response; PropertySurety surety; PropertySource source; } SimpleProperty; #define selfp (self->private) /* here are local prototypes, so we can make function pointers. */ static void device_init (Device * o); static void device_class_init (DeviceClass * c); static void device_base_init (DeviceClass * c); static void simple_property_free(SimpleProperty *o); static void default_device_open_device(Device * self, char * device_name, char * device_type, char * device_node); static gboolean default_device_configure(Device *self, gboolean use_global_config); static gboolean default_device_property_get_ex(Device * self, DevicePropertyId id, GValue * val, PropertySurety *surety, PropertySource *source); static gboolean default_device_property_set_ex(Device *self, DevicePropertyId id, GValue * val, PropertySurety surety, PropertySource source); static void set_properties_from_global_config(Device * device); static void set_properties_from_device_config(Device * device, device_config_t *dc); static gboolean property_get_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_set_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean property_get_min_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_max_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_canonical_name_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); /* pointer to the class of our parent */ static GObjectClass *parent_class = NULL; GType device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DeviceClass), (GBaseInitFunc) device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (Device), 0 /* n_preallocs */, (GInstanceInitFunc) device_init, NULL }; type = g_type_register_static (G_TYPE_OBJECT, "Device", &info, (GTypeFlags)G_TYPE_FLAG_ABSTRACT); } return type; } static void device_finalize(GObject *obj_self) { Device *self G_GNUC_UNUSED = DEVICE (obj_self); if(G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); /* Here we call device_finish() if it hasn't been done yet. Subclasses may need to do this same check earlier. */ if (self->access_mode != ACCESS_NULL) { device_finish(self); } amfree(self->device_name); amfree(self->volume_label); amfree(self->volume_time); amfree(self->volume_header); if (self->device_mutex) { g_mutex_free(self->device_mutex); self->device_mutex = NULL; } amfree(selfp->errmsg); amfree(selfp->statusmsg); g_hash_table_destroy(selfp->simple_properties); amfree(self->private); } static void device_init (Device * self) { self->private = malloc(sizeof(DevicePrivate)); self->device_name = NULL; self->access_mode = ACCESS_NULL; self->is_eof = FALSE; self->is_eom = FALSE; self->file = -1; self->block = 0; self->in_file = FALSE; self->volume_label = NULL; self->volume_time = NULL; self->status = DEVICE_STATUS_SUCCESS; self->min_block_size = 1; self->max_block_size = SIZE_MAX; /* subclasses *really* should choose something smaller */ self->block_size = DISK_BLOCK_BYTES; selfp->errmsg = NULL; selfp->statusmsg = NULL; selfp->last_status = 0; selfp->simple_properties = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) simple_property_free); } static void device_class_init (DeviceClass * device_class) { GObjectClass *g_object_class = (GObjectClass*) device_class; parent_class = g_type_class_ref (G_TYPE_OBJECT); device_class->directtcp_supported = FALSE; device_class->open_device = default_device_open_device; device_class->configure = default_device_configure; device_class->property_get_ex = default_device_property_get_ex; device_class->property_set_ex = default_device_property_set_ex; g_object_class->finalize = device_finalize; } static void device_base_init (DeviceClass * device_class) { /* The base_init function is called once each time a child class is * created, before the class_init functions (even our own) are called. */ device_class->class_properties = g_array_new(FALSE, TRUE, sizeof(DeviceProperty)); device_class->class_properties_list = NULL; device_class_register_property(device_class, PROPERTY_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, property_get_block_size_fn, property_set_block_size_fn); device_class_register_property(device_class, PROPERTY_MIN_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK, property_get_min_block_size_fn, NULL); device_class_register_property(device_class, PROPERTY_MAX_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK, property_get_max_block_size_fn, NULL); device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, PROPERTY_ACCESS_GET_MASK, property_get_canonical_name_fn, NULL); device_class_register_property(device_class, PROPERTY_CONCURRENCY, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_STREAMING, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_APPENDABLE, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_PARTIAL_DELETION, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_FULL_DELETION, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_COMMENT, PROPERTY_ACCESS_GET_MASK|PROPERTY_ACCESS_SET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK, device_simple_property_get_fn, device_simple_property_set_fn); } static void simple_property_free(SimpleProperty * resp) { g_value_unset(&(resp->response)); amfree(resp); } static char * regex_message(int result, regex_t *regex) { char * rval; size_t size; size = regerror(result, regex, NULL, 0); rval = malloc(size); regerror(result, regex, rval, size); return rval; } static gboolean handle_device_regex(const char * user_name, char ** driver_name, char ** device, char **errmsg) { regex_t regex; int reg_result; regmatch_t pmatch[3]; static const char * regex_string = "^([a-z0-9]+):(.*)$"; bzero(®ex, sizeof(regex)); reg_result = regcomp(®ex, regex_string, REG_EXTENDED | REG_ICASE); if (reg_result != 0) { char * message = regex_message(reg_result, ®ex); *errmsg = newvstrallocf(*errmsg, "Error compiling regular expression \"%s\": %s\n", regex_string, message); amfree(message); return FALSE; } reg_result = regexec(®ex, user_name, 3, pmatch, 0); if (reg_result != 0 && reg_result != REG_NOMATCH) { char * message = regex_message(reg_result, ®ex); *errmsg = newvstrallocf(*errmsg, "Error applying regular expression \"%s\" to string \"%s\": %s\n", user_name, regex_string, message); amfree(message); regfree(®ex); return FALSE; } else if (reg_result == REG_NOMATCH) { #ifdef WANT_TAPE_DEVICE g_warning( "\"%s\" uses deprecated device naming convention; \n" "using \"tape:%s\" instead.\n", user_name, user_name); *driver_name = stralloc("tape"); *device = stralloc(user_name); #else /* !WANT_TAPE_DEVICE */ *errmsg = newvstrallocf(*errmsg, "\"%s\" is not a valid device name.\n", user_name); regfree(®ex); return FALSE; #endif /* WANT_TAPE_DEVICE */ } else { *driver_name = find_regex_substring(user_name, pmatch[1]); *device = find_regex_substring(user_name, pmatch[2]); } regfree(®ex); return TRUE; } /* helper function for device_open */ static Device * make_null_error(char *errmsg, DeviceStatusFlags status) { DeviceFactory factory; Device *device; factory = lookup_device_factory("null"); g_assert(factory != NULL); device = factory("null:", "null", ""); device_set_error(device, errmsg, status); return device; } char * device_unaliased_name( char *device_name) { device_config_t *dc; char *unaliased_name; /* look up the unaliased device name in the configuration */ if ((dc = lookup_device_config(device_name))) { if (!(unaliased_name = device_config_get_tapedev(dc)) || unaliased_name[0] == '\0') { return NULL; } } else { unaliased_name = device_name; } return unaliased_name; } Device* device_open (char * device_name) { char *device_type = NULL; char *device_node = NULL; char *errmsg = NULL; char *unaliased_name = NULL; DeviceFactory factory; Device *device; g_assert(device_name != NULL); if (driverList == NULL) { g_critical("device_open() called without device_api_init()!"); g_assert_not_reached(); } if (device_name == NULL) return make_null_error(stralloc(_("No device name specified")), DEVICE_STATUS_DEVICE_ERROR); unaliased_name = device_unaliased_name(device_name); if (!unaliased_name) { return make_null_error( vstrallocf(_("Device '%s' has no tapedev"), device_name), DEVICE_STATUS_DEVICE_ERROR); } if (!handle_device_regex(unaliased_name, &device_type, &device_node, &errmsg)) { amfree(device_type); amfree(device_node); return make_null_error(errmsg, DEVICE_STATUS_DEVICE_ERROR); } factory = lookup_device_factory(device_type); if (factory == NULL) { Device *nulldev = make_null_error(vstrallocf(_("Device type %s is not known."), device_type), DEVICE_STATUS_DEVICE_ERROR); amfree(device_type); amfree(device_node); return nulldev; } device = factory(device_name, device_type, device_node); g_assert(device != NULL); /* factories must always return a device */ device->device_mutex = g_mutex_new(); amfree(device_type); amfree(device_node); return device; } char * device_error(Device * self) { if (self == NULL) { return device_error_or_status(self); } else if (selfp->errmsg) { return selfp->errmsg; } else { return "Unknown Device error"; } } char * device_status_error(Device * self) { char **status_strv; char *statusmsg; if (self == NULL) { return device_error_or_status(self); } /* reuse a previous statusmsg, if it was for the same status */ if (selfp->statusmsg && selfp->last_status == self->status) return selfp->statusmsg; amfree(selfp->statusmsg); status_strv = g_flags_nick_to_strv(self->status, DEVICE_STATUS_FLAGS_TYPE); g_assert(g_strv_length(status_strv) > 0); if (g_strv_length(status_strv) == 1) { statusmsg = stralloc(*status_strv); } else { char * status_list = g_english_strjoinv(status_strv, "or"); statusmsg = g_strdup_printf("one of %s", status_list); amfree(status_list); } g_strfreev(status_strv); selfp->statusmsg = statusmsg; selfp->last_status = self->status; return statusmsg; } char * device_error_or_status(Device * self) { if (self == NULL) { return "Device is NULL"; } else if (selfp->errmsg) { return selfp->errmsg; } else { return device_status_error(self); } } void device_set_error(Device *self, char *errmsg, DeviceStatusFlags new_flags) { char **flags_strv; char *flags_str; char *device_name; if (!self) { g_warning("device_set_error called with a NULL device: '%s'", errmsg? errmsg:"(NULL)"); amfree(errmsg); return; } device_name = self->device_name? self->device_name : "(unknown device)"; if (errmsg && (!selfp->errmsg || strcmp(errmsg, selfp->errmsg) != 0)) g_debug("Device %s error = '%s'", device_name, errmsg); amfree(selfp->errmsg); selfp->errmsg = errmsg; if (new_flags != DEVICE_STATUS_SUCCESS) { flags_strv = g_flags_name_to_strv(new_flags, DEVICE_STATUS_FLAGS_TYPE); g_assert(g_strv_length(flags_strv) > 0); flags_str = g_english_strjoinv(flags_strv, "and"); g_debug("Device %s setting status flag(s): %s", device_name, flags_str); amfree(flags_str); g_strfreev(flags_strv); } self->status = new_flags; } char * device_build_amanda_header(Device * self, const dumpfile_t * info, size_t *size) { return build_header(info, size, self->block_size); } dumpfile_t * make_tapestart_header(Device * self, char * label, char * timestamp) { dumpfile_t * rval; GValue val; bzero(&val, sizeof(val)); g_assert(label != NULL); rval = malloc(sizeof(*rval)); fh_init(rval); rval->type = F_TAPESTART; if (device_property_get(self, PROPERTY_BLOCK_SIZE, &val)) { rval->blocksize = g_value_get_int(&val); g_value_unset(&val); } amfree(self->volume_time); if (get_timestamp_state(timestamp) == TIME_STATE_REPLACE) { self->volume_time = get_proper_stamp_from_time(time(NULL)); } else { self->volume_time = g_strdup(timestamp); } g_strlcpy(rval->datestamp, self->volume_time, sizeof(rval->datestamp)); g_strlcpy(rval->name, label, sizeof(rval->name)); return rval; } dumpfile_t * make_tapeend_header(void) { dumpfile_t * rval; char * timestamp; rval = malloc(sizeof(*rval)); rval->type = F_TAPEEND; timestamp = get_timestamp_from_time(time(NULL)); g_strlcpy(rval->datestamp, timestamp, sizeof(rval->datestamp)); amfree(timestamp); return rval; } /* Try setting the blocksize on a device. Check results, fallback, and * set error status for problems. */ static gboolean try_set_blocksize(Device * device, guint blocksize) { GValue val; gboolean success; bzero(&val, sizeof(val)); g_value_init(&val, G_TYPE_INT); g_value_set_int(&val, blocksize); success = device_property_set(device, PROPERTY_BLOCK_SIZE, &val); g_value_unset(&val); if (!success) { device_set_error(device, vstrallocf(_("Setting BLOCK_SIZE to %u " "not supported for device %s.\n"), blocksize, device->device_name), DEVICE_STATUS_DEVICE_ERROR); } return success; } /* A GHFunc (callback for g_hash_table_foreach) */ static void set_device_property(gpointer key_p, gpointer value_p, gpointer user_data_p) { char * property_s = key_p; property_t * property = value_p; Device * device = user_data_p; const DevicePropertyBase* property_base; GValue property_value; char * value; g_return_if_fail(IS_DEVICE(device)); g_return_if_fail(property_s != NULL); g_return_if_fail(property != NULL); g_return_if_fail(property->values != NULL); /* don't continue beating on a device that's already erroring */ if (device_in_error(device)) return; property_base = device_property_get_by_name(property_s); if (property_base == NULL) { /* Nonexistant property name. */ device_set_error(device, vstrallocf(_("unknown device property name '%s'"), property_s), DEVICE_STATUS_DEVICE_ERROR); return; } if (g_slist_length(property->values) > 1) { device_set_error(device, vstrallocf(_("multiple values for device property '%s'"), property_s), DEVICE_STATUS_DEVICE_ERROR); return; } bzero(&property_value, sizeof(property_value)); g_value_init(&property_value, property_base->type); value = property->values->data; if (!g_value_set_from_string(&property_value, value)) { /* Value type could not be interpreted. */ device_set_error(device, vstrallocf(_("Could not parse property value '%s' for property '%s' (property type %s)"), value, property_base->name, g_type_name(property_base->type)), DEVICE_STATUS_DEVICE_ERROR); return; } else { g_assert (G_VALUE_HOLDS(&property_value, property_base->type)); } if (!device_property_set(device, property_base->ID, &property_value)) { /* Device rejects property. */ if (!device_in_error(device)) { device_set_error(device, vstrallocf(_("Could not set property '%s' to '%s' on %s"), property_base->name, value, device->device_name), DEVICE_STATUS_DEVICE_ERROR); } return; } } /* Set up properties based on various taper-related configuration parameters * and from the tapetype. */ static void set_properties_from_global_config(Device * device) { char * tapetype_name = getconf_str(CNF_TAPETYPE); if (tapetype_name != NULL) { tapetype_t * tapetype = lookup_tapetype(tapetype_name); if (tapetype != NULL) { GValue val; guint64 length; guint blocksize_kb; gboolean success; bzero(&val, sizeof(GValue)); if (tapetype_seen(tapetype, TAPETYPE_LENGTH)) { length = tapetype_get_length(tapetype); g_value_init(&val, G_TYPE_UINT64); g_value_set_uint64(&val, length * 1024); /* If this fails, it's not really an error. */ device_property_set(device, PROPERTY_MAX_VOLUME_USAGE, &val); g_value_unset(&val); } if (tapetype_seen(tapetype, TAPETYPE_READBLOCKSIZE)) { blocksize_kb = tapetype_get_readblocksize(tapetype); g_value_init(&val, G_TYPE_UINT); g_value_set_uint(&val, blocksize_kb * 1024); success = device_property_set(device, PROPERTY_READ_BLOCK_SIZE, &val); g_value_unset(&val); if (!success) { /* a non-fatal error */ g_warning("Setting READ_BLOCK_SIZE to %ju not supported for device %s.", 1024*(uintmax_t)blocksize_kb, device->device_name); } } if (tapetype_seen(tapetype, TAPETYPE_BLOCKSIZE)) { blocksize_kb = tapetype_get_blocksize(tapetype); /* TODO: handle errors */ (void)try_set_blocksize(device, blocksize_kb * 1024); } } } g_hash_table_foreach(getconf_proplist(CNF_DEVICE_PROPERTY), set_device_property, device); } /* Set properties specified within a device definition */ static void set_properties_from_device_config(Device * device, device_config_t *dc) { g_hash_table_foreach(device_config_get_property(dc), set_device_property, device); } static gboolean default_device_configure(Device *self, gboolean use_global_config) { device_config_t *dc; if (device_in_error(self)) return FALSE; if (use_global_config) set_properties_from_global_config(self); if (device_in_error(self)) return FALSE; if ((dc = lookup_device_config(self->device_name))) set_properties_from_device_config(self, dc); return !device_in_error(self); } void device_clear_volume_details(Device * device) { if (device == NULL || device->access_mode != ACCESS_NULL) { return; } amfree(device->volume_label); amfree(device->volume_time); } /* Here we put default implementations of virtual functions. Since this class is virtual, many of these functions offer at best incomplete functionality. But they do offer the useful commonality that all devices can expect to need. */ static void default_device_open_device(Device * self, char * device_name, char * device_type G_GNUC_UNUSED, char * device_node G_GNUC_UNUSED) { /* Set the device_name property */ self->device_name = stralloc(device_name); } static gboolean property_get_block_size_fn( Device *self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { g_value_unset_init(val, G_TYPE_INT); g_assert(self->block_size < G_MAXINT); /* gsize -> gint */ g_value_set_int(val, (gint)self->block_size); if (surety) *surety = self->block_size_surety; if (source) *source = self->block_size_source; return TRUE; } static gboolean property_set_block_size_fn( Device *self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety, PropertySource source) { gint block_size = g_value_get_int(val); g_assert(block_size >= 0); /* int -> gsize (unsigned) */ if ((gsize)block_size < self->min_block_size || (gsize)block_size > self->max_block_size) { device_set_error(self, g_strdup_printf("Error setting BLOCK-SIZE property to '%zu', it must be between %zu and %zu", (gsize)block_size, self->min_block_size, self->max_block_size), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } self->block_size = block_size; self->block_size_surety = surety; self->block_size_source = source; return TRUE; } static gboolean property_get_min_block_size_fn( Device *self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { g_value_unset_init(val, G_TYPE_UINT); g_assert(self->block_size < G_MAXUINT); /* gsize -> guint */ g_value_set_uint(val, (guint)self->min_block_size); if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DEFAULT; return TRUE; } static gboolean property_get_max_block_size_fn( Device *self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { g_value_unset_init(val, G_TYPE_UINT); g_assert(self->block_size < G_MAXUINT); /* gsize -> guint */ g_value_set_uint(val, (guint)self->max_block_size); if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DEFAULT; return TRUE; } static gboolean property_get_canonical_name_fn( Device *self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { g_value_unset_init(val, G_TYPE_STRING); g_value_set_string(val, self->device_name); if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DEFAULT; return TRUE; } /* util function */ static PropertyPhaseFlags state_to_phase( Device *self) { if (self->access_mode == ACCESS_NULL) { return PROPERTY_PHASE_BEFORE_START; } else if (IS_WRITABLE_ACCESS_MODE(self->access_mode)) { if (self->in_file) { return PROPERTY_PHASE_INSIDE_FILE_WRITE; } else { return PROPERTY_PHASE_BETWEEN_FILE_WRITE; } } else { /* read mode */ if (self->in_file) { return PROPERTY_PHASE_INSIDE_FILE_READ; } else { return PROPERTY_PHASE_BETWEEN_FILE_READ; } } } /* This default implementation serves up static responses, and implements a few default responses based on values from the Device struct. */ static gboolean default_device_property_get_ex( Device * self, DevicePropertyId id, GValue * val, PropertySurety *surety, PropertySource *source) { DeviceProperty *prop; GArray *class_properties; PropertyPhaseFlags cur_phase; /* Most of this function's job is to sanity-check everything, then * call the relevant getter. */ class_properties = DEVICE_GET_CLASS(self)->class_properties; if (id >= class_properties->len) return FALSE; prop = &g_array_index(class_properties, DeviceProperty, id); if (prop->base == NULL) return FALSE; if (val || surety || source) { /* check the phase */ cur_phase = state_to_phase(self); if (!(prop->access & cur_phase)) return FALSE; if (prop->getter == NULL) return FALSE; if (!prop->getter(self, prop->base, val, surety, source)) return FALSE; } return TRUE; } static gboolean default_device_property_set_ex( Device *self, DevicePropertyId id, GValue * val, PropertySurety surety, PropertySource source) { DeviceProperty *prop; GArray *class_properties; PropertyPhaseFlags cur_phase; /* Most of this function's job is to sanity-check everything, then * call the relevant setter. */ if (device_in_error(self)) return FALSE; class_properties = DEVICE_GET_CLASS(self)->class_properties; if (id >= class_properties->len) return FALSE; prop = &g_array_index(class_properties, DeviceProperty, id); if (prop->base == NULL) return FALSE; /* check that the type matches */ if (!G_VALUE_HOLDS(val, prop->base->type)) return FALSE; /* check the phase */ cur_phase = state_to_phase(self) << PROPERTY_PHASE_SHIFT; if (!(prop->access & cur_phase)) return FALSE; if (prop->setter == NULL) return FALSE; if (!prop->setter(self, prop->base, val, surety, source)) return FALSE; return TRUE; } const GSList * device_property_get_list (Device * self) { g_assert(IS_DEVICE(self)); return DEVICE_GET_CLASS(self)->class_properties_list; } /* XXX WARNING XXX * All the functions below this comment are stub functions that do nothing * but implement the virtual function table. Call these functions and they * will do what you expect vis-a-vis virtual functions. But don't put code * in them beyond error checking and VFT lookup. */ void device_open_device (Device * self, char * device_name, char * device_type, char * device_node) { DeviceClass *klass; g_assert(IS_DEVICE(self)); g_assert(device_name != NULL); klass = DEVICE_GET_CLASS(self); g_assert(klass->open_device); (klass->open_device)(self, device_name, device_type, device_node); } DeviceStatusFlags device_read_label(Device * self) { DeviceClass * klass; g_assert(self != NULL); g_assert(IS_DEVICE(self)); g_assert(self->access_mode == ACCESS_NULL); klass = DEVICE_GET_CLASS(self); g_assert(klass->read_label); return (klass->read_label)(self); } gboolean device_finish (Device * self) { DeviceClass *klass; g_assert(IS_DEVICE (self)); klass = DEVICE_GET_CLASS(self); g_assert(klass->finish); return (klass->finish)(self); } guint64 device_get_bytes_read (Device * self) { DeviceClass *klass; guint64 bytes = 0; g_assert(IS_DEVICE (self)); g_mutex_lock(self->device_mutex); if (self->in_file) { klass = DEVICE_GET_CLASS(self); if (klass->get_bytes_read) { bytes = (klass->get_bytes_read)(self); } else { bytes = self->bytes_read; } } g_mutex_unlock(self->device_mutex); return bytes; } guint64 device_get_bytes_written (Device * self) { DeviceClass *klass; guint64 bytes = 0; g_assert(IS_DEVICE (self)); g_mutex_lock(self->device_mutex); if (self->in_file) { klass = DEVICE_GET_CLASS(self); if (klass->get_bytes_written) { bytes = (klass->get_bytes_written)(self); } else { bytes = self->bytes_written; } } g_mutex_unlock(self->device_mutex); return bytes; } gboolean device_configure (Device * self, gboolean use_global_config) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_NULL); klass = DEVICE_GET_CLASS(self); if(klass->configure) { return (klass->configure)(self, use_global_config); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } gboolean device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp) { DeviceClass *klass; char * local_timestamp = NULL; gboolean rv; g_assert(IS_DEVICE (self)); g_assert(mode != ACCESS_NULL); g_assert(mode != ACCESS_WRITE || label != NULL); klass = DEVICE_GET_CLASS(self); g_assert(klass->start); /* For a good combination of synchronization and public simplicity, this stub function does not require a timestamp, but the actual implementation function does. We generate the timestamp here with time(). */ if (mode == ACCESS_WRITE && get_timestamp_state(timestamp) == TIME_STATE_REPLACE) { local_timestamp = timestamp = get_proper_stamp_from_time(time(NULL)); } rv = (klass->start)(self, mode, label, timestamp); amfree(local_timestamp); return rv; } gboolean device_write_block (Device * self, guint size, gpointer block) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(size > 0); /* these are all things that the caller should take care to * guarantee, so we just assert them here */ g_assert(size <= self->block_size); g_assert(self->in_file); g_assert(!selfp->wrote_short_block); g_assert(block != NULL); g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); if (size < self->block_size) selfp->wrote_short_block = TRUE; klass = DEVICE_GET_CLASS(self); g_assert(klass->write_block); return (*klass->write_block)(self,size, block); } gboolean device_start_file (Device * self, dumpfile_t * jobInfo) { DeviceClass * klass; g_assert(IS_DEVICE (self)); g_assert(!(self->in_file)); g_assert(jobInfo != NULL); selfp->wrote_short_block = FALSE; klass = DEVICE_GET_CLASS(self); g_assert(klass->start_file); return (klass->start_file)(self, jobInfo ); } gboolean device_finish_file (Device * self) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); g_assert(self->in_file); klass = DEVICE_GET_CLASS(self); g_assert(klass->finish_file); return (klass->finish_file)(self); } dumpfile_t* device_seek_file (Device * self, guint file) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_READ); klass = DEVICE_GET_CLASS(self); g_assert(klass->seek_file); return (klass->seek_file)(self,file); } gboolean device_seek_block (Device * self, guint64 block) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_READ); g_assert(self->in_file); klass = DEVICE_GET_CLASS(self); g_assert(klass->seek_block); return (klass->seek_block)(self,block); } int device_read_block (Device * self, gpointer buffer, int * size) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(size != NULL); g_assert(self->access_mode == ACCESS_READ); if (*size != 0) { g_assert(buffer != NULL); } klass = DEVICE_GET_CLASS(self); g_assert(klass->read_block); return (klass->read_block)(self,buffer,size); } gboolean device_property_get_ex( Device * self, DevicePropertyId id, GValue * val, PropertySurety *surety, PropertySource *source) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(device_property_get_by_id(id) != NULL); klass = DEVICE_GET_CLASS(self); g_assert(klass->property_get_ex); return (klass->property_get_ex)(self, id, val, surety, source); } gboolean device_property_set_ex( Device * self, DevicePropertyId id, GValue * val, PropertySurety surety, PropertySource source) { DeviceClass *klass; g_assert(IS_DEVICE (self)); klass = DEVICE_GET_CLASS(self); g_assert(klass->property_set_ex); return (klass->property_set_ex)(self, id, val, surety, source); } gboolean device_recycle_file (Device * self, guint filenum) { DeviceClass *klass; g_assert(self != NULL); g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_APPEND); g_assert(!self->in_file); klass = DEVICE_GET_CLASS(self); g_assert(klass->recycle_file); return (klass->recycle_file)(self,filenum); } gboolean device_erase (Device * self) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_NULL); g_assert(!self->in_file); klass = DEVICE_GET_CLASS(self); if(klass->erase) { return (klass->erase)(self); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } gboolean device_eject (Device * self) { DeviceClass *klass; g_assert(IS_DEVICE (self)); g_assert(self->access_mode == ACCESS_NULL); g_assert(!self->in_file); klass = DEVICE_GET_CLASS(self); if (klass->eject) { return (klass->eject)(self); } else { return TRUE; } } gboolean device_listen( Device *self, gboolean for_writing, DirectTCPAddr **addrs) { DeviceClass *klass; klass = DEVICE_GET_CLASS(self); if(klass->listen) { return (klass->listen)(self, for_writing, addrs); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } int device_accept( Device *self, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { DeviceClass *klass; klass = DEVICE_GET_CLASS(self); if(klass->accept) { return (klass->accept)(self, conn, cancelled, abort_mutex, abort_cond); } else { device_set_error(self, g_strdup(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return 1; } } int device_connect( Device *self, gboolean for_writing, DirectTCPAddr *addrs, DirectTCPConnection **conn, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { DeviceClass *klass; klass = DEVICE_GET_CLASS(self); if(klass->connect) { return (klass->connect)(self, for_writing, addrs, conn, cancelled, abort_mutex, abort_cond); } else { device_set_error(self, g_strdup(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return 1; } } int device_write_from_connection( Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { DeviceClass *klass; klass = DEVICE_GET_CLASS(self); g_assert(self->in_file); g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); if(klass->write_from_connection) { return (klass->write_from_connection)(self, size, actual_size, cancelled, abort_mutex, abort_cond); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return 1; } } int device_read_to_connection( Device *self, guint64 size, guint64 *actual_size, int *cancelled, GMutex *abort_mutex, GCond *abort_cond) { DeviceClass *klass; g_assert(self->in_file); g_assert(self->access_mode == ACCESS_READ); klass = DEVICE_GET_CLASS(self); if(klass->read_to_connection) { return (klass->read_to_connection)(self, size, actual_size, cancelled, abort_mutex, abort_cond); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return 1; } } gboolean device_use_connection( Device *self, DirectTCPConnection *conn) { DeviceClass *klass; g_assert(self->access_mode == ACCESS_NULL); klass = DEVICE_GET_CLASS(self); if(klass->use_connection) { return (klass->use_connection)(self, conn); } else { device_set_error(self, stralloc(_("Unimplemented method")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } /* Property handling */ void device_class_register_property( DeviceClass *klass, DevicePropertyId id, PropertyAccessFlags access, PropertyGetFn getter, PropertySetFn setter) { DevicePropertyBase *base; DeviceProperty *prop; GSList *proplist; guint i; g_assert(klass != NULL); base = device_property_get_by_id(id); g_assert(base != NULL); if (klass->class_properties->len <= id) { g_array_set_size(klass->class_properties, id+1); } prop = &g_array_index(klass->class_properties, DeviceProperty, id); prop->base = base; prop->access = access; prop->getter = getter; prop->setter = setter; /* completely rewrite the list of prop pointers, as they may have changed, * or we may have replaced an existing property*/ if (klass->class_properties_list) { g_slist_free(klass->class_properties_list); } proplist = NULL; for (i = 0; i < klass->class_properties->len; i++) { prop = &g_array_index(klass->class_properties, DeviceProperty, i); if (!prop->base) continue; proplist = g_slist_prepend(proplist, prop); } klass->class_properties_list = proplist; } gboolean device_set_simple_property( Device *self, DevicePropertyId id, GValue *val, PropertySurety surety, PropertySource source) { SimpleProperty *simp; DeviceProperty *prop; prop = &g_array_index(DEVICE_GET_CLASS(self)->class_properties, DeviceProperty, id); /* these assertions should already be checked, but let's be sure */ g_assert(prop->base != NULL); /* prop must be registered with device */ g_assert(G_VALUE_HOLDS(val, prop->base->type)); simp = g_new0(SimpleProperty, 1); simp->prop = prop; g_value_unset_copy(val, &(simp->response)); simp->surety = surety; simp->source = source; g_hash_table_insert(selfp->simple_properties, GINT_TO_POINTER(id), simp); return TRUE; } gboolean device_simple_property_set_fn( Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { return device_set_simple_property(self, base->ID, val, surety, source); } gboolean device_get_simple_property( Device *self, DevicePropertyId id, GValue *val, PropertySurety *surety, PropertySource *source) { SimpleProperty *simp = g_hash_table_lookup(selfp->simple_properties, GINT_TO_POINTER(id)); if (!simp) return FALSE; if (val) g_value_unset_copy(&(simp->response), val); if (surety) *surety = simp->surety; if (source) *source = simp->source; return TRUE; } gboolean device_simple_property_get_fn( Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source) { return device_get_simple_property(self, base->ID, val, surety, source); } amanda-3.3.6/device-src/s3.h0000664000076400007640000004626612357250004017176 0ustar00martineamartinea00000000000000/* * Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #ifndef __S3_H__ #define __S3_H__ #include #include /* * Data types */ typedef enum { S3_API_S3, S3_API_SWIFT_1, S3_API_SWIFT_2, S3_API_OAUTH2, S3_API_CASTOR } S3_api; /* An opaque handle. S3Handles should only be accessed from a single * thread at any given time, although it is fine to use different handles * in different threads simultaneously. */ typedef struct S3Handle S3Handle; /* Callback function to read data to upload * * @note this is the same as CURLOPT_READFUNCTION * * @param data: The pointer to write data to * @param size: The size of each "element" of the data buffer in bytes * @param nmemb: The number of elements in the data buffer. * So, the buffer's size is size*nmemb bytes. * @param stream: The read_data (an opaque pointer) * * @return The number of bytes written to the buffer, * CURL_READFUNC_PAUSE to pause, or CURL_READFUNC_ABORT to abort. * Return 0 only if there's no more data to be uploaded. */ typedef size_t (*s3_read_func)(void *data, size_t size, size_t nmemb, void *stream); /* This function is called to get size of the upload data * * @param data: The write_data (opaque pointer) * * @return The number of bytes of data, negative for error */ typedef size_t (*s3_size_func)(void *data); /* This function is called to get MD5 hash of the upload data * * @param data: The write_data (opaque pointer) * * @return The MD5 hash, NULL on error */ typedef GByteArray* (*s3_md5_func)(void *data); /* This function is called to reset an upload or download data stream * to the beginning * * @param data: The read_data or write_data (opaque pointer) * * @return The number of bytes of data, negative for error */ typedef void (*s3_reset_func)(void *data); /* Callback function to write data that's been downloaded * * @note this is the same as CURLOPT_WRITEFUNCTION * * @param data: The pointer to read data from * @param size: The size of each "element" of the data buffer in bytes * @param nmemb: The number of elements in the data buffer. * So, the buffer's size is size*nmemb bytes. * @param stream: the write_data (an opaque pointer) * * @return The number of bytes written to the buffer or * CURL_WRITEFUNC_PAUSE to pause. * If it's the number of bytes written, it should match the buffer size */ typedef size_t (*s3_write_func)(void *data, size_t size, size_t nmemb, void *stream); /** * Callback function to track progress * * @note this is the same as CURLOPT_PROGRESSFUNCTION * * @param data: The progress_data * @param dltotal: The total number of bytes to downloaded * @param dlnow: The current number of bytes downloaded * @param ultotal: The total number of bytes to downloaded * @param ulnow: The current number of bytes downloaded * * @return 0 to continue, non-zero to abort. */ typedef curl_progress_callback s3_progress_func; /* * Constants */ /* These are assumed to be already URL-escaped. */ # define STS_BASE_URL "https://ls.amazonaws.com/" # define STS_PRODUCT_TOKEN "{ProductToken}AAAGQXBwVGtu4geoGybuwuk8VEEPzJ9ZANpu0yzbf9g4Gs5Iarzff9B7qaDBEEaWcAzWpcN7zmdMO765jOtEFc4DWTRNkpPSzUnTdkHbdYUamath73OreaZtB86jy/JF0gsHZfhxeKc/3aLr8HNT//DsX3r272zYHLDPWWUbFguOwqNjllnt6BshYREx59l8RrWABLSa37dyJeN+faGvz3uQxiDakZRn3LfInOE6d9+fTFl50LPoP08LCqI/SJfpouzWix7D/cep3Jq8yYNyM1rgAOTF7/wh7r8OuPDLJ/xZUDLfykePIAM=" /* This preprocessor magic will enumerate constants named S3_ERROR_XxxYyy for * each of the errors in parentheses. * * see http://docs.amazonwebservices.com/AmazonS3/latest/API/ErrorResponses.html * for Amazon's breakdown of error responses. */ #define S3_ERROR_LIST \ S3_ERROR(None), \ S3_ERROR(Accepted), \ S3_ERROR(AccessDenied), \ S3_ERROR(AccountProblem), \ S3_ERROR(AllAccessDisabled), \ S3_ERROR(AmbiguousGrantByEmailAddress), \ S3_ERROR(AuthenticationRequired), \ S3_ERROR(BadDigest), \ S3_ERROR(BucketAlreadyExists), \ S3_ERROR(BucketAlreadyOwnedByYou), \ S3_ERROR(BucketNotEmpty), \ S3_ERROR(Conflict), \ S3_ERROR(Created), \ S3_ERROR(CredentialsNotSupported), \ S3_ERROR(CrossLocationLoggingProhibited), \ S3_ERROR(EntityTooSmall), \ S3_ERROR(EntityTooLarge), \ S3_ERROR(ExpiredToken), \ S3_ERROR(Forbidden), \ S3_ERROR(IllegalVersioningConfigurationException), \ S3_ERROR(IncompleteBody), \ S3_ERROR(IncorrectNumberOfFilesInPostRequest), \ S3_ERROR(InlineDataTooLarge), \ S3_ERROR(InternalError), \ S3_ERROR(InvalidAccessKeyId), \ S3_ERROR(InvalidAddressingHeader), \ S3_ERROR(InvalidArgument), \ S3_ERROR(InvalidBucketName), \ S3_ERROR(InvalidBucketState), \ S3_ERROR(InvalidDigest), \ S3_ERROR(InvalidLocationConstraint), \ S3_ERROR(InvalidPart), \ S3_ERROR(InvalidPartOrder), \ S3_ERROR(InvalidPayer), \ S3_ERROR(InvalidPolicyDocument), \ S3_ERROR(InvalidObjectState), \ S3_ERROR(InvalidRange), \ S3_ERROR(InvalidRequest), \ S3_ERROR(InvalidSecurity), \ S3_ERROR(InvalidSOAPRequest), \ S3_ERROR(InvalidStorageClass), \ S3_ERROR(InvalidTargetBucketForLogging), \ S3_ERROR(InvalidToken), \ S3_ERROR(InvalidURI), \ S3_ERROR(KeyTooLong), \ S3_ERROR(MalformedACLError), \ S3_ERROR(MalformedPOSTRequest), \ S3_ERROR(MalformedXML), \ S3_ERROR(MaxMessageLengthExceeded), \ S3_ERROR(MaxPostPreDataLengthExceededError), \ S3_ERROR(MetadataTooLarge), \ S3_ERROR(MethodNotAllowed), \ S3_ERROR(MissingAttachment), \ S3_ERROR(MissingContentLength), \ S3_ERROR(MissingRequestBodyError), \ S3_ERROR(MissingSecurityElement), \ S3_ERROR(MissingSecurityHeader), \ S3_ERROR(NoLoggingStatusForKey), \ S3_ERROR(NoSuchBucket), \ S3_ERROR(NoSuchEntity), \ S3_ERROR(NoSuchKey), \ S3_ERROR(NoSuchLifecycleConfiguration), \ S3_ERROR(NoSuchUpload), \ S3_ERROR(NoSuchVersion), \ S3_ERROR(NotImplemented), \ S3_ERROR(NotSignedUp), \ S3_ERROR(NotSuchBucketPolicy), \ S3_ERROR(OperationAborted), \ S3_ERROR(PermanentRedirect), \ S3_ERROR(PreconditionFailed), \ S3_ERROR(Redirect), \ S3_ERROR(RestoreAlreadyInProgress), \ S3_ERROR(RequestIsNotMultiPartContent), \ S3_ERROR(RequestTimeout), \ S3_ERROR(RequestTimeTooSkewed), \ S3_ERROR(RequestTorrentOfBucketError), \ S3_ERROR(SignatureDoesNotMatch), \ S3_ERROR(ServiceUnavailable), \ S3_ERROR(SlowDown), \ S3_ERROR(TemporaryRedirect), \ S3_ERROR(TokenRefreshRequired), \ S3_ERROR(TooManyBuckets), \ S3_ERROR(Unauthorized), \ S3_ERROR(UnexpectedContent), \ S3_ERROR(Unknown), \ S3_ERROR(UnresolvableGrantByEmailAddress), \ S3_ERROR(UserKeyMustBeSpecified), \ S3_ERROR(END) typedef enum { #define S3_ERROR(NAME) S3_ERROR_ ## NAME S3_ERROR_LIST #undef S3_ERROR } s3_error_code_t; /* * Functions */ /* Does this install of curl support SSL? * * @returns: boolean */ gboolean s3_curl_supports_ssl(void); /* Checks if the version of libcurl being used supports and checks * wildcard certificates correctly (used for the subdomains required * by location constraints). * * @returns: true if the version of libcurl is new enough */ gboolean s3_curl_location_compat(void); /* Checks if a bucket name is compatible with setting a location * constraint. * * @note This doesn't guarantee that bucket name is entirely valid, * just that using it as one (or more) subdomain(s) of s3.amazonaws.com * won't fail; that would prevent the reporting of useful messages from * the service. * * @param bucket: the bucket name * @returns: true if the bucket name is compatible */ gboolean s3_bucket_location_compat(const char *bucket); /* Initialize S3 operation * * If an error occurs in this function, diagnostic information is * printed to stderr. * * @returns: false if an error occurred */ gboolean s3_init(void); /* Set up an S3Handle. * * The concept of a bucket is defined by the Amazon S3 API. * See: "Components of Amazon S3" - API Version 2006-03-01 pg. 8 * * @param access_key: the secret key for Amazon Web Services * @param secret_key: the secret key for Amazon Web Services * @param user_token: the user token for Amazon DevPay * @param bucket_location: the location constraint for buckets * @param storage_class: the storage class for new objects * @param ca_info: the path to pass to libcurl as the certificate authority. * see curl_easy_setopt() CURLOPT_CAINFO for more * @returns: the new S3Handle */ S3Handle * s3_open(const char * access_key, const char *secret_key, const char *swift_account_id, const char *swift_access_key, const char *host, const char *service_path, gboolean use_subdomain, const char * user_token, const char * bucket_location, const char * storage_class, const char * ca_info, const char * server_side_encryption, const char *proxy, const S3_api s3_api, const char *username, const char *password, const char *tenant_id, const char *tenant_name, const char *client_id, const char *client_secret, const char *refresh_token, const gboolean reuse_connection, const long timeout, const char *reps, const char *reps_bucket); /* latest step of setting up the S3Handle. * * Must be done after all properties are set. * * @param hdl: the S3Handle to set up. * @returns: false if an error occured */ gboolean s3_open2(S3Handle *hdl); /* Deallocate an S3Handle * * @param hdl: the S3Handle object */ void s3_free(S3Handle *hdl); /* Reset the information about the last request, including * freeing any allocated memory. The S3Handle itself is not * freed and may be used again. This function is called * automatically as needed, and should be called to free memory * when the handle will not be used for some time. * * @param hdl: the S3Handle object */ void s3_reset(S3Handle *hdl); /* Get the error information for the last operation * * All results are returned via result parameters. If any parameter is * NULL, that result will not be returned. Caller is not responsible for * freeing any returned strings, although the results are only valid until * the next call to an S3 function with this handle. * * @param hdl: the S3Handle object * @param message: (result) the error message, or NULL if none exists * @param response_code: (result) the HTTP response code (or 0 if none exists) * @param s3_error_code: (result) the S3 error code (see constants, above) * @param s3_error_name: (result) the S3 error name (e.g., "RequestTimeout"), * or NULL if none exists * @param curl_code: (result) the curl error code (or 0 if none exists) * @param num_retries: (result) number of retries */ void s3_error(S3Handle *hdl, const char **message, guint *response_code, s3_error_code_t *s3_error_code, const char **s3_error_name, CURLcode *curl_code, guint *num_retries); /* Control verbose output of HTTP transactions, etc. * * @param hdl: the S3Handle object * @param verbose: if true, send HTTP transactions, etc. to debug output */ void s3_verbose(S3Handle *hdl, gboolean verbose); /* Control the use of SSL with HTTP transactions. * * @param hdl: the S3Handle object * @param use_ssl: if true, use SSL (if curl supports it) * @returns: true if the setting is valid */ gboolean s3_use_ssl(S3Handle *hdl, gboolean use_ssl); /* Control the throttling of S3 uploads. Only supported with curl >= 7.15.5. * * @param hdl: the S3Handle object * @param max_send_speed: max speed (bytes/sec) at which to send * @returns: true if the setting is valid */ gboolean s3_set_max_send_speed(S3Handle *hdl, guint64 max_send_speed); /* Control the throttling of S3 downloads. Only supported with curl >= 7.15.5. * * @param hdl: the S3Handle object * @param max_recv_speed: max speed (bytes/sec) at which to receive * @returns: true if the setting is valid */ gboolean s3_set_max_recv_speed(S3Handle *hdl, guint64 max_recv_speed); /* Get the error information from the last operation on this handle, * formatted as a string. * * Caller is responsible for freeing the resulting string. * * @param hdl: the S3Handle object * @returns: string, or NULL if no error occurred */ char * s3_strerror(S3Handle *hdl); /* Perform an upload. * * When this function returns, KEY and BUFFER remain the * responsibility of the caller. * * @param hdl: the S3Handle object * @param bucket: the bucket to which the upload should be made * @param key: the key to which the upload should be made * @param read_func: the callback for reading data * @param reset_func: the callback for to reset reading data * @param size_func: the callback to get the number of bytes to upload * @param md5_func: the callback to get the MD5 hash of the data to upload * @param read_data: pointer to pass to the above functions * @param progress_func: the callback for progress information * @param progress_data: pointer to pass to C{progress_func} * * @returns: false if an error ocurred */ gboolean s3_upload(S3Handle *hdl, const char *bucket, const char *key, s3_read_func read_func, s3_reset_func reset_func, s3_size_func size_func, s3_md5_func md5_func, gpointer read_data, s3_progress_func progress_func, gpointer progress_data); /* List all of the files matching the pseudo-glob C{PREFIX*DELIMITER*}, * returning only that portion which matches C{PREFIX*DELIMITER}. S3 supports * this particular semantics, making it quite efficient. The returned list * should be freed by the caller. * * @param hdl: the S3Handle object * @param bucket: the bucket to list * @param prefix: the prefix * @param delimiter: delimiter (any length string) * @param list: (output) the list of files * @param total_size: (output) sum of size of files * @returns: FALSE if an error occurs */ gboolean s3_list_keys(S3Handle *hdl, const char *bucket, const char *prefix, const char *delimiter, GSList **list, guint64 *total_size); /* Read an entire file, passing the contents to write_func buffer * by buffer. * * @param hdl: the S3Handle object * @param bucket: the bucket to read from * @param key: the key to read from * @param write_func: the callback for writing data * @param reset_func: the callback for to reset writing data * @param write_data: pointer to pass to C{write_func} * @param progress_func: the callback for progress information * @param progress_data: pointer to pass to C{progress_func} * @returns: FALSE if an error occurs */ gboolean s3_read(S3Handle *hdl, const char *bucket, const char *key, s3_write_func write_func, s3_reset_func reset_func, gpointer write_data, s3_progress_func progress_func, gpointer progress_data); /* Delete a file. * * @param hdl: the S3Handle object * @param bucket: the bucket to delete from * @param key: the key to delete * @returns: FALSE if an error occurs; a non-existent file is I{not} considered an error. */ gboolean s3_delete(S3Handle *hdl, const char *bucket, const char *key); /* Delete multiple file. * * @param hdl: the S3Handle object * @param bucket: the bucket to delete from * @param key: the key array to delete * @returns: 0 on sucess, 1 if multi_delete is not supported, 2 if an error * occurs; a non-existent file is I{not} considered an error. */ int s3_multi_delete(S3Handle *hdl, const char *bucket, const char **key); /* Create a bucket. * * @param hdl: the S3Handle object * @param bucket: the bucket to create * @returns: FALSE if an error occurs */ gboolean s3_make_bucket(S3Handle *hdl, const char *bucket, const char *project_id); /* Check if a bucket exists. * * @param hdl: the S3Handle object * @param bucket: the bucket to create * @returns: FALSE if an error occur */ gboolean s3_is_bucket_exists(S3Handle *hdl, const char *bucket, const char *project_id); /* Delete a bucket * * @note A bucket can not be deleted if it still contains keys * * @param hdl: the S3Handle object * @param bucket: the bucket to delete * @returns: FALSE if an error occurs */ gboolean s3_delete_bucket(S3Handle *hdl, const char *bucket); /* Attempt a RefreshAWSSecurityToken on a token; if it succeeds, the old * token will be freed and replaced by the new. If it fails, the old * token is left unchanged and FALSE is returned. */ gboolean sts_refresh_token(char ** token, const char * directory); /* These functions are for if you want to use curl on your own. You get more * control, but it's a lot of work that way: */ typedef struct { char *buffer; guint buffer_len; guint buffer_pos; guint max_buffer_size; } CurlBuffer; #define S3_BUFFER_READ_FUNCS s3_buffer_read_func, s3_buffer_reset_func, s3_buffer_size_func, s3_buffer_md5_func #define S3_BUFFER_WRITE_FUNCS s3_buffer_write_func, s3_buffer_reset_func /* a CURLOPT_READFUNCTION to read data from a buffer. */ size_t s3_buffer_read_func(void *ptr, size_t size, size_t nmemb, void * stream); size_t s3_buffer_size_func(void *stream); GByteArray* s3_buffer_md5_func(void *stream); void s3_buffer_reset_func(void *stream); #define S3_EMPTY_READ_FUNCS s3_empty_read_func, NULL, s3_empty_size_func, s3_empty_md5_func /* a CURLOPT_WRITEFUNCTION to write data to a buffer. */ size_t s3_buffer_write_func(void *ptr, size_t size, size_t nmemb, void *stream); /* a CURLOPT_READFUNCTION that writes nothing. */ size_t s3_empty_read_func(void *ptr, size_t size, size_t nmemb, void * stream); size_t s3_empty_size_func(void *stream); GByteArray* s3_empty_md5_func(void *stream); #define S3_COUNTER_WRITE_FUNCS s3_counter_write_func, s3_counter_reset_func /* a CURLOPT_WRITEFUNCTION to write data that just counts data. * s3_write_data should be NULL or a pointer to an gint64. */ size_t s3_counter_write_func(void *ptr, size_t size, size_t nmemb, void *stream); void s3_counter_reset_func(void *stream); #ifdef _WIN32 /* a CURLOPT_READFUNCTION to read data from a file. */ size_t s3_file_read_func(void *ptr, size_t size, size_t nmemb, void * stream); size_t s3_file_size_func(void *stream); GByteArray* s3_file_md5_func(void *stream); size_t s3_file_reset_func(void *stream); /* a CURLOPT_WRITEFUNCTION to write data to a file. */ size_t s3_file_write_func(void *ptr, size_t size, size_t nmemb, void *stream); #endif /* Adds a null termination to a buffer. */ void terminate_buffer(CurlBuffer *); #endif amanda-3.3.6/device-src/xfer-dest-taper-directtcp.c0000664000076400007640000003546712357250004023636 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 2009-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "amxfer.h" #include "xfer-device.h" #include "arglist.h" #include "conffile.h" /* A transfer destination that writes and entire dumpfile to one or more files * on one or more devices via DirectTCP, handling the work of spanning a * directtcp connection over multiple devices. Note that this assumes the * devices support early EOM warning. */ /* * Xfer Dest Taper DirectTCP */ static GType xfer_dest_taper_directtcp_get_type(void); #define XFER_DEST_TAPER_DIRECTTCP_TYPE (xfer_dest_taper_directtcp_get_type()) #define XFER_DEST_TAPER_DIRECTTCP(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_directtcp_get_type(), XferDestTaperDirectTCP) #define XFER_DEST_TAPER_DIRECTTCP_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_directtcp_get_type(), XferDestTaperDirectTCP const) #define XFER_DEST_TAPER_DIRECTTCP_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_directtcp_get_type(), XferDestTaperDirectTCPClass) #define IS_XFER_DEST_TAPER_DIRECTTCP(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_directtcp_get_type ()) #define XFER_DEST_TAPER_DIRECTTCP_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_directtcp_get_type(), XferDestTaperDirectTCPClass) static GObjectClass *parent_class = NULL; typedef struct XferDestTaperDirectTCP { XferDestTaper __parent__; /* constructor parameters */ guint64 part_size; /* (bytes) */ /* thread */ GThread *worker_thread; /* state (governs everything below) */ GMutex *state_mutex; /* part parameters */ Device *volatile device; /* device to write to (refcounted) */ dumpfile_t *volatile part_header; /* did the device listen proceed without error? */ gboolean listen_ok; /* part number in progress */ volatile guint64 partnum; /* connection we're writing to (refcounted) */ DirectTCPConnection *conn; /* is the element paused, waiting to start a new part? this is set to FALSE * by the main thread to start a part, and the worker thread waits on the * corresponding condition variable. */ volatile gboolean paused; GCond *paused_cond; GCond *abort_cond; /* condition to trigger to abort an NDMP command */ } XferDestTaperDirectTCP; typedef struct { XferDestTaperClass __parent__; } XferDestTaperDirectTCPClass; /* * Debug logging */ #define DBG(LEVEL, ...) if (debug_taper >= LEVEL) { _xdt_dbg(__VA_ARGS__); } static void _xdt_dbg(const char *fmt, ...) { va_list argp; char msg[1024]; arglist_start(argp, fmt); g_vsnprintf(msg, sizeof(msg), fmt, argp); arglist_end(argp); g_debug("XDT: %s", msg); } /* * Worker Thread */ static gpointer worker_thread( gpointer data) { XferElement *elt = (XferElement *)data; XferDestTaperDirectTCP *self = (XferDestTaperDirectTCP *)data; GTimer *timer = g_timer_new(); int result; /* This thread's job is to accept() an incoming connection, then call * write_from_connection for each part, and then close the connection */ /* If the device_listen failed, then we will soon be cancelled, so wait * for that to occur and then send XMSG_DONE */ if (!self->listen_ok) { DBG(2, "listen failed; waiting for cancellation without attempting an accept"); wait_until_xfer_cancelled(elt->xfer); goto send_xmsg_done; } g_mutex_lock(self->state_mutex); /* first, accept a new connection from the device */ DBG(2, "accepting DirectTCP connection on device %s", self->device->device_name); result = device_accept(self->device, &self->conn, &elt->cancelled, self->state_mutex, self->abort_cond); if (result == 1 && !elt->cancelled) { xfer_cancel_with_error(XFER_ELEMENT(self), "accepting DirectTCP connection: %s", device_error_or_status(self->device)); g_mutex_unlock(self->state_mutex); wait_until_xfer_cancelled(elt->xfer); goto send_xmsg_done; } else if (result == 2 || elt->cancelled) { g_mutex_unlock(self->state_mutex); wait_until_xfer_cancelled(elt->xfer); goto send_xmsg_done; } DBG(2, "connection accepted; sending XMSG_READY"); xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0)); /* round the part size up to the next multiple of the block size */ if (self->part_size) { self->part_size += self->device->block_size-1; self->part_size -= self->part_size % self->device->block_size; } /* now loop until we're out of parts */ while (1) { guint64 size; int fileno; XMsg *msg = NULL; gboolean eom, eof; /* wait to be un-paused */ while (!elt->cancelled && self->paused) { DBG(9, "waiting to be un-paused"); g_cond_wait(self->paused_cond, self->state_mutex); } DBG(9, "done waiting"); if (elt->cancelled) break; DBG(2, "writing part to %s", self->device->device_name); if (!device_start_file(self->device, self->part_header) || self->device->is_eom) { /* this is not fatal to the transfer, since no data was lost. We * just need a new device. The scribe special-cases 0-byte parts, and will * not record this in the catalog. */ /* clean up */ dumpfile_free(self->part_header); self->part_header = NULL; goto empty_part; } dumpfile_free(self->part_header); self->part_header = NULL; fileno = self->device->file; g_assert(fileno > 0); /* write the part */ g_timer_start(timer); result = device_write_from_connection(self->device, self->part_size, &size, &elt->cancelled, self->state_mutex, self->abort_cond); if (result == 1 && !elt->cancelled) { /* even if this is just a physical EOM, we may have lost data, so * the whole transfer is dead. */ xfer_cancel_with_error(XFER_ELEMENT(self), "Error writing from DirectTCP connection: %s", device_error_or_status(self->device)); device_finish_file(self->device); goto cancelled; } else if (result == 2 || elt->cancelled) { device_finish_file(self->device); goto cancelled; } g_timer_stop(timer); eom = self->device->is_eom; eof = self->device->is_eof; /* finish the file, even if we're at EOM, but if this fails then we may * have lost data */ if (!device_finish_file(self->device)) { xfer_cancel_with_error(XFER_ELEMENT(self), "Error finishing tape file: %s", device_error_or_status(self->device)); goto cancelled; } /* if we wrote zero bytes and reached EOM, then this is an empty part */ if (eom && !eof && size == 0) { goto empty_part; } msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = size; msg->duration = g_timer_elapsed(timer, NULL); msg->partnum = self->partnum; msg->fileno = fileno; msg->successful = TRUE; msg->eom = eom; msg->eof = eof; /* time runs backward on some test boxes, so make sure this is positive */ if (msg->duration < 0) msg->duration = 0; xfer_queue_message(elt->xfer, msg); self->partnum++; /* we're done at EOF */ if (eof) break; /* wait to be unpaused again */ self->paused = TRUE; continue; empty_part: msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0); msg->size = 0; msg->duration = 0; msg->partnum = 0; msg->fileno = 0; msg->successful = TRUE; msg->eom = TRUE; msg->eof = FALSE; xfer_queue_message(elt->xfer, msg); /* wait to be unpaused again */ self->paused = TRUE; continue; cancelled: /* drop the mutex and wait until all elements have been cancelled * before closing the connection */ g_mutex_unlock(self->state_mutex); wait_until_xfer_cancelled(elt->xfer); g_mutex_lock(self->state_mutex); break; } /* close the DirectTCP connection */ directtcp_connection_close(self->conn); g_object_unref(self->conn); self->conn = NULL; g_mutex_unlock(self->state_mutex); g_timer_destroy(timer); send_xmsg_done: xfer_queue_message(elt->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0)); return NULL; } /* * Element mechanics */ static gboolean setup_impl( XferElement *elt) { XferDestTaperDirectTCP *self = (XferDestTaperDirectTCP *)elt; /* start the device listening, and get the addresses */ if (!device_listen(self->device, TRUE, &elt->input_listen_addrs)) { elt->input_listen_addrs = NULL; xfer_cancel_with_error(XFER_ELEMENT(self), "Error starting DirectTCP listen: %s", device_error_or_status(self->device)); self->listen_ok = FALSE; return FALSE; } self->listen_ok = TRUE; return TRUE; } static gboolean start_impl( XferElement *elt) { XferDestTaperDirectTCP *self = (XferDestTaperDirectTCP *)elt; GError *error = NULL; self->paused = TRUE; /* start up the thread */ self->worker_thread = g_thread_create(worker_thread, (gpointer)self, TRUE, &error); if (!self->worker_thread) { g_critical(_("Error creating new thread: %s (%s)"), error->message, errno? strerror(errno) : _("no error code")); } return TRUE; } static gboolean cancel_impl( XferElement *elt, gboolean expect_eof) { XferDestTaperDirectTCP *self = XFER_DEST_TAPER_DIRECTTCP(elt); gboolean rv; /* chain up first */ rv = XFER_ELEMENT_CLASS(parent_class)->cancel(elt, expect_eof); /* signal all of the condition variables to realize that we're no * longer paused */ g_mutex_lock(self->state_mutex); g_cond_broadcast(self->paused_cond); g_cond_broadcast(self->abort_cond); g_mutex_unlock(self->state_mutex); return rv; } static void start_part_impl( XferDestTaper *xdtself, gboolean retry_part, dumpfile_t *header) { XferDestTaperDirectTCP *self = XFER_DEST_TAPER_DIRECTTCP(xdtself); /* the only way self->device can become NULL is if use_device fails, in * which case an error is already queued up, so just return silently */ if (self->device == NULL) return; g_assert(!self->device->in_file); g_assert(header != NULL); DBG(1, "start_part(retry_part=%d)", retry_part); g_mutex_lock(self->state_mutex); g_assert(self->paused); if (self->part_header) dumpfile_free(self->part_header); self->part_header = dumpfile_copy(header); DBG(1, "unpausing"); self->paused = FALSE; g_cond_broadcast(self->paused_cond); g_mutex_unlock(self->state_mutex); } static void use_device_impl( XferDestTaper *xdtself, Device *device) { XferDestTaperDirectTCP *self = XFER_DEST_TAPER_DIRECTTCP(xdtself); /* short-circuit if nothing is changing */ if (self->device == device) return; g_mutex_lock(self->state_mutex); if (self->device) g_object_unref(self->device); self->device = NULL; /* if we already have a connection, then make this device use it */ if (self->conn) { if (!device_use_connection(device, self->conn)) { /* queue up an error for later, and leave the device NULL. * start_part will see this and fail silently */ xfer_cancel_with_error(XFER_ELEMENT(self), _("Failed part was not cached; cannot retry")); return; } } self->device = device; g_object_ref(device); g_mutex_unlock(self->state_mutex); } static guint64 get_part_bytes_written_impl( XferDestTaper *xdtself G_GNUC_UNUSED) { /* This operation is not supported for this taper dest. Maybe someday. */ return 0; } static void instance_init( XferElement *elt) { XferDestTaperDirectTCP *self = XFER_DEST_TAPER_DIRECTTCP(elt); elt->can_generate_eof = FALSE; self->worker_thread = NULL; self->paused = TRUE; self->conn = NULL; self->state_mutex = g_mutex_new(); self->paused_cond = g_cond_new(); self->abort_cond = g_cond_new(); } static void finalize_impl( GObject * obj_self) { XferDestTaperDirectTCP *self = XFER_DEST_TAPER_DIRECTTCP(obj_self); if (self->conn) g_object_unref(self->conn); self->conn = NULL; if (self->device) g_object_unref(self->device); self->device = NULL; if (self->device) g_object_unref(self->device); self->device = NULL; g_mutex_free(self->state_mutex); g_cond_free(self->paused_cond); g_cond_free(self->abort_cond); if (self->part_header) dumpfile_free(self->part_header); self->part_header = NULL; /* chain up */ G_OBJECT_CLASS(parent_class)->finalize(obj_self); } static void class_init( XferDestTaperDirectTCPClass * selfc) { XferElementClass *klass = XFER_ELEMENT_CLASS(selfc); XferDestTaperClass *xdt_klass = XFER_DEST_TAPER_CLASS(selfc); GObjectClass *goc = G_OBJECT_CLASS(selfc); static xfer_element_mech_pair_t mech_pairs[] = { { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, 0, 0}, { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0}, }; klass->start = start_impl; klass->setup = setup_impl; klass->cancel = cancel_impl; xdt_klass->start_part = start_part_impl; xdt_klass->use_device = use_device_impl; xdt_klass->get_part_bytes_written = get_part_bytes_written_impl; goc->finalize = finalize_impl; klass->perl_class = "Amanda::Xfer::Dest::Taper::DirectTCP"; klass->mech_pairs = mech_pairs; parent_class = g_type_class_peek_parent(selfc); } static GType xfer_dest_taper_directtcp_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (XferDestTaperDirectTCPClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (XferDestTaperDirectTCP), 0 /* n_preallocs */, (GInstanceInitFunc) instance_init, NULL }; type = g_type_register_static (XFER_DEST_TAPER_TYPE, "XferDestTaperDirectTCP", &info, 0); } return type; } /* * Constructor */ XferElement * xfer_dest_taper_directtcp(Device *first_device, guint64 part_size) { XferDestTaperDirectTCP *self = (XferDestTaperDirectTCP *)g_object_new(XFER_DEST_TAPER_DIRECTTCP_TYPE, NULL); g_assert(device_directtcp_supported(first_device)); self->part_size = part_size; self->device = first_device; self->partnum = 1; g_object_ref(self->device); return XFER_ELEMENT(self); } amanda-3.3.6/device-src/rait-device.c0000664000076400007640000023744112357250004021035 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ /* The RAIT device encapsulates some number of other devices into a single * redundant device. */ #include "amanda.h" #include "property.h" #include "util.h" #include #include "glib-util.h" #include "device.h" #include "fileheader.h" #include "amsemaphore.h" /* Just a note about the failure mode of different operations: - Recovers from a failure (enters degraded mode) open_device() seek_file() -- explodes if headers don't match. seek_block() -- explodes if headers don't match. read_block() -- explodes if data doesn't match. - Operates in degraded mode (but dies if a new problem shows up) read_label() -- but dies on label mismatch. start() -- but dies when writing in degraded mode. property functions finish() - Dies in degraded mode (even if remaining devices are OK) start_file() write_block() finish_file() recycle_file() */ /* * Type checking and casting macros */ #define TYPE_RAIT_DEVICE (rait_device_get_type()) #define RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice) #define RAIT_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice const) #define RAIT_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), rait_device_get_type(), RaitDeviceClass) #define IS_RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), rait_device_get_type ()) #define RAIT_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), rait_device_get_type(), RaitDeviceClass) static GType rait_device_get_type (void); /* * Main object structure */ typedef struct RaitDevice_s { Device __parent__; struct RaitDevicePrivate_s * private; } RaitDevice; /* * Class definition */ typedef struct _RaitDeviceClass RaitDeviceClass; struct _RaitDeviceClass { DeviceClass __parent__; }; typedef enum { RAIT_STATUS_COMPLETE, /* All subdevices OK. */ RAIT_STATUS_DEGRADED, /* One subdevice failed. */ RAIT_STATUS_FAILED /* Two or more subdevices failed. */ } RaitStatus; /* Older versions of glib have a deadlock in their thread pool implementations, * so we include a simple thread-pool implementation here to replace it. * * This implementation assumes that threads are used for paralellizing a single * operation, so all threads run a function to completion before the main thread * continues. This simplifies some of the locking semantics, and in particular * there is no need to wait for stray threads to finish an operation when * finalizing the RaitDevice object or when beginning a new operation. */ #if !(GLIB_CHECK_VERSION(2,10,0)) #define USE_INTERNAL_THREADPOOL #endif typedef struct RaitDevicePrivate_s { GPtrArray * children; /* These flags are only relevant for reading. */ RaitStatus status; /* If status == RAIT_STATUS_DEGRADED, this holds the index of the failed node. It holds a negative number otherwise. */ int failed; /* the child block size */ gsize child_block_size; #ifdef USE_INTERNAL_THREADPOOL /* array of ThreadInfo for performing parallel operations */ GArray *threads; /* value of this semaphore is the number of threaded operations * in progress */ amsemaphore_t *threads_sem; #endif } RaitDevicePrivate; #ifdef USE_INTERNAL_THREADPOOL typedef struct ThreadInfo { GThread *thread; /* struct fields below are protected by this mutex and condition variable */ GMutex *mutex; GCond *cond; gboolean die; GFunc func; gpointer data; /* give threads access to active_threads and its mutex/cond */ struct RaitDevicePrivate_s *private; } ThreadInfo; #endif /* This device uses a special sentinel node to indicate that the child devices * will be set later (in rait_device_open). It contains a control character to * make it difficult to enter accidentally in an Amanda config. */ #define DEFER_CHILDREN_SENTINEL "DEFER\1" #define PRIVATE(o) (o->private) #define rait_device_in_error(dev) \ (device_in_error((dev)) || PRIVATE(RAIT_DEVICE((dev)))->status == RAIT_STATUS_FAILED) void rait_device_register (void); /* here are local prototypes */ static void rait_device_init (RaitDevice * o); static void rait_device_class_init (RaitDeviceClass * c); static void rait_device_base_init (RaitDeviceClass * c); static void rait_device_open_device (Device * self, char * device_name, char * device_type, char * device_node); static gboolean rait_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); static gboolean rait_device_configure(Device * self, gboolean use_global_config); static gboolean rait_device_start_file(Device * self, dumpfile_t * info); static gboolean rait_device_write_block (Device * self, guint size, gpointer data); static gboolean rait_device_finish_file (Device * self); static dumpfile_t * rait_device_seek_file (Device * self, guint file); static gboolean rait_device_seek_block (Device * self, guint64 block); static int rait_device_read_block (Device * self, gpointer buf, int * size); static gboolean rait_device_recycle_file (Device * self, guint filenum); static gboolean rait_device_finish (Device * self); static DeviceStatusFlags rait_device_read_label(Device * dself); static void find_simple_params(RaitDevice * self, guint * num_children, guint * data_children); /* property handlers */ static gboolean property_get_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_set_block_size_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean property_get_canonical_name_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_concurrency_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_streaming_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_boolean_and_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_medium_access_type_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_get_max_volume_usage_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean property_set_max_volume_usage_fn(Device *self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; static GType rait_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (RaitDeviceClass), (GBaseInitFunc) rait_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rait_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (RaitDevice), 0 /* n_preallocs */, (GInstanceInitFunc) rait_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "RaitDevice", &info, (GTypeFlags)0); } return type; } static void g_object_unref_foreach(gpointer data, gpointer user_data G_GNUC_UNUSED) { if (data != NULL && G_IS_OBJECT(data)) { g_object_unref(data); } } static void rait_device_finalize(GObject *obj_self) { RaitDevice *self = RAIT_DEVICE (obj_self); if(G_OBJECT_CLASS(parent_class)->finalize) \ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); if(self->private->children) { g_ptr_array_foreach(self->private->children, g_object_unref_foreach, NULL); g_ptr_array_free (self->private->children, TRUE); self->private->children = NULL; } #ifdef USE_INTERNAL_THREADPOOL g_assert(PRIVATE(self)->threads_sem == NULL || PRIVATE(self)->threads_sem->value == 0); if (PRIVATE(self)->threads) { guint i; for (i = 0; i < PRIVATE(self)->threads->len; i++) { ThreadInfo *inf = &g_array_index(PRIVATE(self)->threads, ThreadInfo, i); if (inf->thread) { /* NOTE: the thread is waiting on this condition right now, not * executing an operation. */ /* ask the thread to die */ g_mutex_lock(inf->mutex); inf->die = TRUE; g_cond_signal(inf->cond); g_mutex_unlock(inf->mutex); /* and wait for it to die, which should happen soon */ g_thread_join(inf->thread); } if (inf->mutex) g_mutex_free(inf->mutex); if (inf->cond) g_cond_free(inf->cond); } } if (PRIVATE(self)->threads_sem) amsemaphore_free(PRIVATE(self)->threads_sem); #endif amfree(self->private); } static void rait_device_init (RaitDevice * o G_GNUC_UNUSED) { PRIVATE(o) = g_new(RaitDevicePrivate, 1); PRIVATE(o)->children = g_ptr_array_new(); PRIVATE(o)->status = RAIT_STATUS_COMPLETE; PRIVATE(o)->failed = -1; #ifdef USE_INTERNAL_THREADPOOL PRIVATE(o)->threads = NULL; PRIVATE(o)->threads_sem = NULL; #endif } static void rait_device_class_init (RaitDeviceClass * c) { GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->open_device = rait_device_open_device; device_class->configure = rait_device_configure; device_class->start = rait_device_start; device_class->start_file = rait_device_start_file; device_class->write_block = rait_device_write_block; device_class->finish_file = rait_device_finish_file; device_class->seek_file = rait_device_seek_file; device_class->seek_block = rait_device_seek_block; device_class->read_block = rait_device_read_block; device_class->recycle_file = rait_device_recycle_file; device_class->finish = rait_device_finish; device_class->read_label = rait_device_read_label; g_object_class->finalize = rait_device_finalize; #ifndef USE_INTERNAL_THREADPOOL #if !GLIB_CHECK_VERSION(2,10,2) /* Versions of glib before 2.10.2 crash if * g_thread_pool_set_max_unused_threads is called before the first * invocation of g_thread_pool_new. So we make up a thread pool, but don't * start any threads in it, and free it */ { GThreadPool *pool = g_thread_pool_new((GFunc)-1, NULL, -1, FALSE, NULL); g_thread_pool_free(pool, TRUE, FALSE); } #endif g_thread_pool_set_max_unused_threads(-1); #endif } static void rait_device_base_init (RaitDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; /* the RAIT device overrides most of the standard properties, so that it * can calculate them by querying the same property on the children */ device_class_register_property(device_class, PROPERTY_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, property_get_block_size_fn, property_set_block_size_fn); device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, PROPERTY_ACCESS_GET_MASK, property_get_canonical_name_fn, NULL); device_class_register_property(device_class, PROPERTY_CONCURRENCY, PROPERTY_ACCESS_GET_MASK, property_get_concurrency_fn, NULL); device_class_register_property(device_class, PROPERTY_STREAMING, PROPERTY_ACCESS_GET_MASK, property_get_streaming_fn, NULL); device_class_register_property(device_class, PROPERTY_APPENDABLE, PROPERTY_ACCESS_GET_MASK, property_get_boolean_and_fn, NULL); device_class_register_property(device_class, PROPERTY_PARTIAL_DELETION, PROPERTY_ACCESS_GET_MASK, property_get_boolean_and_fn, NULL); device_class_register_property(device_class, PROPERTY_FULL_DELETION, PROPERTY_ACCESS_GET_MASK, property_get_boolean_and_fn, NULL); device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK, property_get_boolean_and_fn, NULL); device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE, PROPERTY_ACCESS_GET_MASK, property_get_medium_access_type_fn, NULL); device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, property_get_max_volume_usage_fn, property_set_max_volume_usage_fn); } /* This function does something a little clever and a little * complicated. It takes an array of operations and runs the given * function on each element in the array. The trick is that it runs them * all in parallel, in different threads. This is more efficient than it * sounds because we use a GThreadPool, which means calling this function * will probably not start any new threads at all, but rather use * existing ones. The func is called with two gpointer arguments: The * first from the array, the second is the data argument. * * When it returns, all the operations have been successfully * executed. If you want results from your operations, do it yourself * through the array. */ #ifdef USE_INTERNAL_THREADPOOL static gpointer rait_thread_pool_func(gpointer data) { ThreadInfo *inf = data; g_mutex_lock(inf->mutex); while (TRUE) { while (!inf->die && !inf->func) g_cond_wait(inf->cond, inf->mutex); if (inf->die) break; if (inf->func) { /* invoke the function */ inf->func(inf->data, NULL); inf->func = NULL; inf->data = NULL; /* indicate that we're finished; will not block */ amsemaphore_down(inf->private->threads_sem); } } g_mutex_unlock(inf->mutex); return NULL; } static void do_thread_pool_op(RaitDevice *self, GFunc func, GPtrArray * ops) { guint i; if (PRIVATE(self)->threads_sem == NULL) PRIVATE(self)->threads_sem = amsemaphore_new_with_value(0); if (PRIVATE(self)->threads == NULL) PRIVATE(self)->threads = g_array_sized_new(FALSE, TRUE, sizeof(ThreadInfo), ops->len); g_assert(PRIVATE(self)->threads_sem->value == 0); if (PRIVATE(self)->threads->len < ops->len) g_array_set_size(PRIVATE(self)->threads, ops->len); /* the semaphore will hit zero when each thread has decremented it */ amsemaphore_force_set(PRIVATE(self)->threads_sem, ops->len); for (i = 0; i < ops->len; i++) { ThreadInfo *inf = &g_array_index(PRIVATE(self)->threads, ThreadInfo, i); if (!inf->thread) { inf->mutex = g_mutex_new(); inf->cond = g_cond_new(); inf->private = PRIVATE(self); inf->thread = g_thread_create(rait_thread_pool_func, inf, TRUE, NULL); } /* set up the info the thread needs and trigger it to start */ g_mutex_lock(inf->mutex); inf->data = g_ptr_array_index(ops, i); inf->func = func; g_cond_signal(inf->cond); g_mutex_unlock(inf->mutex); } /* wait until semaphore hits zero */ amsemaphore_wait_empty(PRIVATE(self)->threads_sem); } #else /* USE_INTERNAL_THREADPOOL */ static void do_thread_pool_op(RaitDevice *self G_GNUC_UNUSED, GFunc func, GPtrArray * ops) { GThreadPool * pool; guint i; pool = g_thread_pool_new(func, NULL, -1, FALSE, NULL); for (i = 0; i < ops->len; i ++) { g_thread_pool_push(pool, g_ptr_array_index(ops, i), NULL); } g_thread_pool_free(pool, FALSE, TRUE); } #endif /* USE_INTERNAL_THREADPOOL */ /* This does the above, in a serial fashion (and without using threads) */ static void do_unthreaded_ops(RaitDevice *self G_GNUC_UNUSED, GFunc func, GPtrArray * ops) { guint i; for (i = 0; i < ops->len; i ++) { func(g_ptr_array_index(ops, i), NULL); } } /* This is the one that code below should call. It switches automatically between do_thread_pool_op and do_unthreaded_ops, depending on g_thread_supported(). */ static void do_rait_child_ops(RaitDevice *self, GFunc func, GPtrArray * ops) { if (g_thread_supported()) { do_thread_pool_op(self, func, ops); } else { do_unthreaded_ops(self, func, ops); } } static char * child_device_names_to_rait_name(RaitDevice * self) { GPtrArray *kids; char *braced, *result; guint i; kids = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { Device *child = g_ptr_array_index(self->private->children, i); const char *child_name = NULL; GValue val; gboolean got_prop = FALSE; bzero(&val, sizeof(val)); if ((signed)i != self->private->failed) { if (device_property_get(child, PROPERTY_CANONICAL_NAME, &val)) { child_name = g_value_get_string(&val); got_prop = TRUE; } } if (!got_prop) child_name = "MISSING"; g_ptr_array_add(kids, g_strdup(child_name)); if (got_prop) g_value_unset(&val); } braced = collapse_braced_alternates(kids); result = g_strdup_printf("rait:%s", braced); g_free(braced); return result; } /* Find a workable child block size, based on the block size ranges of our * child devices. * * The algorithm is to construct the intersection of all child devices' * [min,max] block size ranges, and then pick the block size closest to 32k * that is in the resulting range. This avoids picking ridiculously small (1 * byte) or large (INT_MAX) block sizes when using devices with wide-open block * size ranges. * This function returns the calculated child block size directly, and the RAIT * device's blocksize via rait_size, if not NULL. It is resilient to errors in * a single child device, but sets the device's error status and returns 0 if * it cannot determine an agreeable block size. */ static gsize calculate_block_size_from_children(RaitDevice * self, gsize *rait_size) { gsize min = 0; gsize max = SIZE_MAX; gboolean found_one = FALSE; gsize result; guint i; for (i = 0; i < self->private->children->len; i ++) { gsize child_min = SIZE_MAX, child_max = 0; Device *child; GValue property_result; PropertySource source; bzero(&property_result, sizeof(property_result)); if ((signed)i == self->private->failed) continue; child = g_ptr_array_index(self->private->children, i); if (!device_property_get_ex(child, PROPERTY_BLOCK_SIZE, &property_result, NULL, &source)) { g_warning("Error getting BLOCK_SIZE from %s: %s", child->device_name, device_error_or_status(child)); continue; } /* if the block size has been set explicitly, then we need to use that blocksize; * otherwise (even if it was DETECTED), override it. */ if (source == PROPERTY_SOURCE_USER) { child_min = child_max = g_value_get_int(&property_result); } else { if (!device_property_get(child, PROPERTY_MIN_BLOCK_SIZE, &property_result)) { g_warning("Error getting MIN_BLOCK_SIZE from %s: %s", child->device_name, device_error_or_status(child)); continue; } child_min = g_value_get_uint(&property_result); if (!device_property_get(child, PROPERTY_MAX_BLOCK_SIZE, &property_result)) { g_warning("Error getting MAX_BLOCK_SIZE from %s: %s", child->device_name, device_error_or_status(child)); continue; } child_max = g_value_get_uint(&property_result); if (child_min == 0 || child_max == 0 || (child_min > child_max)) { g_warning("Invalid min, max block sizes from %s", child->device_name); continue; } } found_one = TRUE; min = MAX(min, child_min); max = MIN(max, child_max); } if (!found_one) { device_set_error((Device*)self, stralloc(_("Could not find any child devices' block size ranges")), DEVICE_STATUS_DEVICE_ERROR); return 0; } if (min > max) { device_set_error((Device*)self, stralloc(_("No block size is acceptable to all child devices")), DEVICE_STATUS_DEVICE_ERROR); return 0; } /* Now pick a number. If 32k is in range, we use that; otherwise, we use * the nearest acceptable size. */ result = CLAMP(32768, min, max); if (rait_size) { guint data_children; find_simple_params(self, NULL, &data_children); *rait_size = result * data_children; } return result; } /* Set BLOCK_SIZE on all children */ static gboolean set_block_size_on_children(RaitDevice *self, gsize child_block_size) { GValue val; guint i; PropertySource source; bzero(&val, sizeof(val)); g_assert(child_block_size < INT_MAX); g_value_init(&val, G_TYPE_INT); g_value_set_int(&val, (gint)child_block_size); for (i = 0; i < self->private->children->len; i ++) { Device *child; GValue property_result; bzero(&property_result, sizeof(property_result)); if ((signed)i == self->private->failed) continue; child = g_ptr_array_index(self->private->children, i); /* first, make sure the block size is at its default, or is already * correct */ if (device_property_get_ex(child, PROPERTY_BLOCK_SIZE, &property_result, NULL, &source)) { gsize from_child = g_value_get_int(&property_result); g_value_unset(&property_result); if (source != PROPERTY_SOURCE_DEFAULT && from_child != child_block_size) { device_set_error((Device *)self, vstrallocf(_("Child device %s already has its block size set to %zd, not %zd"), child->device_name, from_child, child_block_size), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else { /* failing to get the block size isn't necessarily fatal.. */ g_warning("Error getting BLOCK_SIZE from %s: %s", child->device_name, device_error_or_status(child)); } if (!device_property_set(child, PROPERTY_BLOCK_SIZE, &val)) { device_set_error((Device *)self, vstrallocf(_("Error setting block size on %s"), child->device_name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } return TRUE; } /* The time for users to specify block sizes has ended; set this device's * block-size attributes for easy access by other RAIT functions. Returns * FALSE on error, with the device's error status already set. */ static gboolean fix_block_size(RaitDevice *self) { Device *dself = (Device *)self; gsize my_block_size, child_block_size; if (dself->block_size_source == PROPERTY_SOURCE_DEFAULT) { child_block_size = calculate_block_size_from_children(self, &my_block_size); if (child_block_size == 0) return FALSE; self->private->child_block_size = child_block_size; dself->block_size = my_block_size; dself->block_size_surety = PROPERTY_SURETY_GOOD; dself->block_size_source = PROPERTY_SOURCE_DETECTED; } else { guint data_children; find_simple_params(self, NULL, &data_children); g_assert((dself->block_size % data_children) == 0); child_block_size = dself->block_size / data_children; } /* now tell the children we mean it */ if (!set_block_size_on_children(self, child_block_size)) return FALSE; return TRUE; } /* This structure contains common fields for many operations. Not all operations use all fields, however. */ typedef struct { gpointer result; /* May be a pointer; may be an integer or boolean stored with GINT_TO_POINTER. */ Device * child; /* The device in question. Used by all operations. */ guint child_index; /* For recoverable operations (read-related operations), this field provides the number of this child in the self->private->children array. */ } GenericOp; typedef gboolean (*BooleanExtractor)(gpointer data); /* A BooleanExtractor */ static gboolean extract_boolean_generic_op(gpointer data) { GenericOp * op = data; return GPOINTER_TO_INT(op->result); } /* A BooleanExtractor */ static gboolean extract_boolean_pointer_op(gpointer data) { GenericOp * op = data; return op->result != NULL; } /* Does the equivalent of this perl command: ! (first { !extractor($_) } @_ That is, calls extractor on each element of the array, and returns TRUE if and only if all calls to extractor return TRUE. This function stops as soon as an extractor returns false, so it's best if extractor functions have no side effects. */ static gboolean g_ptr_array_and(GPtrArray * array, BooleanExtractor extractor) { guint i; if (array == NULL || array->len <= 0) return FALSE; for (i = 0; i < array->len; i ++) { if (!extractor(g_ptr_array_index(array, i))) return FALSE; } return TRUE; } /* Takes a RaitDevice, and makes a GPtrArray of GenericOp. */ static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) { GPtrArray * rval; guint i; rval = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { GenericOp * op; if ((signed)i == self->private->failed) { continue; } op = g_new(GenericOp, 1); op->child = g_ptr_array_index(self->private->children, i); op->child_index = i; g_ptr_array_add(rval, op); } return rval; } /* Takes a GPtrArray of GenericOp, and a BooleanExtractor, and does all the proper handling for the result of operations that allow device isolation. Returns FALSE only if an unrecoverable error occured. */ static gboolean g_ptr_array_union_robust(RaitDevice * self, GPtrArray * ops, BooleanExtractor extractor) { int nfailed = 0; int lastfailed = 0; guint i; /* We found one or more failed elements. See which elements failed, and * isolate them*/ for (i = 0; i < ops->len; i ++) { GenericOp * op = g_ptr_array_index(ops, i); if (!extractor(op)) { self->private->failed = op->child_index; g_warning("RAIT array %s isolated device %s: %s", DEVICE(self)->device_name, op->child->device_name, device_error(op->child)); nfailed++; lastfailed = i; } } /* no failures? great! */ if (nfailed == 0) return TRUE; /* a single failure in COMPLETE just puts us in DEGRADED mode */ if (self->private->status == RAIT_STATUS_COMPLETE && nfailed == 1) { self->private->status = RAIT_STATUS_DEGRADED; self->private->failed = lastfailed; g_warning("RAIT array %s DEGRADED", DEVICE(self)->device_name); return TRUE; } else { self->private->status = RAIT_STATUS_FAILED; g_warning("RAIT array %s FAILED", DEVICE(self)->device_name); return FALSE; } } typedef struct { RaitDevice * self; char *rait_name; char * device_name; /* IN */ Device * result; /* OUT */ } OpenDeviceOp; /* A GFunc. */ static void device_open_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { OpenDeviceOp * op = data; if (strcmp(op->device_name, "ERROR") == 0 || strcmp(op->device_name, "MISSING") == 0 || strcmp(op->device_name, "DEGRADED") == 0) { g_warning("RAIT device %s contains a missing element, attempting " "degraded mode.\n", op->rait_name); op->result = NULL; } else { op->result = device_open(op->device_name); } } /* Returns TRUE if and only if the volume label and time are equal. */ static gboolean compare_volume_results(Device * a, Device * b) { return (0 == compare_possibly_null_strings(a->volume_time, b->volume_time) && 0 == compare_possibly_null_strings(a->volume_label, b->volume_label)); } /* Stickes new_message at the end of *old_message; frees new_message and * may change *old_message. */ static void append_message(char ** old_message, char * new_message) { char * rval; if (*old_message == NULL || **old_message == '\0') { rval = new_message; } else { rval = g_strdup_printf("%s; %s", *old_message, new_message); amfree(new_message); } amfree(*old_message); *old_message = rval; } static gboolean open_child_devices (Device * dself, char * device_name, char * device_node) { GPtrArray *device_names; GPtrArray * device_open_ops; guint i; gboolean failure; char *failure_errmsgs; DeviceStatusFlags failure_flags; RaitDevice * self; self = RAIT_DEVICE(dself); device_names = expand_braced_alternates(device_node); if (device_names == NULL) { device_set_error(dself, vstrallocf(_("Invalid RAIT device name '%s'"), device_name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } /* Open devices in a separate thread, in case they have to rewind etc. */ device_open_ops = g_ptr_array_new(); for (i = 0; i < device_names->len; i++) { OpenDeviceOp *op; char *name = g_ptr_array_index(device_names, i); op = g_new(OpenDeviceOp, 1); op->device_name = name; op->result = NULL; op->self = self; op->rait_name = device_name; g_ptr_array_add(device_open_ops, op); } g_ptr_array_free(device_names, TRUE); do_rait_child_ops(self, device_open_do_op, device_open_ops); failure = FALSE; failure_errmsgs = NULL; failure_flags = 0; /* Check results of opening devices. */ for (i = 0; i < device_open_ops->len; i ++) { OpenDeviceOp *op = g_ptr_array_index(device_open_ops, i); if (op->result != NULL && op->result->status == DEVICE_STATUS_SUCCESS) { g_ptr_array_add(self->private->children, op->result); } else { char * this_failure_errmsg = g_strdup_printf("%s: %s", op->device_name, device_error_or_status(op->result)); DeviceStatusFlags status = op->result == NULL ? DEVICE_STATUS_DEVICE_ERROR : op->result->status; append_message(&failure_errmsgs, strdup(this_failure_errmsg)); failure_flags |= status; if (self->private->status == RAIT_STATUS_COMPLETE) { /* The first failure just puts us in degraded mode. */ g_warning("%s: %s", device_name, this_failure_errmsg); g_warning("%s: %s failed, entering degraded mode.", device_name, op->device_name); g_ptr_array_add(self->private->children, op->result); self->private->status = RAIT_STATUS_DEGRADED; self->private->failed = i; } else { /* The second and further failures are fatal. */ failure = TRUE; } } amfree(op->device_name); } g_ptr_array_free_full(device_open_ops); if (failure) { self->private->status = RAIT_STATUS_FAILED; device_set_error(dself, failure_errmsgs, failure_flags); return FALSE; } return TRUE; } static void rait_device_open_device (Device * dself, char * device_name, char * device_type G_GNUC_UNUSED, char * device_node) { if (0 != strcmp(device_node, DEFER_CHILDREN_SENTINEL)) { if (!open_child_devices(dself, device_name, device_node)) return; /* Chain up. */ if (parent_class->open_device) { parent_class->open_device(dself, device_name, device_type, device_node); } } } Device * rait_device_open_from_children (GSList *child_devices) { Device *dself; RaitDevice *self; GSList *iter; char *device_name; int nfailures; int i; /* first, open a RAIT device using the DEFER_CHILDREN_SENTINEL */ dself = device_open("rait:" DEFER_CHILDREN_SENTINEL); if (!IS_RAIT_DEVICE(dself)) { return dself; } /* set its children */ self = RAIT_DEVICE(dself); nfailures = 0; for (i=0, iter = child_devices; iter; i++, iter = iter->next) { Device *kid = iter->data; /* a NULL kid is OK -- it opens the device in degraded mode */ if (!kid) { nfailures++; self->private->failed = i; } else { g_assert(IS_DEVICE(kid)); g_object_ref((GObject *)kid); } g_ptr_array_add(self->private->children, kid); } /* and set the status based on the children */ switch (nfailures) { case 0: self->private->status = RAIT_STATUS_COMPLETE; break; case 1: self->private->status = RAIT_STATUS_DEGRADED; break; default: self->private->status = RAIT_STATUS_FAILED; device_set_error(dself, _("more than one child device is missing"), DEVICE_STATUS_DEVICE_ERROR); break; } /* create a name from the children's names and use it to chain up * to open_device (we skipped this step in rait_device_open_device) */ device_name = child_device_names_to_rait_name(self); if (parent_class->open_device) { parent_class->open_device(dself, device_name, "rait", device_name+5); /* (+5 skips "rait:") */ } return dself; } /* A GFunc. */ static void read_label_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { GenericOp * op = data; op->result = GINT_TO_POINTER(device_read_label(op->child)); } static DeviceStatusFlags rait_device_read_label(Device * dself) { RaitDevice * self; GPtrArray * ops; DeviceStatusFlags failed_result = 0; char *failed_errmsg = NULL; unsigned int i; Device * first_success = NULL; self = RAIT_DEVICE(dself); amfree(dself->volume_time); amfree(dself->volume_label); dumpfile_free(dself->volume_header); dself->volume_header = NULL; if (rait_device_in_error(self)) return dself->status | DEVICE_STATUS_DEVICE_ERROR; /* nail down our block size, if we haven't already */ if (!fix_block_size(self)) return FALSE; ops = make_generic_boolean_op_array(self); do_rait_child_ops(self, read_label_do_op, ops); for (i = 0; i < ops->len; i ++) { GenericOp * op = g_ptr_array_index(ops, i); DeviceStatusFlags result = GPOINTER_TO_INT(op->result); if (op->result == DEVICE_STATUS_SUCCESS) { if (first_success == NULL) { /* This is the first successful device. */ first_success = op->child; } else if (!compare_volume_results(first_success, op->child)) { /* Doesn't match. :-( */ failed_errmsg = vstrallocf("Inconsistent volume labels/datestamps: " "Got %s/%s on %s against %s/%s on %s.", first_success->volume_label, first_success->volume_time, first_success->device_name, op->child->volume_label, op->child->volume_time, op->child->device_name); g_warning("%s", failed_errmsg); failed_result |= DEVICE_STATUS_VOLUME_ERROR; } } else { failed_result |= result; } } if (failed_result != DEVICE_STATUS_SUCCESS) { /* We had multiple failures or an inconsistency. */ device_set_error(dself, failed_errmsg, failed_result); } else { /* Everything peachy. */ amfree(failed_errmsg); g_assert(first_success != NULL); if (first_success->volume_label != NULL) { dself->volume_label = g_strdup(first_success->volume_label); } if (first_success->volume_time != NULL) { dself->volume_time = g_strdup(first_success->volume_time); } if (first_success->volume_header != NULL) { dself->volume_header = dumpfile_copy(first_success->volume_header); } dself->header_block_size = first_success->header_block_size; } g_ptr_array_free_full(ops); return dself->status; } typedef struct { GenericOp base; DeviceAccessMode mode; /* IN */ char * label; /* IN */ char * timestamp; /* IN */ } StartOp; /* A GFunc. */ static void start_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { DeviceClass *klass; StartOp * param = data; klass = DEVICE_GET_CLASS(param->base.child); if (klass->start) { param->base.result = GINT_TO_POINTER((klass->start)(param->base.child, param->mode, param->label, param->timestamp)); } else { param->base.result = FALSE; } } static gboolean rait_device_configure(Device * dself, gboolean use_global_config) { RaitDevice *self = RAIT_DEVICE(dself); guint i; for (i = 0; i < self->private->children->len; i ++) { Device *child; if ((signed)i == self->private->failed) continue; child = g_ptr_array_index(self->private->children, i); /* unconditionally configure the child without the global * configuration */ if (!device_configure(child, FALSE)) return FALSE; } if (parent_class->configure) { return parent_class->configure(dself, use_global_config); } return TRUE; } static gboolean rait_device_start (Device * dself, DeviceAccessMode mode, char * label, char * timestamp) { GPtrArray * ops; guint i; gboolean success; RaitDevice * self; DeviceStatusFlags total_status; char *failure_errmsgs = NULL; char * label_from_device = NULL; self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return FALSE; /* No starting in degraded mode. */ if (self->private->status != RAIT_STATUS_COMPLETE && (mode == ACCESS_WRITE || mode == ACCESS_APPEND)) { device_set_error(dself, g_strdup_printf(_("RAIT device %s is read-only " "because it is in degraded mode.\n"), dself->device_name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } /* nail down our block size, if we haven't already */ if (!fix_block_size(self)) return FALSE; dself->access_mode = mode; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); amfree(dself->volume_label); amfree(dself->volume_time); dumpfile_free(dself->volume_header); dself->volume_header = NULL; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { StartOp * op; if ((signed)i == self->private->failed) { continue; } op = g_new(StartOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->mode = mode; op->label = g_strdup(label); op->timestamp = g_strdup(timestamp); g_ptr_array_add(ops, op); } do_rait_child_ops(self, start_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); /* Check results of starting devices; this is mostly about the * VOLUME_UNLABELED flag. */ total_status = 0; for (i = 0; i < ops->len; i ++) { StartOp * op = g_ptr_array_index(ops, i); Device *child = op->base.child; total_status |= child->status; if (child->status != DEVICE_STATUS_SUCCESS) { /* record the error message and move on. */ append_message(&failure_errmsgs, g_strdup_printf("%s: %s", child->device_name, device_error_or_status(child))); } else { if (child->volume_label != NULL && child->volume_time != NULL) { if (label_from_device) { if (strcmp(child->volume_label, dself->volume_label) != 0 || strcmp(child->volume_time, dself->volume_time) != 0) { /* Mismatch! (Two devices provided different labels) */ char * this_message = g_strdup_printf("%s: Label (%s/%s) is different " "from label (%s/%s) found at " "device %s", child->device_name, child->volume_label, child->volume_time, dself->volume_label, dself->volume_time, label_from_device); append_message(&failure_errmsgs, this_message); total_status |= DEVICE_STATUS_DEVICE_ERROR; g_warning("RAIT device children have different labels or timestamps"); } } else { /* First device with a volume. */ dself->volume_label = g_strdup(child->volume_label); dself->volume_time = g_strdup(child->volume_time); dself->volume_header = dumpfile_copy(child->volume_header); label_from_device = g_strdup(child->device_name); } } else { /* Device problem, it says it succeeded but sets no label? */ char * this_message = g_strdup_printf("%s: Says label read, but no volume " "label found.", child->device_name); g_warning("RAIT device child has NULL volume or label"); append_message(&failure_errmsgs, this_message); total_status |= DEVICE_STATUS_DEVICE_ERROR; } } } if (total_status == DEVICE_STATUS_SUCCESS) { StartOp * op = g_ptr_array_index(ops, 0); Device *child = op->base.child; dself->header_block_size = child->header_block_size; } amfree(label_from_device); g_ptr_array_free_full(ops); dself->status = total_status; if (total_status != DEVICE_STATUS_SUCCESS || !success) { device_set_error(dself, failure_errmsgs, total_status); return FALSE; } amfree(failure_errmsgs); return TRUE; } typedef struct { GenericOp base; dumpfile_t * info; /* IN */ int fileno; } StartFileOp; /* a GFunc */ static void start_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { StartFileOp * op = data; op->base.result = GINT_TO_POINTER(device_start_file(op->base.child, op->info)); op->fileno = op->base.child->file; if (op->fileno < 1) { op->base.result = FALSE; } } static gboolean rait_device_start_file (Device * dself, dumpfile_t * info) { GPtrArray * ops; guint i; gboolean success; RaitDevice * self; int actual_file = -1; self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return FALSE; if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { StartFileOp * op; op = g_new(StartFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); /* each child gets its own copy of the header, to munge as it * likes (setting blocksize, at least) */ op->info = dumpfile_copy(info); g_ptr_array_add(ops, op); } do_rait_child_ops(self, start_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); for (i = 0; i < self->private->children->len && success; i ++) { StartFileOp * op = g_ptr_array_index(ops, i); if (!op->base.result) continue; g_assert(op->fileno >= 1); if (actual_file < 1) { actual_file = op->fileno; } if (actual_file != op->fileno) { /* File number mismatch! Aah, my hair is on fire! */ device_set_error(dself, g_strdup_printf("File number mismatch in " "rait_device_start_file(): " "Child %s reported file number " "%d, another child reported " "file number %d.", op->base.child->device_name, op->fileno, actual_file), DEVICE_STATUS_DEVICE_ERROR); success = FALSE; op->base.result = FALSE; } } for (i = 0; i < ops->len && success; i ++) { StartFileOp * op = g_ptr_array_index(ops, i); if (op->info) dumpfile_free(op->info); } g_ptr_array_free_full(ops); if (!success) { if (!device_in_error(dself)) { device_set_error(dself, stralloc("One or more devices " "failed to start_file"), DEVICE_STATUS_DEVICE_ERROR); } return FALSE; } g_assert(actual_file >= 1); dself->file = actual_file; g_mutex_lock(dself->device_mutex); dself->in_file = TRUE; dself->bytes_written = 0; g_mutex_unlock(dself->device_mutex); return TRUE; } static void find_simple_params(RaitDevice * self, guint * num_children, guint * data_children) { int num, data; num = self->private->children->len; if (num > 1) data = num - 1; else data = num; if (num_children != NULL) *num_children = num; if (data_children != NULL) *data_children = data; } typedef struct { GenericOp base; guint size; /* IN */ gpointer data; /* IN */ gboolean data_needs_free; /* bookkeeping */ } WriteBlockOp; /* a GFunc. */ static void write_block_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { WriteBlockOp * op = data; op->base.result = GINT_TO_POINTER(device_write_block(op->base.child, op->size, op->data)); } /* Parity block generation. Performance of this function can be improved considerably by using larger-sized integers or assembly-coded vector instructions. Parameters are: % data - All data chunks in series (chunk_size * num_chunks bytes) % parity - Allocated space for parity block (chunk_size bytes) */ static void make_parity_block(char * data, char * parity, guint chunk_size, guint num_chunks) { guint i; bzero(parity, chunk_size); for (i = 0; i < num_chunks - 1; i ++) { guint j; for (j = 0; j < chunk_size; j ++) { parity[j] ^= data[chunk_size*i + j]; } } } /* Does the same thing as make_parity_block, but instead of using a single memory chunk holding all chunks, it takes a GPtrArray of chunks. */ static void make_parity_block_extents(GPtrArray * data, char * parity, guint chunk_size) { guint i; bzero(parity, chunk_size); for (i = 0; i < data->len; i ++) { guint j; char * data_chunk; data_chunk = g_ptr_array_index(data, i); for (j = 0; j < chunk_size; j ++) { parity[j] ^= data_chunk[j]; } } } /* Does the parity creation algorithm. Allocates and returns a single device block from a larger RAIT block. chunks and chunk are 1-indexed. */ static char * extract_data_block(char * data, guint size, guint chunks, guint chunk) { char * rval; guint chunk_size; g_assert(chunks > 0 && chunk > 0 && chunk <= chunks); g_assert(data != NULL); g_assert(size > 0 && size % (chunks - 1) == 0); chunk_size = size / (chunks - 1); rval = g_malloc(chunk_size); if (chunks != chunk) { /* data block. */ memcpy(rval, data + chunk_size * (chunk - 1), chunk_size); } else { make_parity_block(data, rval, chunk_size, chunks); } return rval; } static gboolean rait_device_write_block (Device * dself, guint size, gpointer data) { GPtrArray * ops; guint i; gboolean success; guint data_children, num_children; gsize blocksize = dself->block_size; RaitDevice * self; gboolean last_block = (size < blocksize); self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return FALSE; if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; find_simple_params(RAIT_DEVICE(self), &num_children, &data_children); num_children = self->private->children->len; if (num_children != 1) data_children = num_children - 1; else data_children = num_children; g_assert(size % data_children == 0 || last_block); /* zero out to the end of a short block -- tape devices only write * whole blocks. */ if (last_block) { char *new_data; new_data = g_malloc(blocksize); memcpy(new_data, data, size); bzero(new_data + size, blocksize - size); data = new_data; size = blocksize; } ops = g_ptr_array_sized_new(num_children); for (i = 0; i < self->private->children->len; i ++) { WriteBlockOp * op; op = g_malloc(sizeof(*op)); op->base.child = g_ptr_array_index(self->private->children, i); op->size = size / data_children; if (num_children <= 2) { op->data = data; op->data_needs_free = FALSE; } else { op->data_needs_free = TRUE; op->data = extract_data_block(data, size, num_children, i + 1); } g_ptr_array_add(ops, op); } do_rait_child_ops(self, write_block_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); for (i = 0; i < self->private->children->len; i ++) { WriteBlockOp * op = g_ptr_array_index(ops, i); if (op->data_needs_free) free(op->data); } if (last_block) { amfree(data); } g_ptr_array_free_full(ops); if (!success) { /* TODO be more specific here */ /* TODO: handle EOM here -- if one or more (or two or more??) * children have is_eom set, then reflect that in our error * status. What's more fun is when one device fails and must be isolated at * the same time another hits EOF. */ device_set_error(dself, stralloc("One or more devices failed to write_block"), DEVICE_STATUS_DEVICE_ERROR); /* this is EOM or an error, so call it EOM */ dself->is_eom = TRUE; return FALSE; } else { dself->block ++; g_mutex_lock(dself->device_mutex); dself->bytes_written += size; g_mutex_unlock(dself->device_mutex); return TRUE; } } /* A GFunc */ static void finish_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { GenericOp * op = data; if (op->child) { op->result = GINT_TO_POINTER(device_finish_file(op->child)); } else { op->result = FALSE; } } static gboolean rait_device_finish_file (Device * dself) { GPtrArray * ops; gboolean success; RaitDevice * self = RAIT_DEVICE(dself); g_assert(self != NULL); if (!dself->in_file) return TRUE; if (rait_device_in_error(dself)) return FALSE; if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; ops = make_generic_boolean_op_array(self); do_rait_child_ops(self, finish_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); if (!success) { /* TODO: be more specific here */ device_set_error(dself, g_strdup("One or more devices failed to finish_file"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); return TRUE; } typedef struct { GenericOp base; guint requested_file; /* IN */ guint actual_file; /* OUT */ } SeekFileOp; /* a GFunc. */ static void seek_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { SeekFileOp * op = data; op->base.result = device_seek_file(op->base.child, op->requested_file); op->actual_file = op->base.child->file; } static dumpfile_t * rait_device_seek_file (Device * dself, guint file) { GPtrArray * ops; guint i; gboolean success; dumpfile_t * rval; RaitDevice * self = RAIT_DEVICE(dself); guint actual_file = 0; gboolean in_file = FALSE; if (rait_device_in_error(self)) return NULL; dself->is_eof = FALSE; dself->block = 0; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; dself->bytes_read = 0; g_mutex_unlock(dself->device_mutex); ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { SeekFileOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ op = g_new(SeekFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; op->requested_file = file; g_ptr_array_add(ops, op); } do_rait_child_ops(self, seek_file_do_op, ops); /* This checks for NULL values, but we still have to check for consistant headers. */ success = g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_pointer_op); rval = NULL; for (i = 0; i < ops->len; i ++) { SeekFileOp * this_op; dumpfile_t * this_result; guint this_actual_file; gboolean this_in_file; this_op = (SeekFileOp*)g_ptr_array_index(ops, i); if ((signed)this_op->base.child_index == self->private->failed) continue; this_result = this_op->base.result; this_actual_file = this_op->actual_file; this_in_file = this_op->base.child->in_file; if (rval == NULL) { rval = this_result; actual_file = this_actual_file; in_file = this_in_file; } else { if (headers_are_equal(rval, this_result) && actual_file == this_actual_file && in_file == this_in_file) { /* Do nothing. */ } else { success = FALSE; } free(this_result); } } g_ptr_array_free_full(ops); if (!success) { amfree(rval); /* TODO: be more specific here */ device_set_error(dself, g_strdup("One or more devices failed to seek_file"), DEVICE_STATUS_DEVICE_ERROR); return NULL; } /* update our state */ g_mutex_lock(dself->device_mutex); dself->in_file = in_file; g_mutex_unlock(dself->device_mutex); dself->file = actual_file; return rval; } typedef struct { GenericOp base; guint64 block; /* IN */ } SeekBlockOp; /* a GFunc. */ static void seek_block_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { SeekBlockOp * op = data; op->base.result = GINT_TO_POINTER(device_seek_block(op->base.child, op->block)); } static gboolean rait_device_seek_block (Device * dself, guint64 block) { GPtrArray * ops; guint i; gboolean success; RaitDevice * self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { SeekBlockOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ op = g_new(SeekBlockOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; op->block = block; g_ptr_array_add(ops, op); } do_rait_child_ops(self, seek_block_do_op, ops); success = g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); if (!success) { /* TODO: be more specific here */ device_set_error(dself, stralloc("One or more devices failed to seek_block"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } dself->block = block; return TRUE; } typedef struct { GenericOp base; gpointer buffer; /* IN */ int read_size; /* IN/OUT -- note not a pointer */ int desired_read_size; /* bookkeeping */ } ReadBlockOp; /* a GFunc. */ static void read_block_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { ReadBlockOp * op = data; op->base.result = GINT_TO_POINTER(device_read_block(op->base.child, op->buffer, &(op->read_size))); if (op->read_size > op->desired_read_size) { g_warning("child device %s tried to return an oversized block, which the RAIT device does not support", op->base.child->device_name); } } /* A BooleanExtractor. This one checks for a successful read. */ static gboolean extract_boolean_read_block_op_data(gpointer data) { ReadBlockOp * op = data; return GPOINTER_TO_INT(op->base.result) == op->desired_read_size; } /* A BooleanExtractor. This one checks for EOF. */ static gboolean extract_boolean_read_block_op_eof(gpointer data) { ReadBlockOp * op = data; return op->base.child->is_eof; } /* Counts the number of elements in an array matching a given proposition. */ static int g_ptr_array_count(GPtrArray * array, BooleanExtractor filter) { int rval; unsigned int i; rval = 0; for (i = 0; i < array->len ; i++) { if (filter(g_ptr_array_index(array, i))) rval ++; } return rval; } static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, gpointer buf, size_t bufsize) { guint num_children, data_children; gsize blocksize; gsize child_blocksize; guint i; int parity_child; gpointer parity_block = NULL; gboolean success; success = TRUE; blocksize = DEVICE(self)->block_size; find_simple_params(self, &num_children, &data_children); if (num_children > 1) parity_child = num_children - 1; else parity_child = -1; child_blocksize = blocksize / data_children; for (i = 0; i < ops->len; i ++) { ReadBlockOp * op = g_ptr_array_index(ops, i); if (!extract_boolean_read_block_op_data(op)) continue; if ((int)(op->base.child_index) == parity_child) { parity_block = op->buffer; } else { g_assert(child_blocksize * (op->base.child_index+1) <= bufsize); memcpy((char *)buf + child_blocksize * op->base.child_index, op->buffer, child_blocksize); } } if (self->private->status == RAIT_STATUS_COMPLETE) { g_assert(parity_block != NULL); /* should have found parity_child */ if (num_children >= 2) { /* Verify the parity block. This code is inefficient but does the job for the 2-device case, too. */ gpointer constructed_parity; GPtrArray * data_extents; constructed_parity = g_malloc(child_blocksize); data_extents = g_ptr_array_sized_new(data_children); for (i = 0; i < data_children; i ++) { ReadBlockOp * op = g_ptr_array_index(ops, i); g_assert(extract_boolean_read_block_op_data(op)); if ((int)op->base.child_index == parity_child) continue; g_ptr_array_add(data_extents, op->buffer); } make_parity_block_extents(data_extents, constructed_parity, child_blocksize); if (0 != memcmp(parity_block, constructed_parity, child_blocksize)) { device_set_error(DEVICE(self), stralloc(_("RAIT is inconsistent: Parity block did not match data blocks.")), DEVICE_STATUS_DEVICE_ERROR); /* TODO: can't we just isolate the device in this case? */ success = FALSE; } g_ptr_array_free(data_extents, TRUE); amfree(constructed_parity); } else { /* do nothing. */ } } else if (self->private->status == RAIT_STATUS_DEGRADED) { g_assert(self->private->failed >= 0 && self->private->failed < (int)num_children); /* We are in degraded mode. What's missing? */ if (self->private->failed == parity_child) { /* do nothing. */ } else if (num_children >= 2) { /* Reconstruct failed block from parity block. */ GPtrArray * data_extents = g_ptr_array_new(); for (i = 0; i < data_children; i ++) { ReadBlockOp * op = g_ptr_array_index(ops, i); if (!extract_boolean_read_block_op_data(op)) continue; g_ptr_array_add(data_extents, op->buffer); } /* Conveniently, the reconstruction is the same procedure as the parity generation. This even works if there is only one remaining device! */ make_parity_block_extents(data_extents, (char *)buf + (child_blocksize * self->private->failed), child_blocksize); /* The array members belong to our ops argument. */ g_ptr_array_free(data_extents, TRUE); } else { g_assert_not_reached(); } } else { /* device is already in FAILED state -- we shouldn't even be here */ success = FALSE; } return success; } static int rait_device_read_block (Device * dself, gpointer buf, int * size) { GPtrArray * ops; guint i; gboolean success; guint num_children, data_children; gsize blocksize = dself->block_size; gsize child_blocksize; RaitDevice * self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return -1; find_simple_params(self, &num_children, &data_children); /* tell caller they haven't given us a big enough buffer */ if (blocksize > (gsize)*size) { g_assert(blocksize < INT_MAX); *size = (int)blocksize; return 0; } g_assert(blocksize % data_children == 0); /* see find_block_size */ child_blocksize = blocksize / data_children; ops = g_ptr_array_sized_new(num_children); for (i = 0; i < num_children; i ++) { ReadBlockOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ op = g_new(ReadBlockOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; op->buffer = g_malloc(child_blocksize); op->desired_read_size = op->read_size = child_blocksize; g_ptr_array_add(ops, op); } do_rait_child_ops(self, read_block_do_op, ops); if (g_ptr_array_count(ops, extract_boolean_read_block_op_data)) { if (!g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_read_block_op_data)) { /* TODO: be more specific */ device_set_error(dself, stralloc(_("Error occurred combining blocks from child devices")), DEVICE_STATUS_DEVICE_ERROR); success = FALSE; } else { /* raid_block_reconstruction sets the error status if necessary */ success = raid_block_reconstruction(RAIT_DEVICE(self), ops, buf, (size_t)*size); } } else { success = FALSE; if (g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_read_block_op_eof)) { device_set_error(dself, stralloc(_("EOF")), DEVICE_STATUS_SUCCESS); dself->is_eof = TRUE; g_mutex_lock(dself->device_mutex); dself->in_file = FALSE; g_mutex_unlock(dself->device_mutex); } else { device_set_error(dself, stralloc(_("All child devices failed to read, but not all are at eof")), DEVICE_STATUS_DEVICE_ERROR); } } for (i = 0; i < ops->len; i ++) { ReadBlockOp * op = g_ptr_array_index(ops, i); amfree(op->buffer); } g_ptr_array_free_full(ops); if (success) { dself->block++; *size = blocksize; g_mutex_lock(dself->device_mutex); dself->bytes_read += blocksize; g_mutex_unlock(dself->device_mutex); return blocksize; } else { return -1; } } /* property utility functions */ typedef struct { GenericOp base; DevicePropertyId id; /* IN */ GValue value; /* IN/OUT */ PropertySurety surety; /* IN (for set) */ PropertySource source; /* IN (for set) */ } PropertyOp; /* Creates a GPtrArray of PropertyOf for a get or set operation. */ static GPtrArray * make_property_op_array(RaitDevice * self, DevicePropertyId id, GValue * value, PropertySurety surety, PropertySource source) { guint i; GPtrArray * ops; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { PropertyOp * op; if ((signed)i == self->private->failed) { continue; } op = g_new(PropertyOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->id = id; bzero(&(op->value), sizeof(op->value)); if (value != NULL) { g_value_unset_copy(value, &(op->value)); } op->surety = surety; op->source = source; g_ptr_array_add(ops, op); } return ops; } /* A GFunc. */ static void property_get_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { PropertyOp * op = data; bzero(&(op->value), sizeof(op->value)); op->base.result = GINT_TO_POINTER(device_property_get(op->base.child, op->id, &(op->value))); } /* A GFunc. */ static void property_set_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { PropertyOp * op = data; op->base.result = GINT_TO_POINTER(device_property_set_ex(op->base.child, op->id, &(op->value), op->surety, op->source)); g_value_unset(&(op->value)); } /* PropertyGetFns and PropertySetFns */ static gboolean property_get_block_size_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); gsize my_block_size; if (dself->block_size_source != PROPERTY_SOURCE_DEFAULT) { my_block_size = dself->block_size; if (surety) *surety = dself->block_size_surety; } else { gsize child_block_size; child_block_size = calculate_block_size_from_children(self, &my_block_size); if (child_block_size == 0) return FALSE; if (surety) *surety = PROPERTY_SURETY_BAD; /* may still change */ } if (val) { g_value_unset_init(val, G_TYPE_INT); g_assert(my_block_size < G_MAXINT); /* gsize -> gint */ g_value_set_int(val, (gint)my_block_size); } if (source) *source = dself->block_size_source; return TRUE; } static gboolean property_set_block_size_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety, PropertySource source) { RaitDevice *self = RAIT_DEVICE(dself); gint my_block_size = g_value_get_int(val); guint data_children; find_simple_params(self, NULL, &data_children); if ((my_block_size % data_children) != 0) { device_set_error(dself, vstrallocf(_("Block size must be a multiple of %d"), data_children), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } dself->block_size = my_block_size; dself->block_size_source = source; dself->block_size_surety = surety; if (!fix_block_size(self)) return FALSE; return TRUE; } static gboolean property_get_canonical_name_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); char *canonical = child_device_names_to_rait_name(self); if (val) { g_value_unset_init(val, G_TYPE_STRING); g_value_set_string(val, canonical); g_free(canonical); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; return TRUE; } static gboolean property_get_concurrency_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); ConcurrencyParadigm result; guint i; GPtrArray * ops; gboolean success; ops = make_property_op_array(self, PROPERTY_CONCURRENCY, NULL, 0, 0); do_rait_child_ops(self, property_get_do_op, ops); /* find the most restrictive paradigm acceptable to all * child devices */ result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; success = TRUE; for (i = 0; i < ops->len; i ++) { ConcurrencyParadigm cur; PropertyOp * op = g_ptr_array_index(ops, i); if (!op->base.result || G_VALUE_TYPE(&(op->value)) != CONCURRENCY_PARADIGM_TYPE) { success = FALSE; break; } cur = g_value_get_enum(&(op->value)); if (result == CONCURRENCY_PARADIGM_EXCLUSIVE || cur == CONCURRENCY_PARADIGM_EXCLUSIVE) { result = CONCURRENCY_PARADIGM_EXCLUSIVE; } else if (result == CONCURRENCY_PARADIGM_SHARED_READ || cur == CONCURRENCY_PARADIGM_SHARED_READ) { result = CONCURRENCY_PARADIGM_SHARED_READ; } else if (result == CONCURRENCY_PARADIGM_RANDOM_ACCESS && cur == CONCURRENCY_PARADIGM_RANDOM_ACCESS) { result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; } else { success = FALSE; break; } } g_ptr_array_free_full(ops); if (success) { if (val) { g_value_unset_init(val, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(val, result); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; } return success; } static gboolean property_get_streaming_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); StreamingRequirement result; guint i; GPtrArray * ops; gboolean success; ops = make_property_op_array(self, PROPERTY_STREAMING, NULL, 0, 0); do_rait_child_ops(self, property_get_do_op, ops); /* combine the child streaming requirements, selecting the strongest * requirement of the bunch. */ result = STREAMING_REQUIREMENT_NONE; success = TRUE; for (i = 0; i < ops->len; i ++) { StreamingRequirement cur; PropertyOp * op = g_ptr_array_index(ops, i); if (!op->base.result || G_VALUE_TYPE(&(op->value)) != STREAMING_REQUIREMENT_TYPE) { success = FALSE; break; } cur = g_value_get_enum(&(op->value)); if (result == STREAMING_REQUIREMENT_REQUIRED || cur == STREAMING_REQUIREMENT_REQUIRED) { result = STREAMING_REQUIREMENT_REQUIRED; } else if (result == STREAMING_REQUIREMENT_DESIRED || cur == STREAMING_REQUIREMENT_DESIRED) { result = STREAMING_REQUIREMENT_DESIRED; } else if (result == STREAMING_REQUIREMENT_NONE && cur == STREAMING_REQUIREMENT_NONE) { result = STREAMING_REQUIREMENT_NONE; } else { success = FALSE; break; } } g_ptr_array_free_full(ops); if (success) { if (val) { g_value_unset_init(val, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(val, result); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; } return success; } static gboolean property_get_boolean_and_fn(Device *dself, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); gboolean result; guint i; GPtrArray * ops; gboolean success; ops = make_property_op_array(self, base->ID, NULL, 0, 0); do_rait_child_ops(self, property_get_do_op, ops); /* combine the child values, applying a simple AND */ result = TRUE; success = TRUE; for (i = 0; i < ops->len; i ++) { PropertyOp * op = g_ptr_array_index(ops, i); if (!op->base.result || !G_VALUE_HOLDS_BOOLEAN(&(op->value))) { success = FALSE; break; } if (!g_value_get_boolean(&(op->value))) { result = FALSE; break; } } g_ptr_array_free_full(ops); if (success) { if (val) { g_value_unset_init(val, G_TYPE_BOOLEAN); g_value_set_boolean(val, result); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; } return success; } static gboolean property_get_medium_access_type_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); MediaAccessMode result; guint i; GPtrArray * ops; gboolean success; ops = make_property_op_array(self, PROPERTY_MEDIUM_ACCESS_TYPE, NULL, 0, 0); do_rait_child_ops(self, property_get_do_op, ops); /* combine the modes as best we can */ result = 0; success = TRUE; for (i = 0; i < ops->len; i ++) { MediaAccessMode cur; PropertyOp * op = g_ptr_array_index(ops, i); if (!op->base.result || G_VALUE_TYPE(&(op->value)) != MEDIA_ACCESS_MODE_TYPE) { success = FALSE; break; } cur = g_value_get_enum(&(op->value)); if (i == 0) { result = cur; } else if ((result == MEDIA_ACCESS_MODE_READ_ONLY && cur == MEDIA_ACCESS_MODE_WRITE_ONLY) || (result == MEDIA_ACCESS_MODE_WRITE_ONLY && cur == MEDIA_ACCESS_MODE_READ_ONLY)) { /* Invalid combination; one device can only read, other can only write. */ success = FALSE; break; } else if (result == MEDIA_ACCESS_MODE_READ_ONLY || cur == MEDIA_ACCESS_MODE_READ_ONLY) { result = MEDIA_ACCESS_MODE_READ_ONLY; } else if (result == MEDIA_ACCESS_MODE_WRITE_ONLY || cur == MEDIA_ACCESS_MODE_WRITE_ONLY) { result = MEDIA_ACCESS_MODE_WRITE_ONLY; } else if (result == MEDIA_ACCESS_MODE_WORM || cur == MEDIA_ACCESS_MODE_WORM) { result = MEDIA_ACCESS_MODE_WORM; } else if (result == MEDIA_ACCESS_MODE_READ_WRITE && cur == MEDIA_ACCESS_MODE_READ_WRITE) { result = MEDIA_ACCESS_MODE_READ_WRITE; } else { success = FALSE; break; } } g_ptr_array_free_full(ops); if (success) { if (val) { g_value_unset_init(val, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(val, result); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; } return success; } static gboolean property_get_max_volume_usage_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { RaitDevice *self = RAIT_DEVICE(dself); guint64 result; guint i; GPtrArray * ops; guint data_children; ops = make_property_op_array(self, PROPERTY_MAX_VOLUME_USAGE, NULL, 0, 0); do_rait_child_ops(self, property_get_do_op, ops); /* look for the smallest value that is set */ result = 0; for (i = 0; i < ops->len; i ++) { guint64 cur; PropertyOp * op = g_ptr_array_index(ops, i); if (!op->base.result || !G_VALUE_HOLDS_UINT64(&(op->value))) { continue; /* ignore children without this property */ } cur = g_value_get_uint64(&(op->value)); if (!result || (cur && cur < result)) { result = cur; } } g_ptr_array_free_full(ops); if (result) { /* result contains the minimum usage on any child. We can use that space * on each of our data children, so the total is larger */ find_simple_params(self, NULL, &data_children); result *= data_children; if (val) { g_value_unset_init(val, G_TYPE_UINT64); g_value_set_uint64(val, result); } if (surety) *surety = PROPERTY_SURETY_GOOD; if (source) *source = PROPERTY_SOURCE_DETECTED; return TRUE; } else { /* no result from any children, so we effectively don't have this property */ return FALSE; } } static gboolean property_set_max_volume_usage_fn(Device *dself, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety, PropertySource source) { RaitDevice *self = RAIT_DEVICE(dself); guint64 parent_usage; guint64 child_usage; GValue child_val; guint i; gboolean success; GPtrArray * ops; guint data_children; parent_usage = g_value_get_uint64(val); find_simple_params(self, NULL, &data_children); child_usage = parent_usage / data_children; bzero(&child_val, sizeof(child_val)); g_value_init(&child_val, G_TYPE_UINT64); g_value_set_uint64(&child_val, child_usage); ops = make_property_op_array(self, PROPERTY_MAX_VOLUME_USAGE, &child_val, surety, source); do_rait_child_ops(self, property_set_do_op, ops); /* if any of the kids succeeded, then we did too */ success = FALSE; for (i = 0; i < ops->len; i ++) { PropertyOp * op = g_ptr_array_index(ops, i); if (op->base.result) { success = TRUE; break; } } g_ptr_array_free_full(ops); return success; } typedef struct { GenericOp base; guint filenum; } RecycleFileOp; /* A GFunc */ static void recycle_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { RecycleFileOp * op = data; op->base.result = GINT_TO_POINTER(device_recycle_file(op->base.child, op->filenum)); } static gboolean rait_device_recycle_file (Device * dself, guint filenum) { GPtrArray * ops; guint i; gboolean success; RaitDevice * self = RAIT_DEVICE(dself); if (rait_device_in_error(self)) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { RecycleFileOp * op; op = g_new(RecycleFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->filenum = filenum; g_ptr_array_add(ops, op); } do_rait_child_ops(self, recycle_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); if (!success) { /* TODO: be more specific here */ device_set_error(dself, stralloc(_("One or more devices failed to recycle_file")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } return TRUE; } /* GFunc */ static void finish_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { GenericOp * op = data; op->result = GINT_TO_POINTER(device_finish(op->child)); } static gboolean rait_device_finish (Device * self) { GPtrArray * ops; gboolean success; gboolean rval = TRUE; rval = !rait_device_in_error(self); ops = make_generic_boolean_op_array(RAIT_DEVICE(self)); do_rait_child_ops(RAIT_DEVICE(self), finish_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); if (!success) rval = FALSE; g_ptr_array_free_full(ops); self->access_mode = ACCESS_NULL; return rval; } static Device * rait_device_factory (char * device_name, char * device_type, char * device_node) { Device * rval; g_assert(0 == strcmp(device_type, "rait")); rval = DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL)); device_open_device(rval, device_name, device_type, device_node); return rval; } void rait_device_register (void) { static const char * device_prefix_list[] = {"rait", NULL}; register_device(rait_device_factory, device_prefix_list); } amanda-3.3.6/device-src/vfs-device.h0000664000076400007640000000465312357250004020676 0ustar00martineamartinea00000000000000/* * Copyright (c) 2005-2013 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #ifndef __VFS_DEVICE_H__ #define __VFS_DEVICE_H__ #include "device.h" /* * Type checking and casting macros */ #define TYPE_VFS_DEVICE (vfs_device_get_type()) #define VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice) #define VFS_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice const) #define VFS_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), vfs_device_get_type(), VfsDeviceClass) #define IS_VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), vfs_device_get_type ()) #define VFS_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), vfs_device_get_type(), VfsDeviceClass) GType vfs_device_get_type (void); /* * Main object structure */ typedef struct { Device __parent__; /*< private >*/ char * dir_name; char * file_name; int open_file_fd; gboolean leom; /* Properties */ guint64 volume_bytes; guint64 volume_limit; gboolean enforce_volume_limit; /* should we monitor free space? (controlled by MONITOR_FREE_SPACE property) */ gboolean monitor_free_space; /* how many bytes were free at last check */ guint64 checked_fs_free_bytes; /* when was that check performed? */ time_t checked_fs_free_time; /* and how many bytes have been written since the last check? */ guint64 checked_bytes_used; } VfsDevice; /* * Class definition */ typedef struct { DeviceClass __parent__; } VfsDeviceClass; /* Implementation functions */ void delete_vfs_files(VfsDevice * self); #endif amanda-3.3.6/device-src/tape-device.c0000664000076400007640000021650512357250004021025 0ustar00martineamartinea00000000000000/* * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "pipespawn.h" #include /* memset() */ #include "util.h" #include "device.h" #ifdef HAVE_SYS_TAPE_H # include #endif #ifdef HAVE_SYS_MTIO_H # include #endif #ifdef HAVE_LIMITS_H # include #endif /* This is equal to 2*1024*1024*1024 - 16*1024*1024 - 1, but written explicitly to avoid overflow issues. */ #define RESETOFS_THRESHOLD (0x7effffff) /* Largest possible block size on SCSI systems. */ #define LARGEST_BLOCK_ESTIMATE (16 * 1024 * 1024) /* * Type checking and casting macros */ #define TYPE_TAPE_DEVICE (tape_device_get_type()) #define TAPE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice) #define TAPE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice const) #define TAPE_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), tape_device_get_type(), TapeDeviceClass) #define IS_TAPE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), tape_device_get_type ()) #define TAPE_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), tape_device_get_type(), TapeDeviceClass) GType tape_device_get_type (void); /* * Main object structure */ typedef struct TapeDevicePrivate_s TapeDevicePrivate; typedef struct _TapeDevice { Device __parent__; /* It should go without saying that all this stuff is * look-but-don't-touch. */ /* characteristics of the device */ gboolean fsf, bsf, fsr, bsr, eom, bsf_after_eom, broken_gmt_online; gboolean leom; gboolean nonblocking_open, fsf_after_filemark; int final_filemarks; /* 0 if we opened with O_RDWR; error otherwise. */ gboolean write_open_errno; int fd; TapeDevicePrivate * private; } TapeDevice; struct TapeDevicePrivate_s { /* This holds the total number of bytes written to the device, modulus RESETOFS_THRESHOLD. */ int write_count; char * device_filename; gsize read_block_size; }; /* * Class definition */ typedef struct _TapeDeviceClass TapeDeviceClass; struct _TapeDeviceClass { DeviceClass __parent__; }; void tape_device_register(void); /* useful callback for tape ops */ void tape_device_set_capabilities(TapeDevice *self, gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source, gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source, gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source, gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source, gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source, gboolean eom, PropertySurety eom_surety, PropertySource eom_source, gboolean leom, PropertySurety leom_surety, PropertySource leom_source, gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source, guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source); /* Real Operations (always return FALSE if not implemented) */ gboolean tape_rewind(int fd); gboolean tape_fsf(int fd, guint count); gboolean tape_bsf(int fd, guint count); gboolean tape_fsr(int fd, guint count); gboolean tape_bsr(int fd, guint count); gint tape_fileno(int fd); /* tape_fileno returns tape position file number, or one of these: */ #define TAPE_OP_ERROR -1 #define TAPE_POSITION_UNKNOWN -2 /* Possible (abstracted) results from a system I/O operation. */ typedef enum { RESULT_SUCCESS, RESULT_ERROR, /* Undefined error (*errmsg set) */ RESULT_SMALL_BUFFER, /* Tried to read with a buffer that is too small. */ RESULT_NO_DATA, /* End of File, while reading */ RESULT_NO_SPACE, /* Out of space. Sometimes we don't know if it was this or I/O error, but this is the preferred explanation. */ RESULT_MAX } IoResult; /* returns a fileno like tape_fileno */ gint tape_eod(int fd); gboolean tape_weof(int fd, guint8 count); gboolean tape_setcompression(int fd, gboolean on); gboolean tape_offl(int fd); DeviceStatusFlags tape_is_tape_device(int fd); DeviceStatusFlags get_tape_blocksize(int fd, guint64 *tape_blocksize); DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self); #define tape_device_read_size(self) \ (((TapeDevice *)(self))->private->read_block_size? \ ((TapeDevice *)(self))->private->read_block_size : ((Device *)(self))->block_size) /* * Our device-specific properties. */ #define PROPERTY_BROKEN_GMT_ONLINE (device_property_broken_gmt_online.ID) #define PROPERTY_FSF (device_property_fsf.ID) #define PROPERTY_FSF_AFTER_FILEMARK (device_property_fsf_after_filemark.ID) #define PROPERTY_BSF (device_property_bsf.ID) #define PROPERTY_FSR (device_property_fsr.ID) #define PROPERTY_BSR (device_property_bsr.ID) #define PROPERTY_EOM (device_property_eom.ID) #define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID) #define PROPERTY_NONBLOCKING_OPEN (device_property_nonblocking_open.ID) #define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID) static DevicePropertyBase device_property_broken_gmt_online; static DevicePropertyBase device_property_fsf; static DevicePropertyBase device_property_fsf_after_filemark; static DevicePropertyBase device_property_bsf; static DevicePropertyBase device_property_fsr; static DevicePropertyBase device_property_bsr; static DevicePropertyBase device_property_eom; static DevicePropertyBase device_property_bsf_after_eom; static DevicePropertyBase device_property_nonblocking_open; static DevicePropertyBase device_property_final_filemarks; static DevicePropertyBase device_property_read_buffer_size; /* old name for READ_BLOCK_SIZE */ /* here are local prototypes */ static void tape_device_init (TapeDevice * o); static void tape_device_class_init (TapeDeviceClass * c); static void tape_device_base_init (TapeDeviceClass * c); static gboolean tape_device_set_feature_property_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean tape_device_set_final_filemarks_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean tape_device_set_compression_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static gboolean tape_device_get_read_block_size_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety *surety, PropertySource *source); static gboolean tape_device_set_read_block_size_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source); static void tape_device_open_device (Device * self, char * device_name, char * device_type, char * device_node); static Device * tape_device_factory (char * device_name, char * device_type, char * device_node); static DeviceStatusFlags tape_device_read_label(Device * self); static gboolean tape_device_write_block(Device * self, guint size, gpointer data); static int tape_device_read_block(Device * self, gpointer buf, int * size_req); static gboolean tape_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); static gboolean tape_device_start_file (Device * self, dumpfile_t * ji); static gboolean tape_device_finish_file (Device * self); static dumpfile_t * tape_device_seek_file (Device * self, guint file); static gboolean tape_device_seek_block (Device * self, guint64 block); static gboolean tape_device_eject (Device * self); static gboolean tape_device_finish (Device * self); static IoResult tape_device_robust_read (TapeDevice * self, void * buf, int * count, char **errmsg); static IoResult tape_device_robust_write (TapeDevice * self, void * buf, int count, char **errmsg); static gboolean tape_device_fsf (TapeDevice * self, guint count); static gboolean tape_device_fsr (TapeDevice * self, guint count); static gboolean tape_device_bsr (TapeDevice * self, guint count, guint file, guint block); static gboolean tape_device_eod (TapeDevice * self); /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; GType tape_device_get_type (void) { static GType type = 0; if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (TapeDeviceClass), (GBaseInitFunc) tape_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tape_device_class_init, (GClassFinalizeFunc) NULL, NULL /* class_data */, sizeof (TapeDevice), 0 /* n_preallocs */, (GInstanceInitFunc) tape_device_init, NULL }; type = g_type_register_static (TYPE_DEVICE, "TapeDevice", &info, (GTypeFlags)0); } return type; } static void tape_device_init (TapeDevice * self) { Device * d_self; GValue response; d_self = DEVICE(self); bzero(&response, sizeof(response)); self->private = g_new0(TapeDevicePrivate, 1); /* Clear all fields. */ d_self->block_size = 32768; d_self->min_block_size = 32768; d_self->max_block_size = LARGEST_BLOCK_ESTIMATE; self->broken_gmt_online = FALSE; self->fd = -1; /* set all of the feature properties to an unsure default of FALSE */ self->broken_gmt_online = FALSE; self->fsf = FALSE; self->bsf = FALSE; self->fsr = FALSE; self->bsr = FALSE; self->eom = FALSE; self->leom = FALSE; self->bsf_after_eom = FALSE; g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(d_self, PROPERTY_BROKEN_GMT_ONLINE, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_FSF, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_FSF_AFTER_FILEMARK, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_BSF, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_FSR, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_BSR, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_EOM, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_LEOM, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_BSF_AFTER_EOM, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); #ifdef DEFAULT_TAPE_NON_BLOCKING_OPEN self->nonblocking_open = TRUE; #else self->nonblocking_open = FALSE; #endif g_value_set_boolean(&response, self->nonblocking_open); device_set_simple_property(d_self, PROPERTY_NONBLOCKING_OPEN, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->final_filemarks = 2; g_value_init(&response, G_TYPE_UINT); g_value_set_uint(&response, self->final_filemarks); device_set_simple_property(d_self, PROPERTY_FINAL_FILEMARKS, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->private->read_block_size = 0; g_value_init(&response, G_TYPE_UINT); g_value_set_uint(&response, self->private->read_block_size); device_set_simple_property(d_self, PROPERTY_READ_BLOCK_SIZE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); self->private->write_count = 0; self->private->device_filename = NULL; /* Static properites */ g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_EXCLUSIVE); device_set_simple_property(d_self, PROPERTY_CONCURRENCY, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_DESIRED); device_set_simple_property(d_self, PROPERTY_STREAMING, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); device_set_simple_property(d_self, PROPERTY_APPENDABLE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(d_self, PROPERTY_PARTIAL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); device_set_simple_property(d_self, PROPERTY_FULL_DELETION, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); device_set_simple_property(d_self, PROPERTY_MEDIUM_ACCESS_TYPE, &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); } static void tape_device_finalize(GObject * obj_self) { TapeDevice * self = TAPE_DEVICE(obj_self); if(G_OBJECT_CLASS(parent_class)->finalize) \ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); robust_close(self->fd); self->fd = -1; amfree(self->private->device_filename); amfree(self->private); } static void tape_device_class_init (TapeDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; GObjectClass *g_object_class = (GObjectClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->open_device = tape_device_open_device; device_class->read_label = tape_device_read_label; device_class->write_block = tape_device_write_block; device_class->read_block = tape_device_read_block; device_class->start = tape_device_start; device_class->start_file = tape_device_start_file; device_class->finish_file = tape_device_finish_file; device_class->seek_file = tape_device_seek_file; device_class->seek_block = tape_device_seek_block; device_class->eject = tape_device_eject; device_class->finish = tape_device_finish; g_object_class->finalize = tape_device_finalize; } static void tape_device_base_init (TapeDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; device_class_register_property(device_class, PROPERTY_BROKEN_GMT_ONLINE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_FSF, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_FSF_AFTER_FILEMARK, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_BSF, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_FSR, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_BSR, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_EOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_BSF_AFTER_EOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_NONBLOCKING_OPEN, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); device_class_register_property(device_class, PROPERTY_FINAL_FILEMARKS, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_final_filemarks_fn); /* We don't (yet?) support reading the device's compression state, so not * gettable. */ device_class_register_property(device_class, PROPERTY_COMPRESSION, PROPERTY_ACCESS_SET_MASK, NULL, tape_device_set_compression_fn); device_class_register_property(device_class, PROPERTY_READ_BLOCK_SIZE, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, tape_device_get_read_block_size_fn, tape_device_set_read_block_size_fn); device_class_register_property(device_class, device_property_read_buffer_size.ID, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, tape_device_get_read_block_size_fn, tape_device_set_read_block_size_fn); /* add the ability to set LEOM to FALSE, for testing purposes */ device_class_register_property(device_class, PROPERTY_LEOM, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, tape_device_set_feature_property_fn); } static gboolean tape_device_set_feature_property_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { TapeDevice *self = TAPE_DEVICE(p_self); GValue old_val; gboolean old_bool, new_bool; PropertySurety old_surety; PropertySource old_source; new_bool = g_value_get_boolean(val); /* get the old source and surety and see if we're willing to make this change */ bzero(&old_val, sizeof(old_val)); if (device_get_simple_property(p_self, base->ID, &old_val, &old_surety, &old_source)) { old_bool = g_value_get_boolean(&old_val); if (old_surety == PROPERTY_SURETY_GOOD && old_source == PROPERTY_SOURCE_DETECTED) { if (new_bool != old_bool) { device_set_error(p_self, vstrallocf(_( "Value for property '%s' was autodetected and cannot be changed"), base->name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else { /* pretend we set it, but don't change surety/source */ return TRUE; } } } /* (note: PROPERTY_* are not constants, so we can't use switch) */ if (base->ID == PROPERTY_BROKEN_GMT_ONLINE) self->broken_gmt_online = new_bool; else if (base->ID == PROPERTY_FSF) self->fsf = new_bool; else if (base->ID == PROPERTY_FSF_AFTER_FILEMARK) self->fsf_after_filemark = new_bool; else if (base->ID == PROPERTY_BSF) self->bsf = new_bool; else if (base->ID == PROPERTY_FSR) self->fsr = new_bool; else if (base->ID == PROPERTY_BSR) self->bsr = new_bool; else if (base->ID == PROPERTY_EOM) self->eom = new_bool; else if (base->ID == PROPERTY_BSF_AFTER_EOM) self->bsf_after_eom = new_bool; else if (base->ID == PROPERTY_NONBLOCKING_OPEN) self->nonblocking_open = new_bool; else if (base->ID == PROPERTY_LEOM) self->leom = new_bool; else return FALSE; /* shouldn't happen */ return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean tape_device_set_final_filemarks_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { TapeDevice *self = TAPE_DEVICE(p_self); GValue old_val; gboolean old_int, new_int; PropertySurety old_surety; PropertySource old_source; new_int = g_value_get_uint(val); /* get the old source and surety and see if we're willing to make this change */ bzero(&old_val, sizeof(old_val)); if (device_get_simple_property(p_self, base->ID, &old_val, &old_surety, &old_source)) { old_int = g_value_get_uint(&old_val); if (old_surety == PROPERTY_SURETY_GOOD && old_source == PROPERTY_SOURCE_DETECTED) { if (new_int != old_int) { device_set_error(p_self, vstrallocf(_( "Value for property '%s' was autodetected and cannot be changed"), base->name), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else { /* pretend we set it, but don't change surety/source */ return TRUE; } } } self->final_filemarks = new_int; return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean tape_device_set_compression_fn(Device *p_self, DevicePropertyBase *base, GValue *val, PropertySurety surety, PropertySource source) { TapeDevice *self = TAPE_DEVICE(p_self); gboolean request = g_value_get_boolean(val); /* We allow this property to be set at any time. This is mostly * because setting compression is a hit-and-miss proposition * at any time; some drives accept the mode setting but don't * actually support compression, while others do support * compression but do it via density settings or some other * way. Set this property whenever you want, but all we'll do * is report whether or not the ioctl succeeded. */ if (tape_setcompression(self->fd, request)) { /* looks good .. let's start the device over, though */ device_clear_volume_details(p_self); } else { device_set_error(p_self, g_strdup("Error setting COMPRESION property"), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } return device_simple_property_set_fn(p_self, base, val, surety, source); } static gboolean tape_device_get_read_block_size_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety *surety, PropertySource *source) { /* use the READ_BLOCK_SIZE, even if we're invoked to get the old READ_BUFFER_SIZE */ return device_simple_property_get_fn(p_self, &device_property_read_block_size, val, surety, source); } static gboolean tape_device_set_read_block_size_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, PropertySurety surety, PropertySource source) { TapeDevice *self = TAPE_DEVICE(p_self); guint read_block_size = g_value_get_uint(val); if (read_block_size != 0 && ((gsize)read_block_size < p_self->block_size || (gsize)read_block_size > p_self->max_block_size)) { device_set_error(p_self, g_strdup_printf("Error setting READ-BLOCk-SIZE property to '%u', it must be between %zu and %zu", read_block_size, p_self->block_size, p_self->max_block_size), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } self->private->read_block_size = read_block_size; /* use the READ_BLOCK_SIZE, even if we're invoked to get the old READ_BUFFER_SIZE */ return device_simple_property_set_fn(p_self, &device_property_read_block_size, val, surety, source); } void tape_device_register(void) { static const char * device_prefix_list[] = { "tape", NULL }; /* First register tape-specific properties */ device_property_fill_and_register(&device_property_broken_gmt_online, G_TYPE_BOOLEAN, "broken_gmt_online", "Does this drive support the GMT_ONLINE macro?"); device_property_fill_and_register(&device_property_fsf, G_TYPE_BOOLEAN, "fsf", "Does this drive support the MTFSF command?"); device_property_fill_and_register(&device_property_fsf_after_filemark, G_TYPE_BOOLEAN, "fsf_after_filemark", "Does this drive needs a FSF if a filemark is already read?"); device_property_fill_and_register(&device_property_bsf, G_TYPE_BOOLEAN, "bsf", "Does this drive support the MTBSF command?" ); device_property_fill_and_register(&device_property_fsr, G_TYPE_BOOLEAN, "fsr", "Does this drive support the MTFSR command?"); device_property_fill_and_register(&device_property_bsr, G_TYPE_BOOLEAN, "bsr", "Does this drive support the MTBSR command?"); device_property_fill_and_register(&device_property_eom, G_TYPE_BOOLEAN, "eom", "Does this drive support the MTEOM command?"); device_property_fill_and_register(&device_property_bsf_after_eom, G_TYPE_BOOLEAN, "bsf_after_eom", "Does this drive require an MTBSF after MTEOM in order to append?" ); device_property_fill_and_register(&device_property_nonblocking_open, G_TYPE_BOOLEAN, "nonblocking_open", "Does this drive require a open with O_NONBLOCK?" ); device_property_fill_and_register(&device_property_final_filemarks, G_TYPE_UINT, "final_filemarks", "How many filemarks to write after the last tape file?" ); device_property_fill_and_register(&device_property_read_buffer_size, G_TYPE_UINT, "read_buffer_size", "(deprecated name for READ_BLOCK_SIZE)"); /* Then the device itself */ register_device(tape_device_factory, device_prefix_list); } /* Open the tape device, trying various combinations of O_RDWR and O_NONBLOCK. Returns -1 and calls device_set_error for errors On Linux, with O_NONBLOCK, the kernel just checks the state once, whereas it checks it every second for ST_BLOCK_SECONDS if O_NONBLOCK is not given. Amanda already have the code to poll, we want open to check the state only once. */ static int try_open_tape_device(TapeDevice * self, char * device_filename) { int fd; int save_errno; DeviceStatusFlags new_status; guint64 tape_blocksize; #ifdef O_NONBLOCK int nonblocking = 0; if (self->nonblocking_open) { nonblocking = O_NONBLOCK; } #endif #ifdef O_NONBLOCK fd = robust_open(device_filename, O_RDWR | nonblocking, 0); save_errno = errno; if (fd < 0 && nonblocking && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) { /* Maybe we don't support O_NONBLOCK for tape devices. */ fd = robust_open(device_filename, O_RDWR, 0); save_errno = errno; } #else fd = robust_open(device_filename, O_RDWR, 0); save_errno = errno; #endif if (fd >= 0) { self->write_open_errno = 0; } else { if (errno == EACCES || errno == EPERM #ifdef EROFS || errno == EROFS #endif ) { /* Device is write-protected. */ self->write_open_errno = errno; #ifdef O_NONBLOCK fd = robust_open(device_filename, O_RDONLY | nonblocking, 0); save_errno = errno; if (fd < 0 && nonblocking && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) { fd = robust_open(device_filename, O_RDONLY, 0); save_errno = errno; } #else fd = robust_open(device_filename, O_RDONLY, 0); save_errno = errno; #endif } } #ifdef O_NONBLOCK /* Clear O_NONBLOCK for operations from now on. */ if (fd >= 0 && nonblocking) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); errno = save_errno; /* function continues after #endif */ #endif /* O_NONBLOCK */ if (fd < 0) { DeviceStatusFlags status_flag = 0; if (errno == EBUSY) status_flag = DEVICE_STATUS_DEVICE_BUSY; else status_flag = DEVICE_STATUS_DEVICE_ERROR; device_set_error(DEVICE(self), vstrallocf(_("Can't open tape device %s: %s"), self->private->device_filename, strerror(errno)), status_flag); return -1; } /* Check that this is actually a tape device. */ new_status = tape_is_tape_device(fd); if (new_status & DEVICE_STATUS_DEVICE_ERROR) { device_set_error(DEVICE(self), vstrallocf(_("File %s is not a tape device"), self->private->device_filename), new_status); robust_close(fd); return -1; } if (new_status & DEVICE_STATUS_VOLUME_MISSING) { device_set_error(DEVICE(self), vstrallocf(_("Tape device %s is not ready or is empty"), self->private->device_filename), new_status); robust_close(fd); return -1; } new_status = tape_is_ready(fd, self); if (new_status & DEVICE_STATUS_VOLUME_MISSING) { device_set_error(DEVICE(self), vstrallocf(_("Tape device %s is empty"), self->private->device_filename), new_status); robust_close(fd); return -1; } if (new_status != DEVICE_STATUS_SUCCESS) { device_set_error(DEVICE(self), vstrallocf(_("Tape device %s is not ready or is empty"), self->private->device_filename), new_status); robust_close(fd); return -1; } new_status = get_tape_blocksize(fd, &tape_blocksize); if (new_status != DEVICE_STATUS_SUCCESS) { device_set_error(DEVICE(self), g_strdup_printf(_("Can't get the blocksize of the device %s"), self->private->device_filename), new_status); robust_close(fd); return -1; } if (tape_blocksize > 0 && tape_blocksize != tape_device_read_size(self)) { device_set_error(DEVICE(self), g_strdup_printf(_("Device %s use fixed block size of %lld and tapetype use %lld"), self->private->device_filename, (long long)tape_blocksize, (long long)tape_device_read_size(self)), DEVICE_STATUS_VOLUME_ERROR|DEVICE_STATUS_DEVICE_ERROR); robust_close(fd); return -1; } if (tape_blocksize == 0) { g_debug("Device is in variable block size"); } else { g_debug("Device is in fixed block size of %lld", (long long)tape_blocksize); } return fd; } static void tape_device_open_device (Device * dself, char * device_name, char * device_type, char * device_node) { TapeDevice * self; GValue val; self = TAPE_DEVICE(dself); self->fd = -1; self->private->device_filename = stralloc(device_node); /* Set tape drive/OS info */ bzero(&val, sizeof(val)); g_value_init(&val, G_TYPE_BOOLEAN); self->fsf = TRUE; g_value_set_boolean(&val, self->fsf); device_set_simple_property(dself, PROPERTY_FSF, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->fsf_after_filemark = DEFAULT_FSF_AFTER_FILEMARK; g_value_set_boolean(&val, self->fsf_after_filemark); device_set_simple_property(dself, PROPERTY_FSF_AFTER_FILEMARK, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->bsf = TRUE; g_value_set_boolean(&val, self->bsf); device_set_simple_property(dself, PROPERTY_BSF, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->fsr = TRUE; g_value_set_boolean(&val, self->fsr); device_set_simple_property(dself, PROPERTY_FSR, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->bsr = TRUE; g_value_set_boolean(&val, self->bsr); device_set_simple_property(dself, PROPERTY_BSR, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->eom = TRUE; g_value_set_boolean(&val, self->eom); device_set_simple_property(dself, PROPERTY_EOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->leom = FALSE; g_value_set_boolean(&val, self->leom); device_set_simple_property(dself, PROPERTY_LEOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); self->bsf_after_eom = FALSE; g_value_set_boolean(&val, self->bsf_after_eom); device_set_simple_property(dself, PROPERTY_BSF_AFTER_EOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&val); g_value_init(&val, G_TYPE_UINT); self->final_filemarks = 2; g_value_set_uint(&val, self->final_filemarks); device_set_simple_property(dself, PROPERTY_FINAL_FILEMARKS, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&val); /* Chain up */ if (parent_class->open_device) { parent_class->open_device(dself, device_name, device_type, device_node); } } static DeviceStatusFlags tape_device_read_label(Device * dself) { TapeDevice * self; char * header_buffer; int buffer_len; IoResult result; dumpfile_t *header; DeviceStatusFlags new_status; char *msg = NULL; self = TAPE_DEVICE(dself); amfree(dself->volume_label); amfree(dself->volume_time); dumpfile_free(dself->volume_header); dself->volume_header = NULL; if (device_in_error(self)) return dself->status; if (self->fd == -1) { self->fd = try_open_tape_device(self, self->private->device_filename); /* if the open failed, then try_open_tape_device already set the * approppriate error status */ if (self->fd == -1) return dself->status; } /* Rewind it. */ if (!tape_rewind(self->fd)) { device_set_error(dself, vstrallocf(_("Error rewinding device %s to read label: %s"), self->private->device_filename, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return dself->status; } buffer_len = tape_device_read_size(self); header_buffer = g_try_malloc(buffer_len); if (header_buffer == NULL) { device_set_error(dself, g_strdup(_("Failed to allocate memory")), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return dself->status; } result = tape_device_robust_read(self, header_buffer, &buffer_len, &msg); if (result != RESULT_SUCCESS) { free(header_buffer); tape_rewind(self->fd); /* I/O error. */ switch (result) { case RESULT_NO_DATA: msg = stralloc(_("no data")); new_status = (DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_VOLUME_UNLABELED); header = dself->volume_header = g_new(dumpfile_t, 1); fh_init(header); break; case RESULT_SMALL_BUFFER: msg = stralloc(_("block size too small")); new_status = (DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); header = dself->volume_header = g_new(dumpfile_t, 1); fh_init(header); header->type = F_WEIRD; break; default: msg = stralloc(_("unknown error")); case RESULT_ERROR: new_status = (DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_VOLUME_UNLABELED); break; } device_set_error(dself, g_strdup_printf(_("Error reading Amanda header: %s"), msg? msg : _("unknown error")), new_status); amfree(msg); return dself->status; } if (buffer_len < 32768) { device_set_error(dself, g_strdup_printf(_("header is too small: %d bytes"), buffer_len), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); free(header_buffer); return dself->status; } dself->header_block_size = buffer_len; header = dself->volume_header = g_new(dumpfile_t, 1); fh_init(header); parse_file_header(header_buffer, header, buffer_len); amfree(header_buffer); if (header->type != F_TAPESTART) { device_set_error(dself, stralloc(_("No tapestart header -- unlabeled device?")), DEVICE_STATUS_VOLUME_UNLABELED); return dself->status; } dself->volume_label = g_strdup(header->name); dself->volume_time = g_strdup(header->datestamp); /* dself->volume_header is already set */ device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); return dself->status; } static gboolean tape_device_write_block(Device * pself, guint size, gpointer data) { TapeDevice * self; char *replacement_buffer = NULL; IoResult result; char *msg = NULL; self = TAPE_DEVICE(pself); g_assert(self->fd >= 0); if (device_in_error(self)) return FALSE; /* zero out to the end of a short block -- tape devices only write * whole blocks. */ if (size < pself->block_size) { replacement_buffer = g_try_malloc(pself->block_size); if (replacement_buffer == NULL) { device_set_error(pself, g_strdup(_("failed to allocate memory")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } memcpy(replacement_buffer, data, size); bzero(replacement_buffer+size, pself->block_size-size); data = replacement_buffer; size = pself->block_size; } result = tape_device_robust_write(self, data, size, &msg); amfree(replacement_buffer); switch (result) { case RESULT_SUCCESS: break; case RESULT_NO_SPACE: device_set_error(pself, stralloc(_("No space left on device")), DEVICE_STATUS_VOLUME_ERROR); pself->is_eom = TRUE; return FALSE; default: msg = stralloc(_("unknown error")); case RESULT_ERROR: device_set_error(pself, g_strdup_printf(_("Error writing block: %s"), msg), DEVICE_STATUS_DEVICE_ERROR); amfree(msg); return FALSE; } pself->block++; g_mutex_lock(pself->device_mutex); pself->bytes_written += size; g_mutex_unlock(pself->device_mutex); return TRUE; } static int tape_device_read_block (Device * pself, gpointer buf, int * size_req) { TapeDevice * self; int size; IoResult result; gssize read_block_size = tape_device_read_size(pself); char *msg = NULL; self = TAPE_DEVICE(pself); g_assert(self->fd >= 0); if (device_in_error(self)) return -1; g_assert(read_block_size < INT_MAX); /* data type mismatch */ if (buf == NULL || *size_req < (int)read_block_size) { /* Just a size query. */ *size_req = (int)read_block_size; return 0; } size = *size_req; result = tape_device_robust_read(self, buf, &size, &msg); switch (result) { case RESULT_SUCCESS: *size_req = size; pself->block++; g_mutex_lock(pself->device_mutex); pself->bytes_read += size; g_mutex_unlock(pself->device_mutex); return size; case RESULT_SMALL_BUFFER: { gsize new_size; GValue newval; /* If this happens, it means that we have: * (next block size) > (buffer size) >= (read_block_size) * The solution is to ask for an even bigger buffer. We also play * some games to refrain from reading above the SCSI limit or from * integer overflow. Note that not all devices will tell us about * this problem -- some will just discard the "extra" data. */ new_size = MIN(INT_MAX/2 - 1, *size_req) * 2; if (new_size > LARGEST_BLOCK_ESTIMATE && *size_req < LARGEST_BLOCK_ESTIMATE) { new_size = LARGEST_BLOCK_ESTIMATE; } g_assert (new_size > (gsize)*size_req); g_info("Device %s indicated blocksize %zd was too small; using %zd.", pself->device_name, (gsize)*size_req, new_size); *size_req = (int)new_size; self->private->read_block_size = new_size; bzero(&newval, sizeof(newval)); g_value_init(&newval, G_TYPE_UINT); g_value_set_uint(&newval, self->private->read_block_size); device_set_simple_property(pself, PROPERTY_READ_BLOCK_SIZE, &newval, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&newval); return 0; } case RESULT_NO_DATA: pself->is_eof = TRUE; g_mutex_lock(pself->device_mutex); pself->in_file = FALSE; g_mutex_unlock(pself->device_mutex); device_set_error(pself, stralloc(_("EOF")), DEVICE_STATUS_SUCCESS); return -1; default: msg = stralloc(_("unknown error")); case RESULT_ERROR: device_set_error(pself, vstrallocf(_("Error reading from tape device: %s"), msg), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); amfree(msg); return -1; } g_assert_not_reached(); } /* Just a helper function for tape_device_start(). */ static gboolean write_tapestart_header(TapeDevice * self, char * label, char * timestamp) { IoResult result; dumpfile_t * header; char * header_buf; Device * d_self = (Device*)self; char *msg = NULL; tape_rewind(self->fd); header = make_tapestart_header(d_self, label, timestamp); g_assert(header != NULL); header_buf = device_build_amanda_header(d_self, header, NULL); if (header_buf == NULL) { device_set_error(d_self, stralloc(_("Tapestart header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); dumpfile_free(header); return FALSE; } dumpfile_free(d_self->volume_header); d_self->volume_header = NULL; result = tape_device_robust_write(self, header_buf, d_self->block_size, &msg); if (result != RESULT_SUCCESS) { device_set_error(d_self, g_strdup_printf(_("Error writing tapestart header: %s"), (result == RESULT_ERROR)? msg : _("out of space")), DEVICE_STATUS_DEVICE_ERROR); if (result == RESULT_NO_SPACE) d_self->is_eom = TRUE; amfree(msg); dumpfile_free(header); amfree(header_buf); return FALSE; } d_self->header_block_size = d_self->block_size; amfree(header_buf); if (!tape_weof(self->fd, 1)) { device_set_error(d_self, vstrallocf(_("Error writing filemark: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_VOLUME_ERROR); /* can't tell if this was EOM or not, so assume it is */ d_self->is_eom = TRUE; dumpfile_free(header); return FALSE; } d_self->volume_header = header; return TRUE; } static gboolean tape_device_start (Device * d_self, DeviceAccessMode mode, char * label, char * timestamp) { TapeDevice * self; self = TAPE_DEVICE(d_self); if (device_in_error(self)) return FALSE; if (self->fd == -1) { self->fd = try_open_tape_device(self, self->private->device_filename); /* if the open failed, then try_open_tape_device already set the * approppriate error status */ if (self->fd == -1) return FALSE; } if (mode != ACCESS_WRITE && d_self->volume_label == NULL) { /* we need a labeled volume for APPEND and READ */ if (tape_device_read_label(d_self) != DEVICE_STATUS_SUCCESS) return FALSE; } d_self->access_mode = mode; g_mutex_lock(d_self->device_mutex); d_self->in_file = FALSE; g_mutex_unlock(d_self->device_mutex); if (IS_WRITABLE_ACCESS_MODE(mode)) { if (self->write_open_errno != 0) { /* We tried and failed to open the device in write mode. */ device_set_error(d_self, vstrallocf(_("Can't open tape device %s for writing: %s"), self->private->device_filename, strerror(self->write_open_errno)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } else if (!tape_rewind(self->fd)) { device_set_error(d_self, vstrallocf(_("Error rewinding device to start: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } /* Position the tape */ switch (mode) { case ACCESS_APPEND: if (d_self->volume_label == NULL && device_read_label(d_self) != DEVICE_STATUS_SUCCESS) { /* device_read_label already set our error message */ return FALSE; } if (!tape_device_eod(self)) { device_set_error(d_self, vstrallocf(_("Couldn't seek to end of tape: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } break; case ACCESS_READ: if (d_self->volume_label == NULL && device_read_label(d_self) != DEVICE_STATUS_SUCCESS) { /* device_read_label already set our error message */ return FALSE; } if (!tape_rewind(self->fd)) { device_set_error(d_self, vstrallocf(_("Error rewinding device after reading label: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } d_self->file = 0; break; case ACCESS_WRITE: if (!write_tapestart_header(self, label, timestamp)) { /* write_tapestart_header already set the error status */ return FALSE; } d_self->volume_label = newstralloc(d_self->volume_label, label); d_self->volume_time = newstralloc(d_self->volume_time, timestamp); /* unset the VOLUME_UNLABELED flag, if it was set */ device_set_error(d_self, NULL, DEVICE_STATUS_SUCCESS); d_self->file = 0; break; default: g_assert_not_reached(); } return TRUE; } static gboolean tape_device_start_file(Device * d_self, dumpfile_t * info) { TapeDevice * self; IoResult result; char * amanda_header; char *msg = NULL; self = TAPE_DEVICE(d_self); g_assert(self->fd >= 0); if (device_in_error(self)) return FALSE; /* set the blocksize in the header properly */ info->blocksize = d_self->block_size; /* Make the Amanda header suitable for writing to the device. */ /* Then write the damn thing. */ amanda_header = device_build_amanda_header(d_self, info, NULL); if (amanda_header == NULL) { device_set_error(d_self, stralloc(_("Amanda file header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } result = tape_device_robust_write(self, amanda_header, d_self->block_size, &msg); if (result != RESULT_SUCCESS) { device_set_error(d_self, vstrallocf(_("Error writing file header: %s"), (result == RESULT_ERROR)? msg : _("out of space")), DEVICE_STATUS_DEVICE_ERROR); if (result == RESULT_NO_SPACE) d_self->is_eom = TRUE; amfree(amanda_header); amfree(msg); return FALSE; } amfree(amanda_header); /* arrange the file numbers correctly */ d_self->block = 0; if (d_self->file >= 0) d_self->file ++; g_mutex_lock(d_self->device_mutex); d_self->in_file = TRUE; d_self->bytes_written = 0; g_mutex_unlock(d_self->device_mutex); return TRUE; } static gboolean tape_device_finish_file (Device * d_self) { TapeDevice * self; self = TAPE_DEVICE(d_self); if (!d_self->in_file) return TRUE; g_mutex_lock(d_self->device_mutex); d_self->in_file = FALSE; g_mutex_unlock(d_self->device_mutex); if (device_in_error(d_self)) return FALSE; if (!tape_weof(self->fd, 1)) { device_set_error(d_self, vstrallocf(_("Error writing filemark: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); /* can't tell if this was EOM or not, so assume it is */ d_self->is_eom = TRUE; return FALSE; } return TRUE; } static dumpfile_t * tape_device_seek_file (Device * d_self, guint file) { TapeDevice * self; gint got_file; int difference; char * header_buffer; dumpfile_t * rval; int buffer_len; IoResult result; char *msg; self = TAPE_DEVICE(d_self); if (device_in_error(self)) return NULL; difference = file - d_self->file; /* Check if we already read a filemark. */ /* If we already read a filemark and the drive automaticaly goes to the next file, then we must reduce the difference by one. */ if (d_self->is_eof && !self->fsf_after_filemark) { difference --; } d_self->is_eof = FALSE; d_self->block = 0; g_mutex_lock(d_self->device_mutex); d_self->in_file = FALSE; d_self->bytes_read = 0; g_mutex_unlock(d_self->device_mutex); reseek: if (difference > 0) { /* Seeking forwards */ if (!tape_device_fsf(self, difference)) { tape_rewind(self->fd); device_set_error(d_self, vstrallocf(_("Could not seek forward to file %d"), file), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } } else { /* (difference <= 0) */ /* Seeking backwards, or to this file itself */ /* if the drive supports bsf, we can do this the fancy way */ if (self->bsf) { /* bsf one more than the difference */ if (!tape_bsf(self->fd, -difference + 1)) { tape_rewind(self->fd); device_set_error(d_self, vstrallocf(_("Could not seek backward to file %d"), file), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } /* now we are on the BOT side of the desired filemark, so FSF to get to the * EOT side of it */ if (!tape_device_fsf(self, 1)) { tape_rewind(self->fd); device_set_error(d_self, vstrallocf(_("Could not seek forward to file %d"), file), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } } else { /* no BSF, so just rewind and seek forward */ if (!tape_rewind(self->fd)) { device_set_error(d_self, vstrallocf(_("Could not rewind device while emulating BSF")), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return FALSE; } if (!tape_device_fsf(self, file)) { tape_rewind(self->fd); device_set_error(d_self, vstrallocf(_("Could not seek forward to file %d"), file), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } } } /* double-check that we're on the right fileno, if possible. This is most * likely a programming error if it occurs, but could also be due to a weird * tape drive or driver (and that would *never* happen, right?) */ got_file = tape_fileno(self->fd); if (got_file >= 0 && (guint)got_file != file) { device_set_error(d_self, vstrallocf(_("Could not seek to file %d correctly; got %d"), file, got_file), DEVICE_STATUS_DEVICE_ERROR); d_self->file = (guint)got_file; return NULL; } buffer_len = tape_device_read_size(d_self); header_buffer = g_try_malloc(buffer_len); if (header_buffer == NULL) { device_set_error(d_self, g_strdup(_("failed to allocate memory")), DEVICE_STATUS_DEVICE_ERROR); return NULL; } d_self->is_eof = FALSE; result = tape_device_robust_read(self, header_buffer, &buffer_len, &msg); if (result != RESULT_SUCCESS) { free(header_buffer); tape_rewind(self->fd); switch (result) { case RESULT_NO_DATA: /* If we read 0 bytes, that means we encountered a double * filemark, which indicates end of tape. This should * work even with QIC tapes on operating systems with * proper support. */ d_self->file = file; /* other attributes are already correct */ return make_tapeend_header(); case RESULT_SMALL_BUFFER: msg = stralloc(_("block size too small")); break; default: msg = stralloc(_("unknown error")); case RESULT_ERROR: break; } device_set_error(d_self, g_strdup_printf(_("Error reading Amanda header: %s"), msg), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); amfree(msg); return NULL; } if (buffer_len < 32768) { device_set_error(d_self, g_strdup_printf(_("header is too small: %d bytes"), buffer_len), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); free(header_buffer); return NULL; } rval = g_new(dumpfile_t, 1); parse_file_header(header_buffer, rval, buffer_len); amfree(header_buffer); switch (rval->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: break; case F_NOOP: /* a NOOP is written on QIC tapes to avoid writing two sequential * filemarks when closing a device in WRITE or APPEND mode. In this * case, we just seek to the next file. */ amfree(rval); file++; difference = 1; goto reseek; default: tape_rewind(self->fd); device_set_error(d_self, stralloc(_("Invalid amanda header while reading file header")), DEVICE_STATUS_VOLUME_ERROR); amfree(rval); return NULL; } g_mutex_lock(d_self->device_mutex); d_self->in_file = TRUE; g_mutex_unlock(d_self->device_mutex); d_self->file = file; return rval; } static gboolean tape_device_seek_block (Device * d_self, guint64 block) { TapeDevice * self; int difference; self = TAPE_DEVICE(d_self); if (device_in_error(self)) return FALSE; difference = block - d_self->block; if (difference > 0) { if (!tape_device_fsr(self, difference)) { device_set_error(d_self, vstrallocf(_("Could not seek forward to block %ju: %s"), (uintmax_t)block, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } else if (difference < 0) { if (!tape_device_bsr(self, difference, d_self->file, d_self->block)) { device_set_error(d_self, vstrallocf(_("Could not seek backward to block %ju: %s"), (uintmax_t)block, strerror(errno)), DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } d_self->block = block; return TRUE; } static gboolean tape_device_eject (Device * d_self) { TapeDevice * self; self = TAPE_DEVICE(d_self); if (device_in_error(self)) return FALSE; /* Open the device if not already opened */ if (self->fd == -1) { self->fd = try_open_tape_device(self, self->private->device_filename); /* if the open failed, then try_open_tape_device already set the * approppriate error status */ if (self->fd == -1) return FALSE; } /* Rewind it. */ if (!tape_rewind(self->fd)) { device_set_error(d_self, vstrallocf(_("Error rewinding device %s before ejecting: %s"), self->private->device_filename, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } if (tape_offl(self->fd)) return TRUE; device_set_error(d_self, vstrallocf(_("Error ejecting device %s: %s\n"), self->private->device_filename, strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); return FALSE; } static gboolean tape_device_finish (Device * d_self) { TapeDevice * self; char *msg = NULL; self = TAPE_DEVICE(d_self); if (device_in_error(self)) goto finish_error; /* if we're already in ACCESS_NULL, then there are no filemarks or anything * to worry about, but we need to release the kernel device */ if (d_self->access_mode == ACCESS_NULL) { robust_close(self->fd); self->fd = -1; return TRUE; } /* Polish off this file, if relevant. */ g_mutex_lock(d_self->device_mutex); if (d_self->in_file && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { g_mutex_unlock(d_self->device_mutex); if (!device_finish_file(d_self)) { goto finish_error; } } else { g_mutex_unlock(d_self->device_mutex); } /* Straighten out the filemarks. We already wrote one in finish_file, and * the device driver will write another filemark when we rewind. This means * that, if we do nothing, we'll get two filemarks. If final_filemarks is * 1, this would be wrong, so in this case we insert a F_NOOP header between * the two filemarks. */ if (self->final_filemarks == 1 && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { dumpfile_t file; char *header; int result; /* write a F_NOOP header */ fh_init(&file); file.type = F_NOOP; header = device_build_amanda_header(d_self, &file, NULL); if (!header) { device_set_error(d_self, stralloc(_("Amanda file header won't fit in a single block!")), DEVICE_STATUS_DEVICE_ERROR); goto finish_error; } result = tape_device_robust_write(self, header, d_self->block_size, &msg); if (result != RESULT_SUCCESS) { device_set_error(d_self, vstrallocf(_("Error writing file header: %s"), (result == RESULT_ERROR)? msg : _("out of space")), DEVICE_STATUS_DEVICE_ERROR); amfree(header); amfree(msg); goto finish_error; } amfree(header); } /* Rewind (the kernel will write a filemark first) */ if (!tape_rewind(self->fd)) { device_set_error(d_self, vstrallocf(_("Couldn't rewind device to finish: %s"), strerror(errno)), DEVICE_STATUS_DEVICE_ERROR); goto finish_error; } d_self->is_eof = FALSE; d_self->access_mode = ACCESS_NULL; /* release the kernel's device */ robust_close(self->fd); self->fd = -1; return TRUE; finish_error: d_self->access_mode = ACCESS_NULL; /* release the kernel's device */ robust_close(self->fd); self->fd = -1; return FALSE; } /* Works just like read(), except for the following: * 1) Retries on EINTR & friends. * 2) Stores count in parameter, not return value. * 3) Provides explicit return result. * *errmsg is only set on RESULT_ERROR. */ static IoResult tape_device_robust_read (TapeDevice * self, void * buf, int * count, char **errmsg) { Device * d_self; int result; d_self = (Device*)self; /* Callers should ensure this. */ g_assert(*count >= 0); for (;;) { result = read(self->fd, buf, *count); if (result > 0) { /* Success. By definition, we read a full block. */ d_self->is_eof = FALSE; *count = result; return RESULT_SUCCESS; } else if (result == 0) { d_self->is_eof = TRUE; return RESULT_NO_DATA; } else { if (0 #ifdef EAGAIN || errno == EAGAIN #endif #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif #ifdef EINTR || errno == EINTR #endif ) { /* Interrupted system call */ continue; } else if ((0 #ifdef ENOMEM || errno == ENOMEM /* bad user-space buffer */ #endif #ifdef EOVERFLOW || errno == EOVERFLOW /* bad kernel-space buffer */ #endif #ifdef EINVAL || errno == EINVAL /* ??? */ #endif )) { /* Buffer too small. */ g_warning("Buffer is too small (%d bytes) from %s: %s", *count, self->private->device_filename, strerror(errno)); return RESULT_SMALL_BUFFER; } else { *errmsg = g_strdup_printf(_("Error reading %d bytes from %s: %s"), *count, self->private->device_filename, strerror(errno)); return RESULT_ERROR; } } } g_assert_not_reached(); } /* Kernel workaround: If needed, poke the kernel so it doesn't fail. at the 2GB boundry. Parameters are G_GNUC_UNUSED in case NEED_RESETOFS is not defined. */ static void check_resetofs(TapeDevice * self G_GNUC_UNUSED, int count G_GNUC_UNUSED) { #ifdef NEED_RESETOFS Device * d_self; int result; d_self = (Device*)self; self->private->write_count += count; if (self->private->write_count < RESETOFS_THRESHOLD) { return; } result = lseek(self->fd, 0, SEEK_SET); if (result < 0) { g_warning(_("lseek() failed during kernel 2GB workaround: %s"), strerror(errno)); } #endif } /* *errmsg is only set on RESULT_ERROR */ static IoResult tape_device_robust_write (TapeDevice * self, void * buf, int count, char **errmsg) { Device * d_self; int result; gboolean retry = FALSE; d_self = (Device*)self; check_resetofs(self, count); for (;;) { result = write(self->fd, buf, count); /* Success. */ if (result == count) return RESULT_SUCCESS; if (result > 0) { /* write() returned a short count. This should not happen if the block sizes * are properly aligned. */ *errmsg = g_strdup_printf("Short write on tape device: Tried %d, got %d. Is " "the drive using a block size smaller than %d bytes?", count, result, count); return RESULT_ERROR; } /* Detect LEOM (early warning) and handle properly * * FreeBSD: 0-length write; next write will succeed * http://lists.freebsd.org/pipermail/freebsd-scsi/2010-June/004414.html * * Solaris: 0-length write; next write will succeed * (from Matthew Jacob on FreeBSD thread) * * Linux: -1/ENOSPC; next write will succeed * http://www.mjmwired.net/kernel/Documentation/scsi/st.txt * * HP/UX: -1/ENOSPC; next write will succeed * http://www.adssasia.com/Manual/IBM%203581%20tape%20autoloader.pdf */ if (result == 0 #ifdef ENOSPC || (result < 0 && errno == ENOSPC) #endif ) { /* if we've retried once already, then we're probably really out of space */ if (retry || !self->leom) return RESULT_NO_SPACE; retry = TRUE; d_self->is_eom = TRUE; g_debug("empty write to tape; treating as LEOM early warning and retrying"); continue; } /* at this point result < 0, so an error occurred - sort out what */ if (0 #ifdef EAGAIN || errno == EAGAIN #endif #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif #ifdef EINTR || errno == EINTR #endif ) { /* Interrupted system call */ continue; } else if (0 #ifdef ENOSPC || errno == ENOSPC #endif #ifdef EIO || errno == EIO #endif ) { /* Probably EOT. Print a message if we got EIO. */ #ifdef EIO if (errno == EIO) { g_warning(_("Got EIO on %s, assuming end of tape"), self->private->device_filename); } #endif return RESULT_NO_SPACE; } else { /* WTF */ *errmsg = vstrallocf(_("Kernel gave unexpected write() result of \"%s\" on device %s"), strerror(errno), self->private->device_filename); return RESULT_ERROR; } } g_assert_not_reached(); } /* Reads some number of tape blocks into the bit-bucket. If the count is negative, then we read the rest of the entire file. Returns the number of blocks read, or -1 if an error occured. If we encounter EOF (as opposed to some other error) we return the number of blocks actually read. */ static int drain_tape_blocks(TapeDevice * self, int count) { char * buffer; gsize buffer_size; int i; buffer_size = tape_device_read_size(self); buffer = malloc(buffer_size); for (i = 0; i < count || count < 0;) { int result; result = read(self->fd, buffer, buffer_size); if (result > 0) { i ++; continue; } else if (result == 0) { amfree(buffer); return i; } else { /* First check for interrupted system call. */ if (0 #ifdef EAGAIN || errno == EAGAIN #endif #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif #ifdef EINTR || errno == EINTR #endif ) { /* Interrupted system call */ continue; } else if (0 #ifdef ENOSPC || errno == ENOSPC /* bad user-space buffer */ #endif #ifdef EOVERFLOW || errno == EOVERFLOW /* bad kernel-space buffer */ #endif #ifdef EINVAL || errno == EINVAL /* ??? */ #endif ) { /* The buffer may not be big enough. But the OS is not 100% clear. We double the buffer and try again, but in no case allow a buffer bigger than 32 MB. */ buffer_size *= 2; if (buffer_size > 32*1024*1024) { amfree(buffer); return -1; } else { buffer = realloc(buffer, buffer_size); continue; } } } } amfree(buffer); return count; } static gboolean tape_device_fsf (TapeDevice * self, guint count) { if (self->fsf) { return tape_fsf(self->fd, count); } else { guint i; for (i = 0; i < count; i ++) { if (drain_tape_blocks(self, -1) < 0) return FALSE; } return TRUE; } } static gboolean tape_device_fsr (TapeDevice * self, guint count) { if (self->fsr) { return tape_fsr(self->fd, count); } else { int result = drain_tape_blocks(self, count); return result > 0 && (int)count == result; } } /* Seek back the given number of blocks to block number block within * the current file, numbered file. */ static gboolean tape_device_bsr (TapeDevice * self, guint count, guint file, guint block) { if (self->bsr) { return tape_bsr(self->fd, count); } else if (self->bsf && self->fsf) { /* BSF, FSF to the right side of the filemark, and then FSR. */ if (!tape_bsf(self->fd, 1)) return FALSE; if (!tape_fsf(self->fd, 1)) return FALSE; return tape_device_fsr(self, block); } else { /* rewind, FSF, and FSR */ if (!tape_rewind(self->fd)) return FALSE; if (!tape_device_fsf(self, file)) return FALSE; return tape_device_fsr(self, block); } g_assert_not_reached(); } /* Go to the right place to write more data, and update the file number if possible. */ static gboolean tape_device_eod (TapeDevice * self) { Device * d_self; int count; d_self = (Device*)self; if (self->eom) { int result; result = tape_eod(self->fd); if (result == TAPE_OP_ERROR) { return FALSE; } else if (result != TAPE_POSITION_UNKNOWN) { /* great - we just fast-forwarded to EOD, but don't know where we are, so * now we have to rewind and drain all of that data. Warn the user so that * we can skip the fast-forward-rewind stage on the next run */ g_warning("Seek to end of tape does not give an accurate tape position; set " "the EOM property to 0 to avoid useless tape movement."); /* and set the property so that next time *this* object is opened for * append, we skip this stage */ self->eom = FALSE; /* fall through to draining blocks, below */ } else { /* We drop by 1 because Device will increment the first time the user does start_file. */ d_self->file = result - 1; return TRUE; } } if (!tape_rewind(self->fd)) return FALSE; count = 0; for (;;) { /* We alternately read a block and FSF. If the read is successful, then we are not there yet and should FSF again. */ int result; result = drain_tape_blocks(self, 1); if (result == 1) { /* More data, FSF. */ tape_device_fsf(self, 1); count ++; } else if (result == 0) { /* Finished. */ d_self->file = count - 1; return TRUE; } else { return FALSE; } } } static Device * tape_device_factory (char * device_name, char * device_type, char * device_node) { Device * rval; g_assert(0 == strcmp(device_type, "tape")); rval = DEVICE(g_object_new(TYPE_TAPE_DEVICE, NULL)); device_open_device(rval, device_name, device_type, device_node); return rval; } /* * Tape Operations using the POSIX interface */ /* Having one name for every operation would be too easy. */ #if !defined(MTCOMPRESSION) && defined(MTCOMP) # define MTCOMPRESSION MTCOMP #endif #if !defined(MTSETBLK) && defined(MTSETBSIZ) # define MTSETBLK MTSETBSIZ #endif #if !defined(MTEOM) && defined(MTEOD) # define MTEOM MTEOD #endif gboolean tape_rewind(int fd) { int count = 5; time_t stop_time; /* We will retry this for up to 30 seconds or 5 retries, whichever is less, because some hardware/software combinations (notably EXB-8200 on FreeBSD) can fail to rewind. */ stop_time = time(NULL) + 30; while (--count >= 0 && time(NULL) < stop_time) { struct mtop mt; mt.mt_op = MTREW; mt.mt_count = 1; if (0 == ioctl(fd, MTIOCTOP, &mt)) return TRUE; sleep(3); } return FALSE; } gboolean tape_fsf(int fd, guint count) { struct mtop mt; mt.mt_op = MTFSF; mt.mt_count = count; return 0 == ioctl(fd, MTIOCTOP, &mt); } gboolean tape_bsf(int fd, guint count) { struct mtop mt; mt.mt_op = MTBSF; mt.mt_count = count; return 0 == ioctl(fd, MTIOCTOP, &mt); } gboolean tape_fsr(int fd, guint count) { struct mtop mt; mt.mt_op = MTFSR; mt.mt_count = count; return 0 == ioctl(fd, MTIOCTOP, &mt); } gboolean tape_bsr(int fd, guint count) { struct mtop mt; mt.mt_op = MTBSR; mt.mt_count = count; return 0 == ioctl(fd, MTIOCTOP, &mt); } gint tape_fileno(int fd) { struct mtget get; if (0 != ioctl(fd, MTIOCGET, &get)) return TAPE_POSITION_UNKNOWN; if (get.mt_fileno < 0) return TAPE_POSITION_UNKNOWN; else return get.mt_fileno; } gint tape_eod(int fd) { struct mtop mt; struct mtget get; mt.mt_op = MTEOM; mt.mt_count = 1; if (0 != ioctl(fd, MTIOCTOP, &mt)) return TAPE_OP_ERROR; /* Ignored result. This is just to flush buffers. */ mt.mt_op = MTNOP; ioctl(fd, MTIOCTOP, &mt); if (0 != ioctl(fd, MTIOCGET, &get)) return TAPE_POSITION_UNKNOWN; if (get.mt_fileno < 0) return TAPE_POSITION_UNKNOWN; else return get.mt_fileno; } gboolean tape_weof(int fd, guint8 count) { struct mtop mt; mt.mt_op = MTWEOF; mt.mt_count = count; return 0 == ioctl(fd, MTIOCTOP, &mt); } gboolean tape_setcompression(int fd G_GNUC_UNUSED, gboolean on G_GNUC_UNUSED) { #ifdef MTCOMPRESSION struct mtop mt; mt.mt_op = MTCOMPRESSION; mt.mt_count = on; return 0 == ioctl(fd, MTIOCTOP, &mt); #else return 0; #endif } gboolean tape_offl(int fd) { struct mtop mt; int safe_errno; mt.mt_op = MTOFFL; mt.mt_count = 1; if (0 == ioctl(fd, MTIOCTOP, &mt)) return TRUE; safe_errno = errno; g_debug("tape_off: ioctl(MTIOCTOP/MTOFFL) failed: %s", strerror(errno)); errno = safe_errno; return FALSE; } DeviceStatusFlags tape_is_tape_device(int fd) { struct mtop mt; mt.mt_op = MTNOP; mt.mt_count = 1; if (0 == ioctl(fd, MTIOCTOP, &mt)) { return DEVICE_STATUS_SUCCESS; #ifdef ENOMEDIUM } else if (errno == ENOMEDIUM) { return DEVICE_STATUS_VOLUME_MISSING; #endif } else { g_debug("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s", strerror(errno)); if (errno == EIO) { /* some devices return EIO while the drive is busy loading */ return DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_DEVICE_BUSY; } else { return DEVICE_STATUS_DEVICE_ERROR; } } } DeviceStatusFlags get_tape_blocksize(int fd, guint64 *tape_blocksize) { struct mtget status; if (ioctl(fd, MTIOCGET, (char *)&status) < 0) { g_debug("get_tape_blocksize: ioctl(MTIOCGET) failed: %s", strerror(errno)); *tape_blocksize = -1; return DEVICE_STATUS_DEVICE_ERROR; } *tape_blocksize = 0; #if defined MT_ST_BLKSIZE_MASK && defined MT_ST_BLKSIZE_SHIFT if ( #ifdef MT_ISSCSI1 status.mt_type == MT_ISSCSI1 || #endif #ifdef MT_ISSCSI2 status.mt_type == MT_ISSCSI2 || #endif 0) { *tape_blocksize = ((status.mt_dsreg & MT_ST_BLKSIZE_MASK) >> MT_ST_BLKSIZE_SHIFT); } #endif return DEVICE_STATUS_SUCCESS; } DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self G_GNUC_UNUSED) { struct mtget get; if (0 == ioctl(fd, MTIOCGET, &get)) { #if defined(GMT_ONLINE) || defined(GMT_DR_OPEN) if (1 #ifdef GMT_ONLINE && (t_self->broken_gmt_online || GMT_ONLINE(get.mt_gstat)) #endif #ifdef GMT_DR_OPEN && !GMT_DR_OPEN(get.mt_gstat) #endif ) { return DEVICE_STATUS_SUCCESS; } else { return DEVICE_STATUS_VOLUME_MISSING; } #else /* Neither macro is defined. */ return DEVICE_STATUS_SUCCESS; #endif } else { return DEVICE_STATUS_VOLUME_ERROR; } } amanda-3.3.6/amplot/0000775000076400007640000000000012357750427015750 5ustar00martineamartinea00000000000000amanda-3.3.6/amplot/Makefile.in0000664000076400007640000020401612357750237020017 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for amplot. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = amplot ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(sbindir)" "$(DESTDIR)$(amplotdir)" SCRIPTS = $(sbin_SCRIPTS) 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 = $(amplot_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = amplot.awk amplot.g BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log amplot.gp.new # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ $(SCRIPTS_INCLUDE) $(am__append_1) amplot.gp MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done SCRIPTS_SHELL = amplot SCRIPTS_AWK = amcat.awk sbin_SCRIPTS = $(SCRIPTS_SHELL) amplotdir = $(amlibexecdir) amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu amplot/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu amplot/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; 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 \ 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)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-amplotDATA: $(amplot_DATA) @$(NORMAL_INSTALL) @list='$(amplot_DATA)'; test -n "$(amplotdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amplotdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amplotdir)" || 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)$(amplotdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(amplotdir)" || exit $$?; \ done uninstall-amplotDATA: @$(NORMAL_UNINSTALL) @list='$(amplot_DATA)'; test -n "$(amplotdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(amplotdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @SYNTAX_CHECKS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amplotdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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-amplotDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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-amplotDATA uninstall-sbinSCRIPTS .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip .PHONY: all all-am check check-am check-local clean clean-generic \ clean-libtool dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-amplotDATA install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-amplotDATA \ uninstall-sbinSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ @SYNTAX_CHECKS_TRUE@ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ @SYNTAX_CHECKS_TRUE@ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ @SYNTAX_CHECKS_TRUE@ rm $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ else \ @SYNTAX_CHECKS_TRUE@ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ @SYNTAX_CHECKS_TRUE@ fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-perl # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-shell # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< amplot.gp: amplot.g cat $(srcdir)/amplot.g > amplot.gp.new echo "pause -1;" >> amplot.gp.new rm -f amplot.gp mv amplot.gp.new amplot.gp # 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: amanda-3.3.6/amplot/amplot.g0000664000076400007640000000641012357250001017374 0ustar00martineamartinea00000000000000# # Amanda, The Advanced Maryland Automatic Network Disk Archiver # Copyright (c) 1992,1993.1994-1998 University of Maryland at College Park # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # All Rights Reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of U.M. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. U.M. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Author: Olafur Gudumundsson, (ogud@tis.com) Trusted Information Systems # Formerly at: Systems Design and Analysis Group # Computer Science Department # University of Maryland at College Park # # program to print the summary graph for the amanda runs in gnupot # gnumaster.awk will generate the data for this one # Creation Date July 1992 # Last modified: May 1993 # Input: the files specified below on the plot line # Output: a postscript file # set style data lines set xrange [0:210] set yrange [0:420] set xlabel "Minutes" #set xtics 0,10 set xtics ( \ "0:00" 0, "" 10, "0:20" 20, "" 30, "0:40" 40, "" 50,\ "1:00" 60, "" 70, "1:20" 80, "" 90, "1:40" 100, "" 110,\ "2:00" 120, "" 130, "2:20" 140, "" 150, "2:40" 160, "" 170,\ "3:00" 180, "" 190, "3:20" 200, "" 210, "3:40" 220, "" 230,\ "4:00" 240, "" 250, "4:20" 260, "" 270, "4:40" 280, "" 290,\ "5:00" 300, "" 310, "5:20" 320, "" 330, "5:40" 340, "" 350,\ "6:00" 360, "" 370, "6:20" 380, "" 390, "6:40" 400, "" 410,\ "7:00" 420, "" 430, "7:20" 440, "" 450, "7:40" 460, "" 470,\ "8:00" 480, "" 490, "8:20" 500, "" 510, "8:40" 520, "" 530) set ytics ("0" 0, "20" 15, "40" 30, "60" 45, "80" 60, "100" 75,\ "Idle" 90,"Active" 100, \ "0" 120, "20" 140,"40" 160, "60" 180, "80" 200, "100" 220,\ "0" 250, "100" 280,\ "0" 300, "60" 320, "120" 340, "180" 360, "240" 380, "300" 400,\ "360" 420, "420" 440, "480" 460, "540" 480, "600" 500) #set size 0.7,1.3; set term postscript portrait "Times-Roman" 10 #set size 0.9,0.9; set term postscript landscape "Times-Roman" 12 # file title has the parameters that this program needs load 'title' plot "run_queue" title "Run Queue" with lines,\ "tape_queue" title "Tape Queue" with lines,\ "finished" title "Dumps Finished" with lines,\ "bandw_free" title "Bandwidth Allocated" with lines, \ "disk_alloc" title "%Disk Allocated" with lines, \ "tape_wait" title "%Tape Wait" with lines,\ "tape_idle" title "Taper Idle" with lines,\ "dump_idle" title "Dumpers Idle" with lines amanda-3.3.6/amplot/Makefile.am0000664000076400007640000000116712357250001017770 0ustar00martineamartinea00000000000000# Makefile for amplot. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/scripts.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am SCRIPTS_SHELL = amplot SCRIPTS_AWK = amcat.awk sbin_SCRIPTS = $(SCRIPTS_SHELL) amplotdir = $(amlibexecdir) amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp EXTRA_DIST += amplot.awk amplot.g CLEANFILES += amplot.gp.new DISTCLEANFILES += amplot.gp amplot.gp: amplot.g cat $(srcdir)/amplot.g > amplot.gp.new echo "pause -1;" >> amplot.gp.new rm -f amplot.gp mv amplot.gp.new amplot.gp amanda-3.3.6/amplot/amplot.awk0000664000076400007640000004412212357250001017732 0ustar00martineamartinea00000000000000# # Amanda, The Advanced Maryland Automatic Network Disk Archiver # Copyright (c) 1992-1998, 2000 University of Maryland at College Park # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # All Rights Reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of U.M. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. U.M. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Author: Olafur Gudumundsson, ogud@tis.com # formerly at: Systems Design and Analysis Group # Computer Science Department # University of Maryland at College Park # # An awk program to parse the amdump file and output the information # in a form at the gnuplot program amplot.g wants # # Creation Date: April 1992 # modified: Aug 1993 # Modified for Amanda-2.2: Dec 1993 # Modified for Amanda-2.2: Mar 1994 and May 1994 and June 1994 # Enhanced: April 1995 # Input: One amdump file # Output: Number of files that get fed into gnuplot # BEGIN{ # The folowing parameters may have to be set to suit each site, both # parameters are expressed in HOUR's. # If your average amanda dump is more than 3 hours you should increase the # value of maxtime, similary if your dumps are finishing in less than 2 hours # you should decrease the value of maxtime. # This is now setable from amplot's command line. # maxtime = 4; # how long to plot graph for in hours # Min host controls the reporting of hosts that take long in dumping # This varible can be set explicity or as a fraction of maxtime # If you are seeing too many hosts reported increase the value of this # constant # min_host = maxtime * 0.75; # good rule of thumb # min_host = 2.5; # expicit cutoff value in hours # # DO NOT CHANGE ANYTHING BELOW THIS LINE # time_scale = 60; # display in minutes DO NOT CHANGE maxtime *= time_scale; # convert to minutes min_host *= time_scale *time_scale; # convert to seconds # dumping than this disk_raise = 120; # scaling factors for Holding disk graph tape_raise = 90; dump_shift = 7.5; # scaling factors for Dumpers idle graph dump_raise = 0; que_raise = 300; # scaling factors for the queue's count_scale= 1.0/3.0; # new scale # scaling factors for the x axis bandw_raise = 250; bandw_scale = 30/300; # default calculated below holding_disk = -1; # uninitialized cnt = 0; # default values for counters din = 0; # number of dumps to holding disk dout = 0; # number of dumps to tape tapeq = 0; # how many dumps in tape queue tape_err = 0; # how many tape errors tout = 0; # data written out to tape quit = 0; # normal end of run plot_fmt = "%7.2f %6.2f\n%7.2f %6.2f\n"; # format of files for gnuplot plot_fmt1 = "%7.2f %6.2f\n"; # format of files for gnuplot } { # state machine for processing input lines lines if( $1 == "driver:") { if($2=="result") do_result(); else if( $2=="state") do_state(); else if( $2=="interface-state") ; else if( $2=="hdisk-state") do_hdisk++; else if( $2=="flush" && $3=="size" ) { flush_size = $4; } else if( $2=="start" && $3=="time") do_start(); else if( $2=="send-cmd") { if( $7=="FILE-DUMP"){ file_dump++; dmpr_strt[$6]=$4; host[$6]=$10; disk[$6]=$12; level[$6]=$14; } else if( $7 == "FILE-WRITE") file_write++; else if( $7 == "START-TAPER") fil = $9; } else if( $2=="finished-cmd") cmd_fin++; else if( $2=="started") forked++; else if( $2=="QUITTING") do_quit(); else if( $2=="find_diskspace:") ; #eat this line else if( $2=="assign_holdingdisk:") ; #eat this line else if( $2=="adjust_diskspace:") ; #eat this line else if( $2=="tape" && $3=="size") ; #eat this line else if( $2=="dump" && $3=="failed") ; #eat this line else if( $2=="taper" && $3=="failed") ; #eat this line else if( $2=="dumping" || $2 == "adding" || $2 == "holding-disks:") dumping++; # eat this line else if( $2!="FINISHED" && $2 != "pid" && $2 != "taper-tryagain"&& $2!="startaflush:") print fil,"Unknown statement#",$0; } else if ( $1 == "planner:") { if( $2 == "SKIPPED" || $2 == "FAILED") { failed++; print fil, "INFO#", $0; } } else if( $1 == "GENERATING") sched_start=NR; else if( $1 == "ENDFLUSH") sched_start=NR; else if( $1 == "DELAYING") do_moves(); # find estimated size else if( $1 == "dumper:") { if($4 != "starting" && $2 != "pid" && $2 != "stream_client:" && $2 != "dgram_bind:") print fil, "INFO#", $0; } else if( $1 == "taper:") { if($3 != "label" && $3 != "end" && $2 != "DONE" && $2 != "pid" && $2 != "slot" && $2 != "reader-side:" && $2 != "page" && $2 != "buffer" && $3 != "at" && $3 != "switching" && $2 != "slot:" && $2 != "status") print fil, "INFO#", $0; } else if( $1 == "FLUSH") { no_flush++; } else if( NF==1 && sched_start > 0 && NR-sched_start > 1) { # new style end of schedule no_disks = NR-sched_start-2; # lets hope there are no extra lines sched_start = 0; } } function do_state(){ # state line is printed out after driver # finishes pondering new actions # it reports the state as seen be driver # fields in the state line # $2 = "state" # $3 = "time" # $4 = time_val # $5 = "free" # $6 = "kps:" # $7 = free_kps # $8 = "space:" # $9 = space # $10 = "taper:" # $11 = "writing"/"idle"# $12 = "idle-dumpers:" # $13 = #idle # $14 = "qlen" # $15 = "tapeq:" # $16 = #waiting # $17 = "runq:" # $18 = #not started # $19 = "roomq" # $20 = #roomq # $21 = "wakeup:" # $22 = #wakeup # $23 = "driver-idle:" # $23 = status cnt++; # number of event time = $4/time_scale; #Check overflow in driver ouput (big value instead of negative) if($7>0 && $7 < 0x7fffffff) unused = (bandw - $7)*bandw_scale+bandw_raise; else unused = bandw_raise; if( unused != unused_old) printf plot_fmt, time, unused_old, time,unused >>"bandw_free"; unused_old = unused; if(holding_disk_old != $9) { disk_alloc_time[disk_a] = time; disk_alloc_space[disk_a] = holding_disk_old; disk_a++; disk_alloc_time[disk_a] = time; disk_alloc_space[disk_a] = $9; disk_a++; holding_disk_old = $9; } twait = tsize; if(twait_old != twait) { twait_time[twait_a] = time; twait_wait[twait_a] = twait_old; twait_a++; twait_time[twait_a] = time; twait_wait[twait_a] = twait; twait_a++; twait_old = twait; } active = (dumpers-$13)*dump_shift+dump_raise; if( active != active_old ) printf plot_fmt, time, active_old, time, active >> "dump_idle"; active_old = active; # tape on or off if($11=="writing")state = tape_raise+10; else state = tape_raise; if( state != state_old ) printf plot_fmt, time, state_old, time, state >> "tape_idle"; state_old = state; run = $18*count_scale+que_raise; if( run != run_old ) printf plot_fmt, time, run_old, time, run >> "run_queue"; run_old = run; finish = written * count_scale+que_raise; if( finish != finish_old ) printf plot_fmt, time, finish_old, time, finish >> "finished"; finish_old = finish; tapeQ = $16 * count_scale+que_raise; if( tapeQ != tapeQ_old ) printf plot_fmt, time, tapeQ_old, time, tapeQ >> "tape_queue"; tapeQ_old = tapeQ; } function do_start() { # get configuration parameters dumpers = $6; # how many day = $14; dump_shift = 75/dumpers; bandw = $8; bandw_scale = (30/bandw); unused_old = bandw_raise; print 0, unused_old > "bandw_free"; if( sched_start >0 ) { no_disks = NR-sched_start-1; # backward compatability sched_start =0; print "do_start: no_disks", no_disks, $0; } no_disks += no_flush; size = $10/1024; # size of holding disk in MB holding_disk= $10 + flush_size; init_holding_disk= $10 + flush_size; holding_disk_old = $10; disk_a = 0; disk_alloc_time[disk_a] = 0; disk_alloc_space[disk_a] = holding_disk_old; disk_a++; tsize = flush_size; twait_old = tsize; twait_a = 0; twait_time[twait_a] = 0; twait_wait[twait_a] = twait_old; twait_a++; if( NF==14) { # original file was missing this policy="FIFO"; alg ="InOrder"; } else if(NF>=18) { # newer files have this format policy = $18; alg = $16; if( alg=="drain-ends") big = $20; } start = $4; # this is the start time of the first dump # taper idle to this point should not be included run_old = no_disks*cont_scale+que_raise; print 0, run_old >"run_queue"; finish_old = tapeQ_old = que_raise; print 0, finish_old >"finished"; print 0, tapeQ_old >"tape_queue" ; state_old = tape_raise; print 0, state_old > "tape_idle"; active_old = dump_raise; print 0,active_old >"dump_idle"; } function do_quit(){ # this is issued by driver at the end # when it has nothing more to do cnt++; quit = 1; tim = $4 / time_scale; disk_alloc_time[disk_a] = tim; disk_alloc_space[disk_a] = holding_disk_old; disk_a++; max_space=disk_alloc_space[0]; for(a=0; a max_space) { max_space = disk_alloc_space[a]; } } space_change = 0; if(max_space > holding_disk) { space_change = max_space - holding_disk; holding_disk = max_space; } twait_time[twait_a] = tim; twait_wait[twait_a] = twait_old; twait_a++; min_wait=twait_wait[0]; for(a=0; a> "disk_alloc"; } for(a=0; a> "tape_wait"; } printf plot_fmt, tim, active_old, tim, dump_raise >>"dump_idle"; printf plot_fmt, tim, state_old, tim, tape_raise >>"tape_idle"; printf plot_fmt, tim, unused_old, tim, bandw_raise >>"bandw_free"; printf plot_fmt, tim, finish_old, tim, written*count_scale+que_raise >>"finished"; printf plot_fmt, tim, run_old, tim, run_old >>"run_queue"; } function do_result(){ # process lines driver: result if($7=="DONE" ) { if( $6=="taper:"){ # taper done tsize -= $14; tout += $14; tcnt--; written++; } else { # dumperx done tsize += (int($15/32)+1)*32; # in tape blocks tcnt++; done++; xx = host[$6]; d = disk[$6]; l = level[$6]; host_time[xx]+= ( tt = $4 - dmpr_strt[$6]); if(xx in disk_list) disk_list[xx] = disk_list[xx] "\n"; disk_list[xx] = disk_list[xx] \ xx ":" d "/" l "\t" \ pr_time(dmpr_strt[$6]) \ " - " pr_time($4) \ " = " pr_time(tt); # print host[$6], disk[host[$6]]; # print host[$6], $4, dmpr_strt[$6], host_time[host[$6]] } } else if ($6=="taper:") { # something else than DONE if($7=="TAPE-ERROR" || $7=="TRY-AGAIN") { tape_err= 1; err_time=$4/time_scale; } else if ($7=="TAPER-OK") tape_err=0; else if ($7=="PORT") tape_err=0; else if ($7=="REQUEST-NEW-TAPE") tape_err=0; else if ($7=="NEW-TAPE") tape_err=0; else if ($7=="PARTDONE") tape_err=0; else if ($7=="DUMPER-STATUS") tape_err=0; else print fil, "UNKNOWN STATUS# "$0 ; } else { # something bad from dumper if ($7=="FAILED") { failed++;} else if ($7=="TRY-AGAIN"){ try++;} else if ($7=="PORT") ; # ignore from chunker else if ($7=="RQ-MORE-DISK") ; # FIXME: ignore for now else if ($7=="NO-ROOM") print fil, pr_time($4),"#" ++no_room, $0; else if( $7=="ABORT-FINISHED") print fil, "#" ++no_abort, $0; else print fil, "UNKNOWN STATUS# " $0; } } function do_moves() { # function that extracts the estimated size of dumps # by processing DELAYING and promoting lines est_size=$6; getline ; # eat get next line print out planner msg while (NF > 0 && (($1 == "delay:") || ($1 == "planner:")) ) { if( $1 == "delay:") est_size = $NF; # processing delay lines else print fil, "DELAY#", $0; getline; } getline ; # eating blank line if( $1== "PROMOTING") { # everything is dandy getline; # get first promote line while ( NF>0 && ($1 == "promote:" || $1 == "planner:" || $1 == "no" || $1 == "try") ) { if( $2 == "moving") { est_size=$8; print fil, "PROMOTING#", $1, $3; } else if($2 != "checking" && $2 != "can't" && $3 != "too" && $1 != "no" && $1 != "try" && $2 != "time") print fil,"PROMOTING#", $0; getline ; # get next promote line } } else print fil, "DID NOT FIND PROMOTING LINE IN THE RIGHT PLACE",NR,$0; } END { if( holding_disk == -1) { # bad input file print fil,": MISSING SPACE DECLARATION" ; exit; } # print headers of each graph this is for the gnulot version if( tim >maxtime && extend==0)# if graph will extend beond borders printf "Graph extends beond borders %s taking %7.3f > (max = %7.3f)\n", fil, tim, maxtime ; print_t(); # print titles if( no_room + no_abort > 0) printf "NO-ROOM=%5d ABORT-FINISHED=%5d\n", no_room, no_abort; max_out = 20; old_t = min_host * min_host; # Some thing big print "Longest dumping hosts Times", min_host; print "Host:disk/lev \t start - end = run\t=> total"; while ( max_out-- > 0 && old_t > min_host) { t = 0; for (j in host_time) { if( t < host_time[j] && host_time[j] %s\n\n", disk_list[d], pr_time(host_time[d]); # printf "%-20.20s Total Dump time %s\n", d, pr_time(host_time[d]); old_t = t; } } function print_t(){ # printing out the labels for the graph label=0; # calculating where labels go and # range for x and y axes maxy = int(no_disks/60+1)*20+que_raise; printf "set yrange[0:%d]\n",maxy >"title"; if( maxtime < tim && extend !=0) { printf "set xrange[0:%d]\n", tim+30 >>"title"; first_col = 10; second_col = (tim+30) * 0.45; key_col = (tim+30) * 1.042; third_col = (tim+30) * 1.0125; } else { printf "set xrange[0:%d]\n", maxtime >>"title"; first_col = maxtime * 0.042 second_col = maxtime * 0.45 key_col = maxtime; third_col = maxtime*1.0125; } label_shift = (7 + int(no_disks/100)); lab = label_start = maxy+(6*label_shift) ; # showing 6 labels printf "set key at %d, %d\n", key_col, lab+4 >>"title"; printf "set label %d \"Amanda Dump %s\" at %d,%d\n", ++label,fil, first_col,lab >"title"; lab -= label_shift; printf "set label %d \"Bandwidth = %d\" at %d,%d\n",++label,bandw, first_col,lab >>"title"; lab -= label_shift; printf "set label %d \"Holding disk = %d\" at %d,%d\n",++label,size, first_col,lab >>"title"; lab -= label_shift; printf "set label %d \"Tape Policy = %s\" at %d,%d\n",++label,policy, first_col,lab >>"title"; lab -= label_shift; printf "set label %d \"Dumpers= %d\" at %d,%d\n",++label,dumpers, first_col,lab >>"title"; lab -= label_shift; if( alg =="drain-ends") printf "set label %d \"Driver alg = %s At big end %d\" at %d,%d\n", ++label,alg, big,first_col,lab >>"title"; else #if( alg =="InOrder") # other special cases printf "set label %d \"Driver alg = %s\" at %d,%d\n", ++label,alg,first_col, lab >>"title"; lab = label_start; printf "set label %d \"Elapsed Time = %s\" at %d,%d\n", ++label,pr_time(tim*60),second_col,lab >>"title"; lab -= label_shift; if( tape_err==1) stm = "TAPE ERROR"; else if( quit ==1) stm = "SUCCESS"; else { stm = "UNKNOWN"; print "Unknown terminating status",fil; } printf "set label %d \"Final status = %s\" at %d,%d\n", ++label,stm, second_col,lab >> "title"; lab -= label_shift; printf "set label %d \"Dumped/Failed = %3d/%d\" at %d,%d\n", ++label,done,(failed+(try/2)), second_col,lab >>"title"; lab -= label_shift; printf "set label %d \"Output data size = %d\" at %d, %d\n", ++label,int(tout/1024+0.49999),second_col,lab >>"title"; if( est_size >0) { lab -= label_shift; printf "set label %d \"Estimated data size = %d\" at %d, %d\n", ++label,int(est_size/1024+0.49999),second_col,lab >>"title"; } if (gnuplot==0) { printf "set output \"%s.ps\"\n",fil >>"title"; if(bw==1) { if(paper==1) printf "set term postscript landscape \"Times-Roman\" 10\n" >>"title"; else printf "set term postscript portrait \"Times-Roman\" 10\n" >>"title"; } else { if(paper==1) printf "set term postscript landscape color \"Times-Roman\" 10\n" >>"title"; else printf "set term postscript portrait color \"Times-Roman\" 10\n" >>"title"; } } else { printf "set term x11\n" >> "title"; } printf "set ylabel """";" >>"title"; # make sure there is no ylabel fmt= "set label %d \"%s\" at "third_col", %d\n"; printf fmt, ++label,"%DUMPERS", 40 >>"title"; printf fmt, ++label,"TAPE", 95 >>"title"; printf fmt, ++label,"HOLDING",180 >>"title"; printf fmt, ++label,"DISK", 160 >>"title"; printf fmt, ++label,"%BANDWIDTH", 260 >>"title"; printf fmt, ++label,"QUEUES",(que_raise+maxy)/2 >>"title"; if((paper+gnuplot) > 0) print "set size 0.9, 0.9;" >>"title"; else print "set size 0.7,1.3;" >>"title"; } function pr_time(pr_a){ #function to pretty print time pr_h = int(pr_a/3600); pr_m = int(pr_a/60)%60; pr_s = int(pr_a+0.5) %60; if( pr_m < 10 && pr_s < 10 ) return pr_h":0"pr_m":0"pr_s; else if( pr_s < 10) return pr_h":" pr_m":0"pr_s; else if( pr_m < 10) return pr_h":0"pr_m":" pr_s; else return pr_h":" pr_m":" pr_s; } amanda-3.3.6/amplot/amcat.awk.in0000664000076400007640000000023012357250001020120 0ustar00martineamartinea00000000000000BEGIN{o=substr(f,length(f)-1,2); if(substr(o,1,1)==".") o=substr(o,2,1); @AMPLOT_CAT_GZIP@ @AMPLOT_CAT_COMPRESS@ @AMPLOT_CAT_PACK@ print "cat"; exit; } amanda-3.3.6/amplot/amplot.sh0000664000076400007640000001371512357250001017566 0ustar00martineamartinea00000000000000#!@SHELL@ # Amanda, The Advanced Maryland Automatic Network Disk Archiver # Copyright (c) 1992-1998 University of Maryland at College Park # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # All Rights Reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of U.M. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. U.M. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Author: Olafur Gudumundsson, (ogud@tis.com) Trusted Information Systems # Formerly at: Systems Design and Analysis Group # Computer Science Department # University of Maryland at College Park # # Amplot: a program to generate postscript plots of each nights amanda # performance # # Author: Olafur Gudmundsson (ogud@tis.com) # Creation Date: April 1992 # Last modified: April 1995 # Input: list of amdumps # Output: Plot of amdump files as either gnuplots on the screen or # Postscript files # prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" amlibexecdir="@amlibexecdir@" . "${amlibexecdir}/amanda-sh-lib.sh" confdir=@CONFIG_DIR@ # add sbin and ucb dirs PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" export PATH # we use a different version of the compression variable than amanda itself. COMPRESS=@AMPLOT_COMPRESS@ # Function to check that awk can do command-line variable # substitution. If no, then exit; if yes, set $AVARFLAG # to the commandline switch used to introduce a variable. This # check used to be performed at build time in configure; it's # now performed at runtime. test_awk() { local tmpfile result tmpfile=`mktemp /tmp/amplot.XXXXXX` echo 'BEGIN{print i; exit}' > ${tmpfile} result=`$AWK -f ${tmpfile} i=xx | wc -c` if test "$result" -le 1; then result=`$AWK -f ${tmpfile} -v i=xx | wc -c` if test "$result" -le 1; then echo "$AWK does not support command-line variable assignment; amplot cannot run" >&2 rm -fr $tmpfile exit 1 else AVARFLAG=-v fi else AVARFLAG='' fi rm -fr $tmpfile } # Function to search for gnuplot and ensure it's working. This # first tries the location detected/configured when amanda was built, # then tries 'gnuplot', assuming it's in the user's path. If no # working gnuplot executable is found, it exits with an error. The # variable $GNUPLOT is set to the resulting executable. find_gnuplot() { if test "x$GNUPLOT" = "x"; then # look for it in the user's PATH GNUPLOT=gnuplot fi if ${GNUPLOT} --version 2>/dev/null | grep '^gnuplot' >/dev/null; then : # looks OK else echo "${GNUPLOT} was not found; amplot cannot run" exit 1 fi } # check our environment, using functions from above test_awk find_gnuplot if [ $# -eq 0 ] ; then _ 'Usage: %s [-c] [-e] [-g] [-l] [-p] [-t hours] \n' $0 _ '%s generates plot for screen with fixed dimensions\n' $0 _ ' -c Compress the input amdump files after plotting\n' _ ' -e Extends x (time) axes if needed\n' _ ' -g Run gnuplot directly no postscript file generated DEFAULT\n' _ ' -l Landscape mode suitable for printing\n' _ ' -p Postscript output (color)\n' _ ' -b The postscipt will be b/w\n' _ ' -t T Set the right edge of the plot to be T hours\n' exit 1 fi tmp_files="bandw_free disk_alloc dump_idle finished run_queue tape_* title" my_plot=$amlibexecdir/amplot.g paper=0 gnuplot=1 cmpres=0 para="" maxtime=4 bw=0 # setting up the parameters to pass to [gn]awk while :; do case "$1" in -c) cmpres=1; shift;; -e) para=$para"$AVARFLAG extend=1 "; shift;; -g) gnuplot=1; shift;; -l) paper=1; para=$para"$AVARFLAG paper=1 "; shift;; -p) gnuplot=0; shift;; -b) bw=1; shift;; -t) shift if test "$#" -eq 0; then _ '%s: no argument for -t option\n' $0 1>&2 exit 5 fi maxtime="$1"; shift;; *) break;; esac done if [ $# -eq 0 ] ; then _ '%s: no input files\n' $0 1>&2 exit 5 fi para=$para"$AVARFLAG maxtime=$maxtime" if [ $gnuplot -eq 1 ] ; then my_plot=$my_plot"p" # use the plot prog that pauses plot=" -geometry 800x700+40+0" para=$para"$AVARFLAG gnuplot=1 " _ "Displaying graph on the screen, for next graph" if [ "$paper" -eq 1 ] ; then _ '%s: -l requires -p flag at the same time\n' $0 1>&2 exit 6 fi if [ "$bw" -eq 1 ] ; then _ '%s: -b requires -p flag at the same time\n' $0 1>&2 exit 6 fi fi if [ $bw -eq 1 ]; then para=$para" bw=1" fi list=""; # files to compress at the end for i in ${1+"$@"} # for all the input files do f="$i"; if [ ! -f "$f" ] ; then f=`ls "$i" "$i".*[zZ] 2>/dev/null` fi if [ -f "$f" ] ; then # found file disp=`$AWK -f $amlibexecdir/amcat.awk $AVARFLAG f="$f"` if [ -z "$disp" ] ; then _ 'Do not know how to [gz|z]cat this file\n' else /bin/rm -f $tmp_files $disp "$f" | $AWK -f $amlibexecdir/amplot.awk $para $GNUPLOT $plot $my_plot if [ $disp = "cat" -a $cmpres -eq 1 ] ; then list=$list" "$f fi fi else # check if file has been compressed _ 'No such file %s or %s\n' "$i" "$i.*[zZ]" fi done /bin/rm -f $tmp_files if [ "$list" != "" ] ; then # now compress the files we worked on # comment out next line if you do not want compression at the end _ 'Compressing %s\n' "$list" $COMPRESS $list fi exit 0 amanda-3.3.6/packaging/0000775000076400007640000000000012357750430016372 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/Makefile.in0000664000076400007640000014026212357750241020444 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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 = packaging DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ common \ deb \ rpm \ sun-pkg \ Makefile.am \ README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu packaging/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(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 TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook 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: 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 \ dist-hook 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 \ uninstall uninstall-am dist-hook: rm -rf `find ${distdir} -name .svn` # 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: amanda-3.3.6/packaging/Makefile.am0000664000076400007640000000017212357250001020413 0ustar00martineamartinea00000000000000EXTRA_DIST = \ common \ deb \ rpm \ sun-pkg \ Makefile.am \ README dist-hook: rm -rf `find ${distdir} -name .svn` amanda-3.3.6/packaging/common/0000775000076400007640000000000012357750430017662 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/common/test_sh_libs.sh0000775000076400007640000006475512357250001022711 0ustar00martineamartinea00000000000000#!/bin/sh # This script is uses ShUnit to test packaging/common/*. Currently # it only tests the functions as they perform for rpm and deb building. # As support is added for other styles of package, these tests should be # updated. ####################### # If EXECUTING WITH ROOT ACCESS SCRIPT DELETES AND CREATES USERS. # EXECUTE WITH CAUTION. ####################### #set -x # Note on conflicting variable names: # SHUNIT_* and SHU_* are shunit2 variables # test_* should only be used by test functions. # All other variables will probably be used by pre/post/common functions. case $1 in DEBUG) DEBUG=True shift ;; *) DEBUG= ;; esac export DEBUG ex_from=`dirname $0` # shunit2 assumes shunit_inc, but we might run from a separate # builddir. So try to use srcdir, as defined by automake, or # otherwise `pwd`. SHUNIT_INC="${srcdir=`pwd`}/packaging/common"; export SHUNIT_INC TMPDIR=`pwd`/shunit-test; export TMPDIR amanda_user=test_amandabackup; export amanda_user amanda_group=test_disk; export amanda_group sup_group="test_tape"; export sup_group AMANDAHOMEDIR=$TMPDIR/amanda; export AMANDAHOMEDIR AMANDATES=$AMANDAHOMEDIR/amandates; export AMANDATES os=`uname`; export os wanted_shell='/bin/false'; export wanted_shell dist=Fedora; export dist SYSCONFDIR=$TMPDIR/etc; export SYSCONFDIR SBINDIR=$TMPDIR/sbin; export SBINDIR encoder=`{ command -v base64 2>/dev/null; } || { command -v uuencode 2>/dev/null; }` # Don't potentially conflict with a real value... deb_uid=63000; export deb_uid # Append stuff to this when you make temp files if they are outside TMPDIR test_cleanup_files="$TMPDIR"; export test_cleanup_files # This can't be part of one-time setup, because TMPDIR must exist before # shunit2 is sourced. mkdir -p ${TMPDIR} || exit 1 { LOGFILE="$TMPDIR/test_sh_libs.log" (umask 077 && touch $LOGFILE) } || { echo "Unable to create log file!" exit 1 } export LOGFILE oneTimeSetUp() { msg_prefix="oneTimeSetUp: " if [ "$IAmRoot" ]; then # Delete an existing user. echo "$msg_prefix attempting to delete an existing user." userdel -f -r ${amanda_user} # If the user exists, our tests will act wrong, so exit grep "${amanda_user}" ${SYSCONFDIR}/passwd &> /dev/null || { \ echo "$msg_prefix ${amanda_user} still exists, or no ${SYSCONFDIR}/passwd."; exit 1; } groupdel ${amanda_group} || exit 1 groupdel ${sup_group} || exit 1 else echo "Not root, cleanup skipped" fi # Make all directories which might be needed. mkdir -p ${AMANDAHOMEDIR}/example if [ ! "$IAmRoot" ]; then mkdir -p ${SYSCONFDIR}/xinetd.d mkdir -p ${SYSCONFDIR}/init.d fi } oneTimeTearDown() { if [ ${__shunit_assertsFailed} -eq 0 ] && [ ! "${DEBUG}" ]; then rm -rf $test_cleanup_files else echo "Check ${test_cleanup_files} for logs and error info." fi } test_cleanup_files="$LOGFILE ${test_cleanup_files}" # shows syntax errors before the tests are run. . ${SHUNIT_INC}/common_functions.sh . ${SHUNIT_INC}/pre_inst_functions.sh . ${SHUNIT_INC}/post_inst_functions.sh . ${SHUNIT_INC}/post_rm_functions.sh # Use this to skip root requiring tests. # id -u is not portable to solaris. tester_id=`id | sed 's/gid=\([0-9]*\).*/\1/'` if [ "$tester_id" = "0" ]; then # Same as SHUNIT_TRUE, but we can't use that yet... IAmRoot=0 else IAmRoot= fi # CAUTION: using real values if we are root. if [ "$IAmRoot" ]; then amanda_group=disk; export amanda_group SYSCONFDIR=/etc; export SYSCONFDIR SBINDDIR=/sbin; export SBINDDIR fi # Source our mock utils. . ${SHUNIT_INC}/mock_utils.sh log_tail_no_stamp() { # This strips the date off of a log line so only the message is # compared. LOG_TAIL=`tail -1 ${LOGFILE}|cut -d " " -f 5-` } ###################################### # Common functions # shUnit reorders tests alphabetically. We need the logger and cleanup tests # to run first. test___logger() { # Write a line to the log, test that it got there. TEST_MSG="test___logger message" LOG_LINE="`date +'%b %d %Y %T'`: ${TEST_MSG}" # It's important for the log messages to be quoted, or funny stuff happens. logger "${TEST_MSG}" assertEquals "logger() return code" 0 $? log_tail_no_stamp assertEquals "logger() did not write <${LOG_LINE}> " \ "${TEST_MSG}" "${LOG_TAIL}" # Leave this outside the unit test framework. if the logger is # broken we must exit. if [ ! `grep -c "${LOG_LINE}" ${LOGFILE}` = "1" ]; then echo "error: logger(): Incorrect content in ${LOGFILE}: " `cat ${LOGFILE}` exit 1 fi } test__log_output_of() { # Use log_output_of to append to the log TEST_MSG="test__log_output_of message" log_output_of echo "${TEST_MSG}" assertEquals "log_output_of()" 0 $? LOG_LINE="echo: ${TEST_MSG}" log_tail_no_stamp assertEquals "log_output_of() message should be: " \ "${LOG_LINE}" "${LOG_TAIL}" COUNT=`grep -c "${TEST_MSG}" ${LOGFILE}` assertEquals "log_output_of(): incorrect content in log" \ 1 ${COUNT} # Leave this outside the unit test framework. if the logger is # broken we must exit. if [ ! ${COUNT} = '1' ]; then echo "error: log_output_of(): Incorrect content in ${LOGFILE}: " `cat ${LOGFILE}` exit 1 fi } # NOTE: check_xinetd and check_inetd tests end up simply duplicating the # code of the function itself test_check_smf() { logger "test_check_smf" [ "$os" = "SunOS" ] || { startSkipping; echo "test_check_smf: skipped"; } # Test existing service touch ${MOCKDIR}/prexisting_service check_smf assertEquals "check_smf preexisting services" 0 $? rm ${MOCKDIR}/prexisting_service check_smf assertEquals "check_smf no amanda service" 1 $? } test_check_superserver_running() { logger "test_check_superserver_running" [ "$IAmRoot" ] && { startSkipping; echo "test_check_superserver_running: skipped"; } # Test the positive cases # running changes the output of mocked ps touch ${MOCKDIR}/running check_superserver_running inetd assertEquals "check_superserver_running inetd" 0 $? assertSame "ps args: -e" "`cat $mock_ps_flags`" if [ `uname` = 'Darwin' ]; then [ "$IAmRoot" ] && startSkipping check_superserver_running launchd assertEquals "check_superserver_running launchd" 0 $? assertSame "ps args: aux" "`cat $mock_ps_flags`" endSkipping else endSkipping check_superserver_running launchd assertEquals 2 $? fi # Test the negative case, skip if root [ "$IAmRoot" ] && startSkipping rm ${MOCKDIR}/running check_superserver_running inetd assertEquals "check_superserver_running inetd returned 0 when inetd was not running" 1 $? assertSame "ps args: -e" "`cat $mock_ps_flags`" check_superserver_running xinetd assertNotEquals "check_superserver_running xinetd incorrectly returned 0" \ 0 $? assertSame "ps args: -e" "`cat $mock_ps_flags`" } test_backup_xinetd() { logger "test_backup_xinetd" touch ${SYSCONFDIR}/xinetd.d/amandaserver backup_xinetd "amandaserver" assertEquals "backup_xinetd returns 0" 0 $? assertTrue "[ -f ${AMANDAHOMEDIR}/example/*.amandaserver.orig ]" } test_backup_inetd() { logger "test_backup_inetd" case $os in SunOS) inetd_dir=${SYSCONFDIR}/inet ;; *) inetd_dir=${SYSCONFDIR} ;; esac [ -d "${inetd_dir}" ] || mkdir -p ${inetd_dir} touch ${inetd_dir}/inetd.conf echo "amanda foo/bar/baz amandad" >> ${inetd_dir}/inetd.conf backup_inetd assertEquals "backup_inetd returns 0" 0 $? assertTrue "[ -f ${AMANDAHOMEDIR}/example/inetd.orig ]" } test_backup_smf() { logger "test_backup_smf" : # TODO: how to mock this? } test_install_xinetd() { logger "test_install_xinetd" if [ "$os" = "SunOS" ] ; then # Solaris has install_xinetd_sol startSkipping echo "test_install_xinetd: skipped" return fi # Test success: touch ${MOCKDIR}/success touch ${AMANDAHOMEDIR}/example/xinetd.amandaserver install_xinetd "amandaserver" assertEquals "install_xinetd returns 0" 0 $? # Test "install" failure rm ${MOCKDIR}/success install_xinetd "amandaserver" assertEquals "install_xinetd returns 1" 1 $? } test_install_inetd() { logger "test_install_inetd" case $os in SunOS) inetd_dir=${BASEDIR}/${SYSCONFDIR}/inet ;; *) inetd_dir=${SYSCONFDIR} ;; esac [ -f ${inetd_dir}/inetd.conf ] || touch ${inetd_dir}/inetd.conf test_inetd_entry='amanda foo/bar/baz amandad' if [ ! -f ${AMANDAHOMEDIR}/example/inetd.conf ]; then echo "${test_inetd_entry}" > ${AMANDAHOMEDIR}/example/inetd.conf.amandaserver fi install_inetd amandaserver assertEquals "install_inetd returns 0" 0 $? assertSame "${test_inetd_entry}" "`tail -1 ${inetd_dir}/inetd.conf`" } # TODO: test_install_smf() { # Needs mocks for: inetconv, inetadm, svcadm. test_reload_xinetd() { logger "test_reload_xinetd" # Might need init script. if [ "$IAmRoot" ]; then startSkipping echo "test_reload_xinetd: skipped" return elif [ ! -f "${SYSCONFDIR}/init.d/xinetd" ]; then mv ${MOCKDIR}/xinetd ${SYSCONFDIR}/init.d fi # Test bad argument reload_xinetd foo assertEquals "reload_xinetd should reject argument 'foo'" 1 $? # Test success touch ${MOCKDIR}/success reload_xinetd "reload" assertEquals "reload_xinetd" 0 $? # Test no argument reload_xinetd assertEquals "reload_xinetd should attempt to reload" 0 $? flags=`cat ${mock_xinetd_flags}` assertEquals "xinetd_flags should contain: " \ "xinetd args: reload" "${flags}" # Test failure rm ${MOCKDIR}/success reload_xinetd "reload" assertEquals "reload_xinetd" 1 $? tail -4 ${LOGFILE}|grep "\/dev/null assertEquals "reload_xinetd should try to restart." 0 $? reload_xinetd "restart" assertEquals "restart should fail." 1 $? tail -3 ${LOGFILE}|grep "restarting xinetd" >/dev/null assertEquals "Should log attempt to restart" 0 $? } test_reload_inetd() { logger "test_reload_inetd" # Test bad argument # Might need init script. if [ ! "$IAmRoot" ]; then if [ ! -f "${SYSCONFDIR}/init.d/inetd" ]; then mv ${MOCKDIR}/inetd ${SYSCONFDIR}/init.d fi fi # Test bad argument reload_inetd foo assertEquals "reload_inetd should reject argument 'foo' (return 1):" 1 $? # Test success touch ${MOCKDIR}/success reload_inetd assertEquals "reload_inetd" 0 $? # Test failure rm ${MOCKDIR}/success reload_inetd "reload" assertEquals "reload_inetd" 1 $? tail -4 ${LOGFILE}|grep "\/dev/null assertEquals "reload_inetd should try to restart." 0 $? reload_inetd "restart" assertEquals "restart should fail." 1 $? tail -3 ${LOGFILE}|grep "Restarting inetd" >/dev/null assertEquals "Should log attempt to restart" 0 $? } ###################################### # pre_install_functions test_check_user_group_missing() { logger "test_check_user_group_missing no param" check_user_group assertNotEquals "'check_user_group' should fail" 0 $? logger "test_check_user_group_missing missing group" [ ! "$IAmRoot" ] && rm -f ${SYSCONFDIR}/group touch ${SYSCONFDIR}/group for os in linux osx solaris; do echo $os > ${MOCKDIR}/id_os check_user_group "abracadabra" assertNotEquals "'check_user group abracadabra' should not be found:" 0 $? log_tail_no_stamp assertEquals "check_user_group should write" \ "User's primary group 'abracadabra' does not exist" \ "${LOG_TAIL}" done } good_group_entry="${amanda_group}:x:100:" export good_group_entry test_check_user_group_exists() { logger "test_check_user_group user and group exist" touch ${MOCKDIR}/id_exists touch ${SYSCONFDIR}/group # Non-root adds and entry to the mock group file [ ! "$IAmRoot" ] && echo $good_group_entry > ${SYSCONFDIR}/group for os in linux osx solaris; do echo $os > ${MOCKDIR}/id_os # Case 1: Amanda_user is correct. echo ${amanda_group} > ${MOCKDIR}/id_group check_user_group "${amanda_group}" assertEquals "'check_user_group ${amanda_group}': id returns correct groupname" \ 0 $? # Case 2: Amanda_user is not a member of the the correct primary group. rm ${MOCKDIR}/id_group check_user_group "${amanda_group}" assertEquals "'check_user_group ${amanda_group}' when not a member" 1 $? done } test_check_user_supplemental_group_missing() { logger "test_check_user_supplemental_group missing" [ ! "$IAmRoot" ] && echo $good_group_entry > ${SYSCONFDIR}/group for os in linux osx solaris; do echo $os > ${MOCKDIR}/id_os check_user_supplemental_group ${sup_group} assertEquals "'check_user supplemental-group ${sup_group}' when group missing" \ 1 $? done } missing_group_member="${sup_group}:x:105:nobody" export missing_group_member good_sup_group_entry="${missing_group_member},${amanda_user}" export good_sup_group_entry test_check_user_supplemental_group_exists() { logger "test_check_user_supplemental_group exists" [ ! "$IAmRoot" ] && echo $missing_group_member > ${SYSCONFDIR}/group check_user_supplemental_group ${sup_group} assertEquals "'check_user_supplemental_group ${sup_group}' when amanda_user is not a member" \ 1 $? [ ! "$IAmRoot" ] && echo ${good_sup_group_entry} > ${SYSCONFDIR}/group check_user_supplemental_group ${sup_group} assertEquals "'check_user_supplemental_group ${sup_group}' with correct membership" \ 0 $? } test_check_user_shell() { logger "test_check_user_shell" if [ ! "$IAmRoot" ]; then echo "${good_passwd_entry}" > ${SYSCONFDIR}/passwd fi # Case 1: Provide a matching shell check_user_shell "/bin/bash" assertEquals "check_user_shell /bin/bash (matching)" 0 $? # Case 2: Provide a non-matching shell. check_user_shell "/bin/ksh" assertEquals "check_user_shell /bin/ksh (not matching)" 1 $? } test_check_user_homedir() { logger 'test_check_user_homedir' if [ ! "$IAmRoot" ]; then echo "${good_passwd_entry}" > ${SYSCONFDIR}/passwd fi # Case 1: Assume amanda_user is correct. check_user_homedir "${AMANDAHOMEDIR}" assertEquals "check_user_homedir ${AMANDAHOMEDIR}" 0 $? # Case 2: Provide an incorrect homedir check_user_homedir "/tmp" assertEquals "check_user_homedir /tmp" 1 $? } test_check_user_uid() { echo "${amanda_group}" > ${MOCKDIR}/id_group touch ${MOCKDIR}/id_exists logger 'test_check_user_uid' for os in linux osx solaris; do echo $os > ${MOCKDIR}/id_os check_user_uid assertEquals "check_user_uid without a uid" 1 $? logger 'test_check_user_uid wrong id' check_user_uid 123 assertEquals "check_user_uid uids don't match" 1 $? logger 'test_check_user_uid correct id' check_user_uid ${deb_uid} done } test_check_homedir_dir_missing() { logger "test_check_homedir_dir_missing" # First make sure the dir is missing rm -rf ${AMANDAHOMEDIR} check_homedir assertNotEquals "check_homedir returned 0, but homedir did not exist" 0 $? } # passwd file entry for Linux systems, maybe others. UID is correct # for Debian as well. good_passwd_entry="${amanda_user}:x:${mock_deb_uid}:6::${AMANDAHOMEDIR}:/bin/bash" export good_passwd_entry test_create_user() { logger "test_create_user" if [ ! "$IAmRoot" ]; then startSkipping echo "test_create_user: Creating mock passwd file." echo "$good_passwd_entry" > ${SYSCONFDIR}/passwd echo "test_create_user: tests skipped." #TODO: mock useradd. return fi # Case 1: create_user should succeed. create_user assertEquals "create_user()" 0 $? } test_add_profiles() { # Solaris only, but testing using mock usermod will run if not root # on any system. logger "test_add_profiles" [ "$IAmRoot" ] && startSkipping add_profiles "Profile foo,Profile bar" assertEquals "add_profiles should succeed" 0 $? flags=`cat ${mock_usermod_flags}` assertEquals "usermod_flags should contain:" \ "usermod args: -P \"Profile foo,Profile bar\" ${amanda_user}" \ "${flags}" } test_add_group_check_parameters_logs() { rm -f ${MOCKDIR}/groupadd_rc ${MOCKDIR}/num_groups # Return codes are integers. printf '%i' 0 > ${MOCKDIR}/groupadd_rc # Test that first parameter is required. add_group assertEquals "add_group without a group should fail." 1 $? log_tail_no_stamp assertEquals "add_group should write" \ "Error: first argument was not a group to add." \ "${LOG_TAIL}" } test_add_group_group_ok() { # groupadd created group printf '%i' 0 > ${MOCKDIR}/groupadd_rc echo '${amanda_user} : prev_grp1' > ${MOCKDIR}/groups_output add_group twinkle assertEquals "add_group group ok" 0 $? flags=`cat ${mock_usermod_flags}` assertEquals "usermod_flags" \ "usermod args: -G prev_grp1,twinkle ${amanda_user}" \ "${flags}" # Make sure supplemental groups are preserved when adding groups to an # existing account echo '${amanda_user} : prev_grp1 prev_grp2' > ${MOCKDIR}/groups_output printf '%i' 1 > ${MOCKDIR}/num_groups add_group twinkle assertEquals "add_group group ok" 0 $? flags=`cat ${mock_usermod_flags}` assertEquals "usermod_flags should contain:" \ "usermod args: -G prev_grp1,prev_grp2,twinkle ${amanda_user}" \ "${flags}" } test_create_homedir() { logger "test_create_homedir" rm -rf ${AMANDAHOMEDIR} create_homedir assertEquals "create_homedir returns 0" 0 $? assertTrue "${AMANDAHOMEDIR} did not get created" "[ -d ${AMANDAHOMEDIR} ]" if [ "$IAmRoot" ]; then # Check real owner real_owner=`ls -ld $AMANDAHOMEDIR | awk '{ print $3":"$4; }'` assertSame "${amanda_user}:${amanda_group}" "$real_owner" else assertSame \ "chown args: -R ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}" \ "`cat $mock_chown_flags`" fi # A second run should succeed too. create_homedir assertEquals "When homedir exists, create_homedir returns 0:" 0 $? # Later tests use ${AMANDAHOMEDIR}, so leave the dir there. } test_check_homedir_dir_existing() { logger "test_check_homedir_dir_existing" # Create the dir (example needed for other tests), then check again. mkdir -p ${AMANDAHOMEDIR}/example check_homedir assertEquals "Homedir exists; check_homedir" 0 $? } test_create_logdir() { logger "test_create_logdir" # The logdir variable for the shell libs, not shunit2. LOGDIR=$TMPDIR/amanda_log; export LOGDIR rm -rf ${LOGDIR} rm -rf ${LOGDIR}.save create_logdir assertEquals "create_logdir clean system" 0 $? if [ -n "$IAmRoot" ]; then real_owner=`ls -ld $LOGDIR | awk '{ print $3":"$4; }'` assertSame "${amanda_user}:${amanda_group}" "$real_owner" else assertSame \ "chown args: -R ${amanda_user}:${amanda_group} ${LOGDIR}"\ "`cat $mock_chown_flags`" fi assertTrue "${LOGDIR} exists" "[ -d ${LOGDIR} ]" # What happens if logdir is a file? rm -rf ${LOGDIR} touch ${LOGDIR} create_logdir assertEquals "create_logdir" 0 $? assertTrue "${LOGDIR} exists" "[ -d ${LOGDIR} ]" assertTrue "${LOGDIR}/amanda_log.save backup exists" \ "[ -f ${LOGDIR}/amanda_log.save ]" } test_create_amandates() { logger "test_create_amandates" rm -f ${AMANDATES} create_amandates assertEquals "create_amandates" 0 $? assertTrue "[ -f ${AMANDATES} ]" } test_check_amandates() { logger "test_check_amandates" touch $mock_chown_flags touch $mock_chmod_flags check_amandates assertEquals "check_amandates" 0 $? [ "$IAmRoot" ] && { startSkipping; echo "test_check_amandates: skipped"; } assertSame \ "chown args: ${amanda_user}:${amanda_group} ${AMANDATES}" \ "`cat $mock_chown_flags`" assertSame \ "chmod args: 0640 ${AMANDATES}" \ "`cat $mock_chmod_flags`" } test_a_create_gnupg() { # We need to impose some order on a few tests because some functions # rely on others. Tests are sorted alphabetically. Insert a letter after # "test_" to impose order on particular tests logger "test_create_gnupg" create_gnupg assertEquals "create_gnupg" 0 $? assertTrue "[ -d ${AMANDAHOMEDIR}/.gnupg ]" # Dir exists create_gnupg assertEquals "create_gnupg dir existing" 0 $? } test_a_get_random_lines() { logger "test_get_random_lines" get_random_lines > ${TMPDIR}/lines assertEquals "get_random_lines" 1 $? get_random_lines 1 > ${TMPDIR}/lines assertEquals "get_random_lines 1" 0 $? assertEquals "get_random_lines 1 output" 1 "`sed -n '$=' ${TMPDIR}/lines`" get_random_lines 20 > ${TMPDIR}/lines assertEquals "get_random_lines 20 output" 20 "`sed -n '$=' ${TMPDIR}/lines`" } test_b_create_ampassphrase() { rm -f ${AMANDAHOMEDIR}/.am_passphrase logger "test_create_ampassphrase" create_ampassphrase assertEquals "create_ampassphrase" 0 $? assertSame \ "chown args: ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.am_passphrase" \ "`cat $mock_chown_flags`" assertSame \ "chmod args: 0600 ${AMANDAHOMEDIR}/.am_passphrase" \ "`cat $mock_chmod_flags`" # When .am_passphrase exists. create_ampassphrase log_tail_no_stamp assertSame \ "Info: ${AMANDAHOMEDIR}/.am_passphrase already exists." \ "${LOG_TAIL}" rm ${AMANDAHOMEDIR}/.am_passphrase } test_b_create_amkey() { logger "test_create_amkey" # Missing .am_passphrase [ -f ${AMANDAHOMEDIR}/.am_passphrase ] && rm ${AMANDAHOMEDIR}/.am_passphrase create_amkey assertEquals "create_amkey" 1 $? log_tail_no_stamp assertSame \ "Error: ${AMANDAHOMEDIR}/.am_passphrase is missing, can't create amcrypt key." \ "${LOG_TAIL}" # Need .am_passphrase. Ignore these test errors if get_random_lines or # create_gnupg tests failed. get_random_lines 1 > ${AMANDAHOMEDIR}/.am_passphrase create_amkey assertEquals "create_amkey" 0 $? # Test with existing key create_amkey assertEquals "create_amkey" 0 $? log_tail_no_stamp assertSame \ "Info: Encryption key '${AMANDAHOMEDIR}/.gnupg/am_key.gpg' already exists." \ "${LOG_TAIL}" # make sure unencrypted am_key is not hanging around assertFalse "[ -f ${AMANDAHOMEDIR}/.gnupg/am_key ]" } test_check_gnupg() { logger "test_check_gnupg" check_gnupg assertEquals "check_gnupg" 0 $? assertSame \ "chown args: -R ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.gnupg" \ "`cat $mock_chown_flags`" assertSame \ "chmod args: -R u=rwX,go= ${AMANDAHOMEDIR}/.gnupg" \ "`cat $mock_chmod_flags`" } test_create_amandahosts() { logger "test_create_amandahosts" create_amandahosts assertEquals "create_amandahosts:" 0 $? assertEquals "${AMANDAHOMEDIR}/.amandahosts exists:" 0 $? assertEquals "create_amandahosts" 0 $? assertTrue "[ -f ${AMANDAHOMEDIR}/.amandahosts ]" } test_check_amandahosts_entry() { logger "test_check_amandahosts_entry" if [ -f ${AMANDAHOMEDIR}/.amandahosts ]; then check_amandahosts_entry root amindexd amidxtaped assertEquals "check_amandahosts_entry root amindexd amidxtaped" \ 0 $? else echo "test_check_amandahosts_entry: ${AMANDAHOMEDIR}/.amandahosts missing. test skipped" startSkipping fi } test_check_amandahosts_perm() { logger "test_check_amandahosts_perm" check_amandahosts_perms assertEquals "check_amandahosts_perms" 0 $? [ "$IAmRoot" ] && { startSkipping; echo "test_check_amandahosts_perm: skipped"; } assertSame \ "chown args: ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.amandahosts" \ "`cat $mock_chown_flags`" assertSame \ "chmod args: 0600 ${AMANDAHOMEDIR}/.amandahosts" \ "`cat $mock_chmod_flags`" } test_create_ssh_key() { logger "test_create_ssh_key" keydir=${AMANDAHOMEDIR}/.ssh rm -rf ${keydir} create_ssh_key server assertEquals "create_ssh_key" 0 $? assertTrue "[ -f ${keydir}/id_rsa_amdump ]" [ "$IAmRoot" ] && { startSkipping; echo "test_create_ssh_key: skipped"; } assertSame \ "chown args: ${amanda_user}:${amanda_group} ${keydir} ${keydir}/id_rsa_amdump ${keydir}/id_rsa_amdump.pub" \ "`cat $mock_chown_flags`" # Chmod is called twice, but we only get the 2nd invocation. assertSame \ "chmod args: 0600 ${keydir}/id_rsa_amdump ${keydir}/id_rsa_amdump.pub" \ "`cat $mock_chmod_flags`" endSkipping rm -rf ${keydir} # What happens if .ssh is a file? touch ${AMANDAHOMEDIR}/.ssh create_ssh_key client assertEquals "create_ssh_key" 0 $? assertTrue "[ -f ${keydir}.save ]" assertTrue "[ -f ${keydir}/id_rsa_amrecover ]" } test_create_profile() { logger "test_create_profile" rm -f ${AMANDAHOMEDIR}/.profile create_profile assertEquals "create_profile" 0 $? assertTrue "[ -f ${AMANDAHOMEDIR}/.profile ]" } test_check_profile() { logger "test_check_profile" [ -f "${AMANDAHOMEDIR}/.profile" ] || touch ${AMANDAHOMEDIR}/.profile check_profile assertEquals "check_profile" 0 $? assertTrue "[ -s ${AMANDAHOMEDIR}/.profile ]" [ "$IAmRoot" ] && { startSkipping; echo "test_check_profile: skipped"; } assertSame \ "chown args: ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.profile" \ "`cat $mock_chown_flags`" assertSame \ "chmod args: 0640 ${AMANDAHOMEDIR}/.profile" \ "`cat $mock_chmod_flags`" } test_install_client_conf() { logger "test_install_client_conf" # Test success touch ${MOCKDIR}/success install_client_conf assertEquals "install_client_conf" 0 $? prefix="install args:" inst_files="${AMANDAHOMEDIR}/example/amanda-client.conf ${SYSCONFDIR}/amanda/" case $os in SunOS) assertSame \ "`cat $mock_install_flags`" \ "${prefix} -m 0600 -u ${amanda_user} -g ${amanda_group} ${inst_files}" ;; *) assertSame \ "`cat $mock_install_flags`" \ "${prefix} -m 0600 -o ${amanda_user} -g ${amanda_group} ${inst_files}" esac } #TODO: create_amtmp ###################################### #TODO: post_rm_functions # Run a single test, or let shunit run all tests if [ $# -gt 0 ]; then echo $1 SPECIFIC_TESTS="$*" suite() { suite_addTest test___logger suite_addTest test__log_output_of for t in $SPECIFIC_TESTS; do suite_addTest $t done } fi # Importing shunit2 triggers test enumeration, so must happen after # all tests are defined. . ${SHUNIT_INC}/shunit2 echo "shunit2 log is: ${LOGFILE}" echo "mockdir is: ${MOCKDIR}" amanda-3.3.6/packaging/common/post_rm_functions.sh0000664000076400007640000000164412357250001023763 0ustar00martineamartinea00000000000000#!/bin/sh # ------------- Begin Post Removal Functions ----------------- # Functions used for post removal actions rm_xinetd() { # Remove the xinetd configuration file $1. check_xinetd should be # executed first. logger "Removing xinetd configuration $1" log_output_of rm ${SYSCONFDIR}/xinetd.d/$1 } rm_inetd() { # Remove amanda entries from inetd.conf logger "Removing amanda's inetd.conf entries" log_output_of sed -i "/^amanda .* amandad/d" } rm_smf() { # Remove the amanda service from solaris style service framework. ret=0; export ret logger "Removing amanda's smf entry" log_output_of svcadm disable $1 || { ret=1; } log_output_of svccfg delete $1 || { ret=1; } return $ret } rm_user() { # Delete the user provided as first parameter ($1) logger "Deleting user: $1" log_output_of userdel $1 } # ------------- End Post Removal Functions ----------------- amanda-3.3.6/packaging/common/common_functions.sh0000664000076400007640000001734612357250001023576 0ustar00martineamartinea00000000000000#!/bin/sh # Common Functions # Required variables: # LOGFILE # SYSCONFDIR # os logger() { # A non-annoying way to log stuff # ${@} is all the parameters, also known as the message. Quoting the input # preserves whitespace. msg="`date +'%b %d %Y %T'`: ${@}" echo "${msg}" >> ${LOGFILE} } log_output_of() { # A non-annoying way to log output of commands # ${@} is all the parameters supplied to the function. just execute it, # and capture the output in a variable. then log that. output=`"${@}" 2>&1` ret=$? if [ -n "${output}" ] ; then logger "${1}: ${output}" fi return ${ret} } check_superserver() { # Check for the superserver $1 for the config $2 case $1 in xinetd) check_xinetd $2; return $?;; inetd) check_inetd $2; return $?;; launchd) check_launchd $2; return $?;; smf) check_smf $2; return $?;; esac } check_xinetd() { # Checks for an xinetd install and a config name passed as the first # parameter. # Returns: # 0 if the file exists, # 1 if it does not, # 2 if xinetd.d/ does not exist or is a file if [ -d ${SYSCONFDIR}/xinetd.d ] ; then if [ -f ${SYSCONFDIR}/xinetd.d/${1} ] ; then logger "Found existing xinetd config: ${1}" return 0 else return 1 fi else # No xinetd installation. return 2 fi } check_inetd() { case $os in SunOS) inetd_conf=${SYSCONFDIR}/inet/inetd.conf ;; *) inetd_conf=${SYSCONFDIR}/inetd.conf ;; esac if [ -e ${inetd_conf} ] ; then if grep "${1}" ${inetd_conf} > /dev/null ; then logger "Found existing inetd config: ${1}" return 0 else return 1 fi else # No inetd installation. return 2 fi } check_launchd() { # TODO: refactor OS X scripts. : } check_smf() { # Only for solaris! This check only notices if an amanda service is active, # it does not notice server vs client entries. log_output_of svcs -H "*amanda*" || { \ logger "No amanda service found."; return 1; } } check_superserver_running() { # Check for the given superserver, $1, in the output of ps -ef, or on # mac/bsd ps ax. # Return codes: # 0: $1 is running # 1: $1 is not running # 2: $1 is not valid for this system case $1 in # Linux or Solaris. This works despite sol10 using SMF. inetd) ps_flags='-e';; xinetd) ps_flags='-e';; # Mac OS X launchd) ps_flags='aux';; *) echo "Bad superserver."; return 2 ;; esac if [ "$1" = "launchd" ] && [ `uname` != 'Darwin' ]; then echo "Only darwin uses launchd" return 2 fi if [ "$1" = "xinetd" ] && [ "$os" = 'SunOS' ] && \ [ `uname -r` = "5.10" ]; then echo "Solaris 10 does not use xinetd." return 2 fi # Search for $1, PROC=`ps ${ps_flags} | grep -v 'grep'| grep "${1}"` if [ x"${PROC}" != x ]; then return 0 else return 1 fi } backup_xinetd() { log_output_of mv ${SYSCONFDIR}/xinetd.d/${1} ${AMANDAHOMEDIR}/example/xinetd.${1}.orig || \ { logger "WARNING: Could not back up existing xinetd configuration '${1}'"; return 1; } logger "Old xinetd config for '${1}' backed up to '${AMANDAHOMEDIR}/example/xinetd.${1}.orig'" } backup_inetd() { case $os in SunOS) inetd_conf=${SYSCONFDIR}/inet/inetd.conf ;; *) inetd_conf=${SYSCONFDIR}/inetd.conf ;; esac # Backs up any amanda configuration it finds log_output_of sed -n "/^amanda .* amandad/w ${AMANDAHOMEDIR}/example/inetd.orig" ${inetd_conf} || \ { logger "WARNING: could not write ${AMANDAHOMEDIR}/example/inetd.orig"; return 1; } log_output_of sed "/^amanda .* amandad/d" ${inetd_conf} > \ ${inetd_conf}.tmp || \ { logger "WARNING: could not write ${inetd_conf}.tmp"; return 1; } log_output_of mv ${inetd_conf}.tmp ${inetd_conf} || \ { logger "WARNING: could not overwrite ${inetd_conf}, old config not removed."; return 1; } logger "Old inetd config for amanda backed up to ${AMANDAHOMEDIR}/example/inetd.orig" } backup_smf() { # Solaris only. I *think* this should be consistent across all smf installs svccfg -s *amanda* > ${AMANDAHOMEDIR}/example/amanda_smf.xml.orig || {\ logger "Warning: export of existing amanda service failed."; return 1; } log_output_of inetadm -d *amanda* || { \ # Not critical, we don't need to return if this fails. logger "Warning: disabling existing amanda service failed."; } log_output_of svccfg delete -f *amanda* || { \ logger "Error: removing the old amanda service failed."; return 1; } } install_xinetd() { log_output_of install -m 0644 ${AMANDAHOMEDIR}/example/xinetd.${1} ${SYSCONFDIR}/xinetd.d/${1} || \ { logger "WARNING: Could not install xinetd configuration '${1}'" ; return 1; } logger "Installed xinetd config for ${1}." } install_inetd() { case $os in SunOS) inetd_conf=${SYSCONFDIR}/inet/inetd.conf ;; *) inetd_conf=${SYSCONFDIR}/inetd.conf ;; esac # This one is hard to log because we're just appending. logger "Appending ${AMANDAHOMEDIR}/example/inetd.conf.${1} to ${inetd_conf}" cat ${AMANDAHOMEDIR}/example/inetd.conf.${1} >> ${inetd_conf} } install_smf() { # First parameter should be the name of the service to install # (amandaserver, or amandaclient). ver=`uname -r` case $ver in 5.10) # Use inetadm and svcadm. log_output_of ${basedir}/usr/sbin/inetconv -f -i ${AMANDAHOMEDIR}/example/inetd.conf.${1} || { \ logger "Warning: Failed to create Amanda SMF manifest. Check the system log."; return 1; } log_output_of ${basedir}/usr/sbin/inetadm -e svc:/network/amanda/tcp || { \ logger "Warning: Failed to enable Amanda service. See system log for more information."; return 1; } log_output_of ${basedir}/usr/sbin/svcadm restart network/amanda/tcp || { \ logger "Warning: Failed to restart Amanda service. See system log for details."; return 1; } ;; 5.8|5.9) logger "Solaris 8 and 9 use inetd, not SMF tools." return 1 ;; *) # I don't know what to do... logger "ERROR: Unsupported and untested version of Solaris: $ver" return 1 ;; esac } reload_xinetd() { # Default action is to try reload. case $1 in reload|restart|start) action=$1 ;; "") action=reload ;; *) logger "WARNING: bad argument to reload_xinetd: $1" return 1 ;; esac if [ "$action" = "reload" ] ; then logger "Reloading xinetd configuration..." log_output_of ${SYSCONFDIR}/init.d/xinetd $action # Don't exit! if [ $? -ne 0 ] ; then logger "xinetd reload failed. Attempting restart..." action=restart fi fi if [ "$action" = "restart" ] || [ "$action" = "start" ]; then logger "${action}ing xinetd." log_output_of ${SYSCONFDIR}/init.d/xinetd $action || \ { logger "WARNING: $action failed." ; return 1; } fi } reload_inetd() { # Default action is to try reload. if [ "x$1" = "x" ]; then action="reload" elif [ "$1" = "reload" ] || [ "$1" = "restart" ]; then action="$1" else logger "WARNING: bad argument to reload_inetd: $1" return 1 fi if [ "$1" = "reload" ] ; then logger "Reloading inetd configuration..." log_output_of ${SYSCONFDIR}/init.d/inetd $1 # Don't exit! if [ $? -ne 0 ] ; then logger "inetd reload failed. Attempting restart..." log_output_of ${SYSCONFDIR}/init.d/inetd restart || \ { logger "WARNING: restart failed." ; return 1; } fi else # Must be restart... logger "Restarting inetd." log_output_of ${SYSCONFDIR}/init.d/inetd $1 || \ { logger "WARNING: ${1} failed." ; return 1; } fi } # End Common functions amanda-3.3.6/packaging/common/mock_utils.sh0000664000076400007640000001215312357250001022356 0ustar00martineamartinea00000000000000#!/bin/sh ## Mock builtin utilities # These should preempt builtin programs. # They should print expected output on STDOUT, and write given arguments to # mock__flags. Be sure to overwrite this file, not append! If they need # to act differently depending on a condition, use temp files in $MOCKDIR, and # delete when you're done. (Solaris shell does not re-export environment # variables correctly). MOCKDIR=$TMPDIR/mocks; export MOCKDIR [ -d $MOCKDIR ] || mkdir $MOCKDIR PATH=${MOCKDIR}:$PATH; export PATH # A list of flag files that must be present to avoid spurious output. # Each mock util gets one whether it is used or not. mock_flag_files="" mk_mock_util() { if [ ! "$IAmRoot" ]; then # The repetitive stuff cat << EOF > "$MOCKDIR/$1" #!/bin/sh EOF /bin/chmod u+x $MOCKDIR/$1 else touch $MOCKDIR/$1 fi # Dynamic var names are ugly in shell, but useful. eval mock_$1_flags=\$MOCKDIR/mock_\$1_flags eval export mock_$1_flags # Append to the list of flag files mock_flag_files="$mock_flag_files mock_$1_flags" } ############### # ps replacement mk_mock_util "ps" cat << EOF >> "${MOCKDIR}/ps" echo "ps args: \${@}" > $mock_ps_flags if [ -f "${MOCKDIR}/running" ]; then ps_list="inetd xinetd launchd" else ps_list="foo bar baz" fi echo "faux process list: \$ps_list" EOF ############### # chown replacement mk_mock_util "chown" cat << EOF >> "${MOCKDIR}/chown" echo "chown args: \${@}" > $mock_chown_flags EOF ############### # chmod replacement mk_mock_util "chmod" cat << EOF >> "${MOCKDIR}/chmod" echo "chmod args: \${@}" > $mock_chmod_flags EOF ############### # id replacemnt # Set vars for output of -Gn id_0="biff" id_1="biff foo" id_2="biff bar baz" id_3="biff zip bop whir" # Set defaults for uid and amanda_group, if running outside test_sh_libs deb_uid=${deb_uid:=12345} amanda_group=${amanda_group:=disk} mk_mock_util "id" cat << EOF >> "${MOCKDIR}/id" echo "id args: \${@}" > $mock_id_flags [ -n "\${1}" ] || { echo "Missing a username to id!"; exit 1; } # We can only use id with no flags to have consistent results. Solaris # /usr/bin/id does not provide any standard flags. Since /usr/xpg4/bin is # not part of a minimal install we can't depend on it. Any flags *at all* # should raise an error in the tests. # group file and /usr/bin/groups can be used (with some tweaks). for f in "\$@"; do case \$f in # -- is ok, surprisingly. --) : ;; -?*) echo "id: no options are portable! '\$f'" # Solaris exits with 2, others with 1. ugh. exit 2 ;; *) : ;; esac done # Use id_group to control primary group name. [ -f ${MOCKDIR}/id_group ] && group=\`cat ${MOCKDIR}/id_group\` || group=bar # Solaris, Linux and OSX differ in the exact format of the output from id, # so we provide sample output based on the contents of id_os. We don't # parse it, but its presence can't break things. test_os=\`cat ${MOCKDIR}/id_os\` case \${test_os} in linux) sup_groups=" groups=999(\${group}),1000(foo)" ;; solaris) sup_groups="" ;; osx) sup_groups=" groups=999(\${group}), 1000(foo)" ;; esac if [ -f ${MOCKDIR}/id_exists ]; then # Note: uid is set when the mock is created. echo "uid=${deb_uid}(\${1}) gid=6(\${group})\${sup_groups}" else echo "id: \${1}: no such user" >&2 exit 1 fi EOF ############### # groupadd replacement mk_mock_util "groupadd" cat << EOF >> "${MOCKDIR}/groupadd" echo "groupadd args: \${@}" > $mock_groupadd_flags # We check for return codes of 0 (group added) or 9 (group existed) to # continue in the function that uses groupadd groupadd_rc=\`cat ${MOCKDIR}/groupadd_rc\` exit \${groupadd_rc} EOF ############### # groups replacement mk_mock_util "groups" cat << EOF >> "${MOCKDIR}/groups" echo "groups args: \${@}" > $mock_groups_flags cat ${MOCKDIR}/groups_output EOF ############### # usermod replacement mk_mock_util "usermod" cat << EOF >> "${MOCKDIR}/usermod" echo "usermod args: \${@}" > $mock_usermod_flags # Protect against passing a blank username. [ "x\${1}" = "x" ] && exit 2 || exit 0 EOF ############### # svcs replacement mk_mock_util "svcs" cat << EOF >> "${MOCKDIR}/svcs" echo "svcs args: \${@}" > $mock_svcs_flags if [ -f "${MOCKDIR}/prexisting_service" ]; then echo "online Sep_09 svc:/network/amanda/tcp:default" else echo "Pattern '\${3}' doesn't match any instances" exit 1 fi EOF ############### # xinetd init script replacement mk_mock_util xinetd cat << EOF >> "${MOCKDIR}/xinetd" echo "xinetd args: \${@}" > $mock_xinetd_flags [ -f ${MOCKDIR}/success ] && exit 0 echo "xinetd did not \${1}" exit 1 EOF ############### # inetd init script replacement mk_mock_util inetd cat << EOF >> "${MOCKDIR}/inetd" echo "inetd args: \${@}" > $mock_inetd_flags [ -f ${MOCKDIR}/success ] && exit 0 echo "inetd did not \${1}" exit 1 EOF ############### # install replacement mk_mock_util install cat << EOF >> "${MOCKDIR}/install" echo "install args: \${@}" > $mock_install_flags [ -f ${MOCKDIR}/success ] && exit 0 echo "Some funky install error, yo!" exit 1 EOF # TODO: inetconv inetadm, svcadm # Touch all the flag files for file in $mock_flag_files; do touch $MOCKDIR/$file done amanda-3.3.6/packaging/common/pre_inst_functions.sh0000664000076400007640000002665612357250001024135 0ustar00martineamartinea00000000000000#!/bin/sh # These functions are included by various different installers. # We assume that the following variables are defined in the main script: # amanda_user: the amanda account username # amanda_group: the amanda account's group # amandahomedir: a directory to use as amanda's home # deb_uid: sepecific uid amanda_user should get on deb style systems. # dist: used on linux for the distro. # LOGFILE: a log file we append to # os: Linux, Darwin, SunOS, `uname`... # wanted_shell: Linux/SunOS/OSX all keep them in different places # SYSCONFDIR: location of system config files (ie, /etc) # LOGDIR: logging directory for amanda # These variables are defined, but null to allow checking names checked_uid= export checked_uid # PreInstall Functions create_user() { case $os in Linux|SunOS) # Create the amanda user with a specific uid on deb systems if [ "x${dist}" = "xDebian" ] || [ "x${dist}" = "xUbuntu" ] ; then uid_flag="-u ${deb_uid}" else uid_flag= fi logger "Checking for user: ${amanda_user}" # we want the output of id, but if the user doesn't exist, # sterr output just confuses things ID=`id ${amanda_user} 2> /dev/null | sed 's/uid=\([0-9]*\).*/\1/'` if [ "${ID}x" = "x" ] ; then logger "Adding ${amanda_user}." log_output_of useradd -c "Amanda" \ -g ${amanda_group} \ ${uid_flag} \ -d ${AMANDAHOMEDIR} \ -s ${wanted_shell} ${amanda_user} || \ { logger "WARNING: Could not create user ${amanda_user}. Installation will fail." ; return 1 ; } logger "Created ${amanda_user} with blank password." if [ "x$os" = "xLinux" ] && [ "x${dist}" != "xSuSE" ]; then # Lock the amanda account until admin sets password log_output_of passwd -l ${amanda_user} && { \ logger "${info_create_user_success}" logger "${info_unlock_account}" } || { \ logger "${warning_user_passwd}"; } fi if [ "x$os" = "xSunOS" ]; then r=`uname -r` case $r in 5.8|5.9) log_output_of passwd -l ${amanda_user} ;; 5.10) # Special login-lock, while allowing execution. log_output_of passwd -N ${amanda_user} && { \ logger "${info_create_user_success_sol}" logger "${info_unlock_account}" } || { \ logger "${warning_user_passwd}"; } ;; esac fi else # The user already existed logger "The Amanda user '${amanda_user}' exists on this system." fi ;; Darwin) : #TODO ;; esac } add_profiles() { # Solaris only: Add a comma separated list of rights profiles to the # $amanda_user. Replaces any existing profiles listed on the account. log_output_of usermod -P "\"$*\"" ${amanda_user} || { logger "Warning: Rights profiles were not added. Some types of backup may not work until these rights profiles are givent to ${amanda_backup}: '$*'" return 1; } } add_group() { # First, try to add the group, detect via return code if it # already exists. Then add ${amanda_user} to the group without # checking if account is already a member. (check_user should # already have been called). # # Works on linux and solaris. OSX has different tools. [ "x${1}" = "x" ] && { logger "Error: first argument was not a group to add." ; return 1 ; } group_to_add=${1} log_output_of groupadd ${group_to_add} rc=$? # return of 0 means group was added; 9 means group existed. if [ $rc -eq 0 ] || [ $rc -eq 9 ]; then logger "Adding ${amanda_user} to ${group_to_add}" # Generate a comma separated list of existing supplemental groups. # Linux prefaces output with ' : '. existing_sup_groups=`groups ${amanda_user}|sed 's/.*: //;s/ /,/g'` # usermod append is -A on Suse, all other linux use -a, and # -A means something else entirely on solaris. So we just use # -G, and append a list of the current groups from id. # So far, all linux distros have usermod log_output_of usermod -G ${existing_sup_groups},${group_to_add} ${amanda_user} || { \ logger "Nonfatal ERROR: Failed to add ${group_to_add}." logger "${error_group_member}" ; return 1 ; } else logger "Error: groupadd failed in an unexpected way. return code='$rc'" return 1 fi } # All check_user_* functions check various parameters of ${amanda_user}'s # account. Return codes: # 0 = success # 1 = error # 2 = usage or other error. more info will be logged check_user_group() { # checks the system group file for ${amanda_user}'s membership in # the group named $1. err=0 [ "x" = "x$1" ] && { logger "check_user_group: no group given"; return 1; } logger "Verify ${amanda_user}'s primary group = $1 " # Check if the group exists, disregarding membership. group_entry=`grep "^${2}" ${SYSCONFDIR}/group 2> /dev/null` if [ ! "x" = "x${group_entry}" ]; then # Assume the user exists, and check the user's primary group. GROUP=`id ${amanda_user} 2> /dev/null |\ cut -d " " -f 2 |\ sed 's/.*gid=[0-9]*(\([^ ()]*\))/\1/'` if [ ! "x${GROUP}" = "x${1}" ] ; then logger "${amanda_user} not a member of ${1}" err=1 fi else logger "User's primary group '${1}' does not exist" err=1 fi return $err } check_user_supplemental_group() { # Checks for the group ${1}, and adds ${amanda_user} if missing. # Other groups are preserved. err=0 [ "x" = "x$1" ] && { logger "check_user_supplemental_group: no supplemental group given"; return 1; } sup_group=${1} logger "Verify ${amanda_user} is a member of ${sup_group}." # First, check if the supplementary group exists. sup_group_entry=`grep "${sup_group}" ${SYSCONFDIR}/group 2>/dev/null` if [ ! "x" = "x${sup_group_entry}" ]; then SUP_MEM=`echo ${sup_group_entry} | cut -d: -f4` # Check if our user is a member. case ${SUP_MEM} in *${amanda_user}*) : ;; *) logger "${amanda_user} is not a member of supplemental group ${sup_group}." err=1 ;; esac else logger "Supplemental group ${sup_group} does not exist" err=1 fi return $err } check_user_shell() { # Confirms the passwd file's shell field for ${amanda_user} is $1 [ "x" = "x$1" ] && { logger "check_user_shell: no shell given"; return 1; } wanted_shell=$1; export wanted_shell logger "Verify ${amanda_user}'s shell is ${wanted_shell}." real_shell=`grep "^${amanda_user}" ${SYSCONFDIR}/passwd | cut -d: -f7` export real_shell if [ ! "x${real_shell}" = "x${wanted_shell}" ] ; then logger "WARNING: ${amanda_user} default shell= ${wanted_shell}" logger "WARNING: ${amanda_user} existing shell: ${real_shell}" logger "${warning_user_shell}" return 1 fi } check_user_homedir() { # Confirm the passwd file's homedir field for ${amanda_user} is $1 [ "x" = "x$1" ] && { logger "check_user_homedir: no homedir given"; return 1; } HOMEDIR=`grep "^${amanda_user}" ${SYSCONFDIR}/passwd | cut -d: -f6` if [ ! "x${HOMEDIR}" = "x${1}" ] ; then logger "${warning_user_homedir}" return 1 fi } check_user_uid() { # Confirm that ${amanda_user}'s UID is $1. # Debian systems must use a specific UID [ "x" = "x$1" ] && { logger "check_user_uid: no uid given"; return 1; } ID=`id ${amanda_user} 2> /dev/null | sed 's/uid=\([0-9]*\).*/\1/'` if [ ! ${ID} -eq ${1} ] ; then checked_uid=${1}; export checked_uid logger "${warning_user_uid_debian}" return 1 fi } check_homedir() { # Checks that the homedir has correct permissions and belongs to correct # user. Uses $amanda_user and $amanda_group. if [ -d ${AMANDAHOMEDIR} ] ; then OWNER_GROUP=`ls -dl ${AMANDAHOMEDIR} | awk '{ print $3" "$4; }'` [ "x$OWNER_GROUP" = "x${amanda_user} ${amanda_group}" ] || \ logger "${warning_homedir_owner}" return $? else logger "homedir ${AMANDAHOMEDIR} does not exist." return 1 fi } create_homedir() { # Creates the homedir, if necessary, and fixes ownership. if [ ! -d ${AMANDAHOMEDIR} ] ; then logger "Creating ${AMANDAHOMEDIR}" log_output_of mkdir -p -m 0750 ${AMANDAHOMEDIR} || { logger "WARNING: Could not create ${AMANDAHOMEDIR}" ; return 1 ; } fi log_output_of chown -R ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR} || { logger "WARNING: Could not chown ${AMANDAHOMEDIR}" ; return 1 ; } } create_logdir() { if [ -d ${LOGDIR} ] || [ -f ${LOGDIR} ] ; then logger "Found existing ${LOGDIR}" log_output_of mv ${LOGDIR} ${LOGDIR}.save || \ { logger "WARNING: Could not backup existing log directory: ${LOGDIR}" ; return 1 ; } fi logger "Creating ${LOGDIR}." log_output_of mkdir -p -m 0750 ${LOGDIR} || \ { logger "WARNING: Could not create ${LOGDIR}" ; return 1 ; } if [ -d ${LOGDIR}.save ] || [ -f ${LOGDIR}.save ] ; then # Move the saved log into the logdir. log_output_of mv ${LOGDIR}.save ${LOGDIR} fi log_output_of chown -R ${amanda_user}:${amanda_group} ${LOGDIR} || \ { logger "WARNING: Could not chown ${LOGDIR}" ; return 1 ; } } # Info, Warning, and Error strings used by the installer info_create_user_success="NOTE: Set a password and unlock the ${amanda_user} account before running Amanda." info_create_user_success_sol="NOTE: Account is set as non-login. If interactive login is required: a password must be set, and the account activated for login." info_unlock_account=" The superuser can unlock the account by running: # passwd -u ${amanda_user} " info_existing_installs="Pre-existing Amanda installations must confirm: -${SYSCONFDIR}/amanda/* should have 'dumpuser' set to '${amanda_user}'. -${AMANDAHOMEDIR}/.amandahosts on client systems should allow connections by '${amanda_user}'." warning_user_password="WARNING: '${amanda_user}' no password. An error occured when locking the account. SET A PASSWORD NOW: # passwd ${amanda_user}" error_group_member="Nonfatal ERROR: Amanda will not run until '${amanda_user}' is a member the preceeding group. Install will continue..." warning_user_shell="WARNING: The user '${amanda_user}' has a non-default shell. Other shells have not been tested." warning_user_homedir="WARNING: The user '${amanda_user}' must have its home directory set to '${AMANDAHOMEDIR}' Please correct before using Amanda." warning_user_uid_debian="WARNING: Debian packages were built assuming that ${amanda_user} uid = ${checked_uid}. The uid of ${amanda_user} is different on this system. Files owned by ${checked_uid} must be chowned to ${amanda_user}." warning_homedir_owner="WARNING: The ${amanda_user}'s home directory,'${AMANDAHOMEDIR}' ownership must be changed to '${amanda_user}:${amanda_group}'. " # --------------- End included Functions ----------------- amanda-3.3.6/packaging/common/substitute.pl0000775000076400007640000001526312357250001022431 0ustar00martineamartinea00000000000000#!/usr/bin/perl use strict; use warnings; use POSIX; # Used by make to replace tags delimited by pairs of '%%'. Each tag should be # listed below. Remember, the script reads from the environment for $pkg_type # ARGV[0] = Source file (ends in .src) # ARGV[1] = Destination file (usually ARGV[0] - ".src" #### Checks # We must run from the root of a source tree, but we can only check that the # common files are in the right places if ( not -e "packaging/common/substitute.pl" ) { die "Error: 'substitute.pl' must be run from the root of a source tree" } sub get_date { my $date; # First parameter should be a date format string. open(my $DATE_PIPE, "-|", "/bin/date $_[0]"); [ $? == 0 ] or die "could not read output of date $_[0]"; chomp($date = <$DATE_PIPE>); close($DATE_PIPE); return $date; }; sub get_arch { my @u = POSIX::uname(); return $u[4]; }; sub read_file { # $1 is the file name and must exist. my $contents; my $file = "$_[0]"; my $f_handle; # Autogen has been run, the file will be there. if (-e $file) { open($f_handle, "<", "$file") or die "Could not open $file."; chomp($contents = <$f_handle>); close($f_handle); } else { die "Could not find $file file. run config/set_full_version or ./autogen"; } return $contents; } sub fix_pkg_rev { my $pkg_rev = "$_[0]"; # $1 should be a package type, and we build the rest of the regex string # here for simplicity my $type_match_str = "$_[1]0?"; # strip pkg_type and maybe a zero, else assign pkg_rev = 1 $pkg_rev = $pkg_rev =~ s/$type_match_str// || 1; return $pkg_rev; } my $pkg_type; # Check environment to see if it's something else. if (defined($ENV{'pkg_type'})) { $pkg_type = $ENV{"pkg_type"}; } # Check the file name for a clue elsif ( $ARGV[0] =~ /deb/ ) { $pkg_type = "deb"; } elsif ( $ARGV[0] =~ /rpm/ ) { $pkg_type = "rpm"; } elsif ( $ARGV[0] =~ /sun/ ) { $pkg_type = "sun"; } else { die "Could not determine pkg_type either by environment variable, or pathname of files to substitute ($ARGV[0])."; } # The keys to the hashes used are the "tags" we try to substitute. Each # tag should be on a line by itself in the package file, as the whole line is # replaced by a set of lines. The line may be commented. my %replacement_filenames = ( "%%COMMON_FUNCTIONS%%" => "packaging/common/common_functions.sh", "%%PRE_INST_FUNCTIONS%%" => "packaging/common/pre_inst_functions.sh", "%%POST_INST_FUNCTIONS%%" => "packaging/common/post_inst_functions.sh", "%%POST_RM_FUNCTIONS%%" => "packaging/common/post_rm_functions.sh", # TODO: PRE_UNINST? ); # These are handled slightly differently: The surrounding line is preserved, # and only the tag is replaced. This behavior is somewhat arbitrary, but # hopefully keeps replacements in comments syntax legal. my %replacement_strings_common = ( "%%VERSION%%" => read_file("FULL_VERSION"), "%%PKG_REV%%" => read_file("PKG_REV"), "%%AMANDAHOMEDIR%%" => "/var/lib/amanda", "%%LOGDIR%%" => "/var/log/amanda", ); my %replacement_strings_deb = ( # Used in debian changelog "%%DISTRO%%" => "", # Used in changelog "%%DEB_REL%%" => "", "%%DATE%%" => "'+%a, %d %b %Y %T %z'", # Used in server rules "%%PERL%%" => "", ); my %replacement_strings_rpm = ( "%%DATE%%" => "'+%a %b %d %Y'", ); my %replacement_strings_sun = ( "%%ARCH%%" => "", "%%DATE%%" => "'+%a, %d %b %Y %T %z'", ); my %replacement_strings; if ( $pkg_type eq "deb" ) { %replacement_strings = ( %replacement_strings_deb, %replacement_strings_common ); $replacement_strings{"%%PKG_REV%%"} = fix_pkg_rev($replacement_strings{"%%PKG_REV%%"}, "deb"); # Let's determine the distro: my $release; if ( -e "/usr/bin/lsb_release" ) { # Yay! it's easy. my $distro_id = `/usr/bin/lsb_release --id --short` or die "Could not run lsb_release!"; chomp ($replacement_strings{"%%DISTRO%%"} = $distro_id); chomp($release = `/usr/bin/lsb_release --release --short`); } if ( $replacement_strings{"%%DISTRO%%"} eq "" ) { # Let's hope it's debian. open(my $DEB_RELEASE, "<", "/etc/debian_version") or die "Could not read \"/etc/debian_version\": $!"; # Whew! $replacement_strings{"%%DISTRO%%"} = "Debian"; chomp($release = <$DEB_RELEASE>); close($DEB_RELEASE); } # Fix the release version string. if ( $replacement_strings{"%%DISTRO%%"} eq "Ubuntu" ) { $release =~ s/\.//; } else { # Releases can have 3 fields on Debian. we want the first 2. $release =~ s/(\d+)\.(\d+).*/$1$2/; } $replacement_strings{"%%DEB_REL%%"} = $release; $replacement_strings{"%%DATE%%"} = get_date($replacement_strings{"%%DATE%%"}); # 32bit should use bitrock perl, while 64bit should use builtin. we # live on the edge and assume it's there. my $arch = get_arch(); if ( $arch eq "x86_64" ) { $replacement_strings{"%%PERL%%"} = $^X; } else { $replacement_strings{"%%PERL%%"} = "/opt/zmanda/amanda/perl/bin/perl"; } } elsif ( $pkg_type eq "rpm" ){ %replacement_strings = ( %replacement_strings_rpm, %replacement_strings_common ); $replacement_strings{"%%PKG_REV%%"} = fix_pkg_rev($replacement_strings{"%%PKG_REV%%"}, "rpm"); $replacement_strings{"%%DATE%%"} = get_date($replacement_strings{"%%DATE%%"}); } else { %replacement_strings = ( %replacement_strings_sun, %replacement_strings_common ); $replacement_strings{"%%PKG_REV%%"} = fix_pkg_rev($replacement_strings{"%%PKG_REV%%"}, "sun"); $replacement_strings{"%%DATE%%"} = get_date($replacement_strings{"%%DATE%%"}); my $arch = get_arch(); if ( $arch eq "sun4u" ) { $replacement_strings{"%%ARCH%%"} = "sparc"; } elsif ( $arch eq "i86pc" ) { $replacement_strings{"%%ARCH%%"} = "intel"; } else { die "Unknown solaris platform!"; } } # Make a hash of tags and the contents of replacement files my %replacement_data; while (my ($tag, $filename) = each %replacement_filenames) { open(my $file, "<", $filename) or die "could not read \"$filename\": $!"; $replacement_data{$tag} = join "", <$file>; close($file); } open my $src, "<", $ARGV[0] or die "could not read $ARGV[0]: $!"; open my $dst, ">", $ARGV[1] or die "could not write $ARGV[1]: $!"; select $dst; while (<$src>) { chomp; # check for tags, using non greedy matching if ( m/(%%.+?%%)/ ) { # Data replaces the line if ( defined($replacement_data{$1})) { print $replacement_data{$1}; } # strings just replace the tag. elsif ( defined($replacement_strings{$1})) { s/(%%.+?%%)/$replacement_strings{$1}/g; print "$_\n"; } } else { # If we got here, print the line unmolested print "$_\n"; } } amanda-3.3.6/packaging/common/post_inst_functions.sh0000664000076400007640000003102012357250001024311 0ustar00martineamartinea00000000000000#!/bin/sh # ------------- Begin Post Install Functions ----------------- # These functions are included by various different installers. # We assume that the following variables are defined in the main script: # amanda_user: the amanda account username # amanda_group: the amanda account's group # AMANDAHOMEDIR: a directory to use as amanda's home # dist: used on linux for the distro. # install_log: a log file we append to # os: Linux, Mac, Solaris, etc... # SYSCONFDIR: location of system config files (ie, /etc) # LOGDIR: logging directory for amanda # encoder: either base64 or uuencode depending on the default for this platform #TODO: gnutar-lists dir for solaris?? add_service() { # Only needed on Solaris! entry="amanda 10080/tcp # amanda backup services" # make sure amanda is in /etc/services if [ -z "`grep 'amanda' ${SYSCONFDIR}/services |grep '10080/tcp'`" ] ; then logger "Adding amanda entry to ${SYSCONFDIR}/services." echo "${entry}" >> ${SYSCONFDIR}/services fi # make sure kamanda is in /etc/services entry_2="amanda 10081/tcp famdc # amanda backup services (kerberos)" if [ -z "`grep 'kamanda' /etc/services |grep '10081/tcp'`" ] ; then logger "Adding kamanda entry to ${SYSCONFDIR}/services." echo "${entry_2}" >> ${SYSCONFDIR}/services fi } create_amandates() { logger "Creating ${AMANDATES}." if [ ! -f ${AMANDATES} ] ; then touch ${AMANDATES} || { logger "WARNING: Could not create Amandates." ; return 1; } fi } check_amandates() { logger "Ensuring correct permissions for '${AMANDATES}'." log_output_of chown ${amanda_user}:${amanda_group} ${AMANDATES} || \ { logger "WARNING: Could not chown ${AMANDATES}" ; return 1; } log_output_of chmod 0640 ${AMANDATES} || \ { logger "WARNING: Could not fix perms on ${AMANDATES}" ; return 1; } if [ -x /sbin/restorecon ] ; then log_output_of /sbin/restorecon ${AMANDATES} || \ { logger "WARNING: restorecon execution failed." ; return 1; } fi } create_gnupg() { # Install .gnupg directory if [ ! -d ${AMANDAHOMEDIR}/.gnupg ] ; then logger "Creating '${AMANDAHOMEDIR}/.gnupg'" log_output_of mkdir ${AMANDAHOMEDIR}/.gnupg || \ { logger "WARNING: Could not create .gnupg dir" ; return 1; } fi } get_random_lines() { # Print $1 lines of random strings to stdout. [ "$1" ] && [ $1 -gt 0 ] || \ { logger "Error: '$1' not valid number of lines" ; return 1 ; } lines=$1 [ -f "${encoder}" ] || \ { logger "Warning: Encoder '${encoder}' was not found. Random passwords cannot be generated." ; return 1; } case ${encoder} in # "foo" is a required parameter that we throw away. *uuencode*) enc_cmd="${encoder} foo" ;; *base64*) enc_cmd="${encoder}" ;; esac # Uuencode leaves a header (and footer) line, but base64 does not. # So we pad output with an extra line, and strip any trailing lines over # $lines pad_lines=`expr $lines + 1` # Increasing bs= is substantially faster than increasing count=. # The number of bytes needed to start line wrapping is implementation # specific. base64. 60b > 1 base64 encoded line for all versions tested. block_size=`expr $pad_lines \* 60` # Head -c is not portable. dd bs=${block_size} count=1 if=/dev/urandom 2>/dev/null | \ ${enc_cmd} | \ head -$pad_lines | \ tail -$lines || \ { logger "Warning: Error generating random passphrase."; return 1; } } create_ampassphrase() { # install am_passphrase file to server logger "Checking '${AMANDAHOMEDIR}/.am_passphrase' file." if [ ! -f ${AMANDAHOMEDIR}/.am_passphrase ] ; then # Separate file creation from password creation to ease debugging. logger "Creating '${AMANDAHOMEDIR}/.am_passphrase' file." log_output_of touch ${AMANDAHOMEDIR}/.am_passphrase || \ { logger "WARNING: Could not create .am_passphrase." ; return 1; } phrase=`get_random_lines 1` || return 1 # Error already logged echo ${phrase} >>${AMANDAHOMEDIR}/.am_passphrase else logger "Info: ${AMANDAHOMEDIR}/.am_passphrase already exists." fi # Fix permissions for both new or existing installations. log_output_of chown ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.am_passphrase || \ { logger "WARNING: Could not chown .am_passphrase" ; return 1; } log_output_of chmod 0600 ${AMANDAHOMEDIR}/.am_passphrase || \ { logger "WARNING: Could not fix permissions on .am_passphrase" ; return 1; } } create_amkey() { [ -f ${AMANDAHOMEDIR}/.am_passphrase ] || \ { logger "Error: ${AMANDAHOMEDIR}/.am_passphrase is missing, can't create amcrypt key."; return 1; } logger "Creating encryption key for amcrypt" if [ ! -f ${AMANDAHOMEDIR}/.gnupg/am_key.gpg ]; then # TODO: don't write this stuff to disk! get_random_lines 50 >${AMANDAHOMEDIR}/.gnupg/am_key || return 1 exec 3<${AMANDAHOMEDIR}/.am_passphrase # setting homedir prevents some errors, but creates a permissions # warning. perms are fixed in check_gnupg. log_output_of gpg --homedir ${AMANDAHOMEDIR}/.gnupg \ --no-permission-warning \ --no-use-agent \ --armor \ --batch \ --symmetric \ --passphrase-fd 3 \ --output ${AMANDAHOMEDIR}/.gnupg/am_key.gpg \ ${AMANDAHOMEDIR}/.gnupg/am_key || \ { logger "WARNING: Error encrypting keys." ; rm ${AMANDAHOMEDIR}/.gnupg/am_key; return 1; } # Be nice and clean up. exec 3<&- else logger "Info: Encryption key '${AMANDAHOMEDIR}/.gnupg/am_key.gpg' already exists." fi # Always try to delete unencrypted keys rm -f ${AMANDAHOMEDIR}/.gnupg/am_key } check_gnupg() { logger "Ensuring correct permissions for '${AMANDAHOMEDIR}/.gnupg'." log_output_of chown -R ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.gnupg || \ { logger "WARNING: Could not chown .gnupg dir." ; return 1; } log_output_of chmod -R u=rwX,go= ${AMANDAHOMEDIR}/.gnupg || \ { logger "WARNING: Could not set permissions on .gnupg dir." ; return 1; } # If am_key.gpg and .am_passphrase already existed, we should check # if they match! if [ -f ${AMANDAHOMEDIR}/.gnupg/am_key.gpg ] && [ -f ${AMANDAHOMEDIR}/.am_passphrase ]; then exec 3<${AMANDAHOMEDIR}/.am_passphrase # Perms warning will persist because we are not running as ${amanda_user} log_output_of gpg --homedir ${AMANDAHOMEDIR}/.gnupg \ --no-permission-warning \ --no-use-agent\ --batch \ --decrypt \ --passphrase-fd 3 \ --output /dev/null \ ${AMANDAHOMEDIR}/.gnupg/am_key.gpg || \ { logger "WARNING: .am_passphrase does not decrypt .gnupg/am_key.gpg."; return 1; } # Be nice and clean up. exec 3<&- fi } create_amandahosts() { # Install .amandahosts to server if [ ! -f ${AMANDAHOMEDIR}/.amandahosts ] ; then logger "Creating ${AMANDAHOMEDIR}/.amandahosts" log_output_of touch ${AMANDAHOMEDIR}/.amandahosts || \ { logger "WARNING: Could not create .amandahosts file." ; return 1; } fi } check_amandahosts_entry() { # Entries for client and server differ slightly # $1 username (root, ${amanda_user}) # subsequent parameters are a list of programs to check (amindexd # amidxtaped, or amdump) logger "Checking '${AMANDAHOMEDIR}/.amandahosts' for '${@}' entries." # Generate our grep expression expr="" for prog in ${@} ; do expr=${expr}"[[:blank:]]\+${prog}" done for host in localhost localhost.localdomain ; do logger "Searching .amandahosts for ^${host}${expr}" if `grep "^${host}${expr}" ${AMANDAHOMEDIR}/.amandahosts >> /dev/null` ; then continue else add_amandahosts_entry ${host} ${@} fi done } add_amandahosts_entry() { # Add entries to amandahosts. # $@ is a fully formatted entry for amandahosts logger "Appending '${@}' to amandahosts" echo "${@}" >>${AMANDAHOMEDIR}/.amandahosts || \ { logger "WARNING: Could not append to .amandahosts" ; return 1; } } check_amandahosts_perms() { logger "Ensuring correct permissions on .amandahosts" log_output_of chown ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.amandahosts || \ { logger "WARNING: Could not chown .amandahosts." ; return 1; } log_output_of chmod 0600 ${AMANDAHOMEDIR}/.amandahosts || \ { logger "WARNING: Could not fix permissions on .amandahosts" ; return 1; } } create_ssh_key() { # SSH RSA key generation for amdump and amrecover # $1 must be "server" or "client" KEYDIR="${AMANDAHOMEDIR}/.ssh" if [ $1 = "server" ] ; then KEYFILE="id_rsa_amdump" elif [ $1 = "client" ] ; then KEYFILE="id_rsa_amrecover" else logger "Bad parameter to create_ssh_key" ; return 1 fi COMMENT="${amanda_user}@$1" if [ ! -d ${KEYDIR} ] ; then if [ -f ${KEYDIR} ] ; then logger "Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.save'." log_output_of mv ${KEYDIR} ${KEYDIR}.save || \ { logger "WARNING: Could not backup old .ssh directory." ; return 1; } fi logger "Creating directory '${KEYDIR}'." log_output_of mkdir ${KEYDIR} || \ { logger "WARNING: Could not create .ssh dir." ; return 1; } fi if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then logger "Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" log_output_of ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' || \ { logger "WARNING: Error generating ssh key" ; return 1; } fi logger "Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" log_output_of chown ${amanda_user}:${amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* || \ { logger "WARNING: Could not chown one of ${KEYDIR} or ${KEYFILE}"; return 1; } log_output_of chmod 0750 ${KEYDIR} || \ { logger "WARNING: Could not fix permissions on ${KEYDIR}"; return 1; } log_output_of chmod 0600 ${KEYDIR}/${KEYFILE}* || \ { logger "WARNING: Could not fix permissions on ${KEYFILE}"; return 1; } } create_profile() { # environment variables (~${amanda_user}/.profile) logger "Checking for '${AMANDAHOMEDIR}/.profile'." if [ ! -f ${AMANDAHOMEDIR}/.profile ] ; then log_output_of touch ${AMANDAHOMEDIR}/.profile || \ { logger "WARNING: Could not create .profile" ; return 1; } fi } check_profile(){ logger "Checking for ${SBINDIR} in path statement." if [ -z "`grep PATH.*${SBINDIR} ${AMANDAHOMEDIR}/.profile`" ] ; then echo "PATH=\"\$PATH:${SBINDIR}\"" >>${AMANDAHOMEDIR}/.profile || \ { logger "WARNING: Could not append to .profile" ; return 1; } echo "export PATH" >>${AMANDAHOMEDIR}/.profile fi case $os in SunOS) sun_paths=/opt/csw/bin:/usr/ucb if [ -z "`grep PATH ${AMANDAHOMEDIR}/.profile | grep ${sun_paths}`" ] ; then echo "PATH=\"$PATH:${SBINDIR}:${sun_paths}\"" >>${AMANDAHOMEDIR}/.profile fi ;; esac logger "Setting ownership and permissions for '${AMANDAHOMEDIR}/.profile'" log_output_of chown ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.profile || \ { logger "WARNING: Could not chown .profile." ; return 1; } log_output_of chmod 0640 ${AMANDAHOMEDIR}/.profile || \ { logger "WARNING: Could not fix permissions on .profile" ; return 1; } } install_client_conf() { # Install client config if [ "$os" = "SunOS" ] ; then install="install -m 0600 -u ${amanda_user} -g ${amanda_group}" else install="install -m 0600 -o ${amanda_user} -g ${amanda_group}" fi logger "Checking '${SYSCONFDIR}/amanda/amanda-client.conf' file." if [ ! -f ${SYSCONFDIR}/amanda/amanda-client.conf ] ; then logger "Installing amanda-client.conf." log_output_of ${install} ${AMANDAHOMEDIR}/example/amanda-client.conf \ ${SYSCONFDIR}/amanda/ || \ { logger "WARNING: Could not install amanda-client.conf" ; return 1; } else logger "Note: ${SYSCONFDIR}/amanda/amanda-client.conf exists. Please check ${AMANDAHOMEDIR}/example/amanda-client.conf for updates." fi } create_amtmp() { # Check for existence of and permissions on ${AMTMP} logger "Checking for '${AMTMP}' dir." if [ ! -d ${AMTMP} ]; then logger "Create '${AMTMP}' dir." log_output_of mkdir ${AMTMP} || \ { logger "WARNING: Could not create ${AMTMP}." ; return 1; } log_output_of chown ${amanda_user}:${amanda_group} ${AMTMP} || \ { logger "WARNING: Could not chown ${AMTMP}" ; return 1; } fi } # ------------- End Post Install Functions ----------------- amanda-3.3.6/packaging/common/shunit20000664000076400007640000007504712357250001021203 0ustar00martineamartinea00000000000000# $Id: shunit2 277 2008-10-29 21:20:22Z kate.ward@forestent.com $ # vim:et:ft=sh:sts=2:sw=2 # vim:foldmethod=marker:foldmarker=/**,*/ # #/** # # # # shUnit 2.1.5 # Shell Unit Test Framework # # http://shunit2.googlecode.com/ # # written by Kate Ward <kate.ward@forestent.com> # released under the LGPL # # This module implements a xUnit based unit test framework similar to JUnit. # #*/ SHUNIT_VERSION='2.1.5' SHUNIT_TRUE=0 SHUNIT_FALSE=1 SHUNIT_ERROR=2 _shunit_warn() { echo "shunit2:WARN $@" >&2; } _shunit_error() { echo "shunit2:ERROR $@" >&2; } _shunit_fatal() { echo "shunit2:FATAL $@" >&2; } # specific shell checks if [ -n "${ZSH_VERSION:-}" ]; then setopt |grep "^shwordsplit$" >/dev/null if [ $? -ne ${SHUNIT_TRUE} ]; then _shunit_fatal 'zsh shwordsplit option is required for proper operation' exit ${SHUNIT_ERROR} fi if [ -z "${SHUNIT_PARENT:-}" ]; then _shunit_fatal "zsh does not pass \$0 through properly. please declare \ \"SHUNIT_PARENT=\$0\" before calling shUnit2" exit ${SHUNIT_ERROR} fi fi # # constants # __SHUNIT_ASSERT_MSG_PREFIX='ASSERT:' __SHUNIT_PARENT=${SHUNIT_PARENT:-$0} # set the constants readonly shunit_constants_=`set |grep '^__SHUNIT_' |cut -d= -f1` echo "${shunit_constants_}" |grep '^Binary file' >/dev/null \ && shunit_constants_=`set |grep -a '^__SHUNIT_' |cut -d= -f1` for shunit_constant_ in ${shunit_constants_}; do shunit_ro_opts_='' case ${ZSH_VERSION:-} in '') ;; # this isn't zsh [123].*) ;; # early versions (1.x, 2.x, 3.x) *) shunit_ro_opts_='-g' ;; # all later versions. declare readonly globally esac readonly ${shunit_ro_opts_} ${shunit_constant_} done unset shunit_constant_ shunit_constants_ shunit_ro_opts_ # variables __shunit_skip=${SHUNIT_FALSE} __shunit_suite='' # counts of tests __shunit_testSuccess=${SHUNIT_TRUE} __shunit_testsTotal=0 __shunit_testsPassed=0 __shunit_testsFailed=0 # counts of asserts __shunit_assertsTotal=0 __shunit_assertsPassed=0 __shunit_assertsFailed=0 __shunit_assertsSkipped=0 __shunit_lineno='' __shunit_reportGenerated=${SHUNIT_FALSE} # macros _SHUNIT_LINENO_='eval __shunit_lineno=""; if [ "${1:-}" = "--lineno" ]; then [ -n "$2" ] && __shunit_lineno="[$2] "; shift 2; fi' #----------------------------------------------------------------------------- # assert functions # #/** # # # void # # # # # assertEquals # string [message] # string expected # string actual # # # Asserts that expected and # actual are equal to one another. The message is # optional. # # #*/ assertEquals() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "assertEquals() requires two or three arguments; $# given" _shunit_error "1: ${1:+$1} 2: ${2:+$2} 3: ${3:+$3}" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi shunit_expected_=$1 shunit_actual_=$2 shunit_return=${SHUNIT_TRUE} if [ "${shunit_expected_}" = "${shunit_actual_}" ]; then _shunit_assertPass else failNotEquals "${shunit_message_}" "${shunit_expected_}" "${shunit_actual_}" shunit_return=${SHUNIT_FALSE} fi unset shunit_message_ shunit_expected_ shunit_actual_ return ${shunit_return} } _ASSERT_EQUALS_='eval assertEquals --lineno "${LINENO:-}"' #/** # # # void # # # # # assertNotEquals # string [message] # string unexpected # string actual # # # Asserts that unexpected and # actual are not # equal to one another. The message is optional. # # #*/ assertNotEquals() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "assertNotEquals() requires two or three arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi shunit_unexpected_=$1 shunit_actual_=$2 shunit_return=${SHUNIT_TRUE} if [ "${shunit_unexpected_}" != "${shunit_actual_}" ]; then _shunit_assertPass else failSame "${shunit_message_}" "$@" shunit_return=${SHUNIT_FALSE} fi unset shunit_message_ shunit_unexpected_ shunit_actual_ return ${shunit_return} } _ASSERT_NOT_EQUALS_='eval assertNotEquals --lineno "${LINENO:-}"' #/** # # # void # # # # # assertNull # string [message] # string value # # # Asserts that value is null, # or in shell terms a zero-length string. The message is optional. # # #*/ assertNull() { ${_SHUNIT_LINENO_} if [ $# -lt 1 -o $# -gt 2 ]; then _shunit_error "assertNull() requires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 2 ]; then shunit_message_="${shunit_message_}$1" shift fi assertTrue "${shunit_message_}" "[ -z '$1' ]" shunit_return=$? unset shunit_message_ return ${shunit_return} } _ASSERT_NULL_='eval assertNull --lineno "${LINENO:-}"' #/** # # # void # # # # # assertNotNull # string [message] # string value # # # Asserts that value is not null, or in shell terms not # a zero-length string. The message is optional. # # #*/ assertNotNull() { ${_SHUNIT_LINENO_} if [ $# -gt 2 ]; then # allowing 0 arguments as $1 might actually be null _shunit_error "assertNotNull() requires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 2 ]; then shunit_message_="${shunit_message_}$1" shift fi assertTrue "${shunit_message_}" "[ -n '${1:-}' ]" shunit_return=$? unset shunit_message_ return ${shunit_return} } _ASSERT_NOT_NULL_='eval assertNotNull --lineno "${LINENO:-}"' #/** # # # void # # # # # assertSame # string [message] # string expected # string actual # # # This function is functionally equivalent to # assertEquals. # # #*/ assertSame() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "assertSame() requires two or three arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi assertEquals "${shunit_message_}" "$1" "$2" shunit_return=$? unset shunit_message_ return ${shunit_return} } _ASSERT_SAME_='eval assertSame --lineno "${LINENO:-}"' #/** # # # void # # # # # assertNotSame # string [message] # string unexpected # string actual # # # Asserts that unexpected and # actual are not # equal to one another. The message is optional. # # #*/ assertNotSame() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "assertNotSame() requires two or three arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_:-}$1" shift fi assertNotEquals "${shunit_message_}" "$1" "$2" shunit_return=$? unset shunit_message_ return ${shunit_return} } _ASSERT_NOT_SAME_='eval assertNotSame --lineno "${LINENO:-}"' #/** # # # void # # # # # assertTrue # string [message] # string condition # # # Asserts that a given shell test condition is true. The message is # optional. # Testing whether something is true or false is easy enough by using # the assertEquals/assertNotSame functions. Shell supports much more # complicated tests though, and a means to support them was needed. As such, # this function tests that conditions are true or false through evaluation # rather than just looking for a true or false. # # The following test will succeed: assertTrue "[ 34 -gt 23 ]" # The folloing test will fail with a message: assertTrue "test failed" "[ -r '/non/existant/file' ]" # # # #*/ assertTrue() { ${_SHUNIT_LINENO_} if [ $# -gt 2 ]; then _shunit_error "assertTrue() takes one two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 2 ]; then shunit_message_="${shunit_message_}$1" shift fi shunit_condition_=$1 # see if condition is an integer, i.e. a return value shunit_match_=`expr "${shunit_condition_}" : '\([0-9]*\)'` shunit_return=${SHUNIT_TRUE} if [ -z "${shunit_condition_}" ]; then # null condition shunit_return=${SHUNIT_FALSE} elif [ "${shunit_condition_}" = "${shunit_match_}" ]; then # possible return value. treating 0 as true, and non-zero as false. [ ${shunit_condition_} -ne 0 ] && shunit_return=${SHUNIT_FALSE} else # (hopefully) a condition ( eval ${shunit_condition_} ) >/dev/null 2>&1 [ $? -ne 0 ] && shunit_return=${SHUNIT_FALSE} fi # record the test if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then _shunit_assertPass else _shunit_assertFail "${shunit_message_}" fi unset shunit_message_ shunit_condition_ shunit_match_ return ${shunit_return} } _ASSERT_TRUE_='eval assertTrue --lineno "${LINENO:-}"' #/** # # # void # # # # # assertFalse # string [message] # string condition # # # Asserts that a given shell test condition is false. The message is # optional. # Testing whether something is true or false is easy enough by using # the assertEquals/assertNotSame functions. Shell supports much more # complicated tests though, and a means to support them was needed. As such, # this function tests that conditions are true or false through evaluation # rather than just looking for a true or false. # # The following test will succeed: assertFalse "[ 'apples' = 'oranges' ]" # The folloing test will fail with a message: assertFalse "test failed" "[ 1 -eq 1 -a 2 -eq 2 ]" # # # #*/ assertFalse() { ${_SHUNIT_LINENO_} if [ $# -lt 1 -o $# -gt 2 ]; then _shunit_error "assertFalse() quires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 2 ]; then shunit_message_="${shunit_message_}$1" shift fi shunit_condition_=$1 # see if condition is an integer, i.e. a return value shunit_match_=`expr "${shunit_condition_}" : '\([0-9]*\)'` shunit_return=${SHUNIT_TRUE} if [ -z "${shunit_condition_}" ]; then # null condition shunit_return=${SHUNIT_FALSE} elif [ "${shunit_condition_}" = "${shunit_match_}" ]; then # possible return value. treating 0 as true, and non-zero as false. [ ${shunit_condition_} -eq 0 ] && shunit_return=${SHUNIT_FALSE} else # (hopefully) a condition ( eval ${shunit_condition_} ) >/dev/null 2>&1 [ $? -eq 0 ] && shunit_return=${SHUNIT_FALSE} fi # record the test if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then _shunit_assertPass else _shunit_assertFail "${shunit_message_}" fi unset shunit_message_ shunit_condition_ shunit_match_ return ${shunit_return} } _ASSERT_FALSE_='eval assertFalse --lineno "${LINENO:-}"' #----------------------------------------------------------------------------- # failure functions # #/** # # # void # # # # # fail # string [message] # # # Fails the test immediately, with the optional message. # # #*/ fail() { ${_SHUNIT_LINENO_} if [ $# -gt 1 ]; then _shunit_error "fail() requires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 1 ]; then shunit_message_="${shunit_message_}$1" shift fi _shunit_assertFail "${shunit_message_}" unset shunit_message_ return ${SHUNIT_FALSE} } _FAIL_='eval fail --lineno "${LINENO:-}"' #/** # # # void # # # # # failNotEquals # string [message] # string unexpected # string actual # # # Fails the test if unexpected and # actual are not # equal to one another. The message is optional. # # #*/ failNotEquals() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "failNotEquals() requires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi shunit_unexpected_=$1 shunit_actual_=$2 _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_unexpected_}> but was:<${shunit_actual_}>" unset shunit_message_ shunit_unexpected_ shunit_actual_ return ${SHUNIT_FALSE} } _FAIL_NOT_EQUALS_='eval failNotEquals --lineno "${LINENO:-}"' #/** # # # void # # # # # failSame # string [message] # # # Indicate test failure because arguments were the same. The message is # optional. # # #*/ failSame() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "failSame() requires two or three arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected not same" unset shunit_message_ return ${SHUNIT_FALSE} } _FAIL_SAME_='eval failSame --lineno "${LINENO:-}"' #/** # # # void # # # # # failNotSame # string [message] # string expected # string actual # # # Indicate test failure because arguments were not the same. The # message is optional. # # #*/ failNotSame() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "failNotEquals() requires one or two arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} shunit_message_=${__shunit_lineno} if [ $# -eq 3 ]; then shunit_message_="${shunit_message_}$1" shift fi failNotEquals "${shunit_message_}" "$1" "$2" shunit_return=$? unset shunit_message_ return ${shunit_return} } _FAIL_NOT_SAME_='eval failNotSame --lineno "${LINENO:-}"' #----------------------------------------------------------------------------- # skipping functions # #/** # # # void # # # # # startSkipping # # # # This function forces the remaining assert and fail functions to be # "skipped", i.e. they will have no effect. Each function skipped will be # recorded so that the total of asserts and fails will not be altered. # # #*/ startSkipping() { __shunit_skip=${SHUNIT_TRUE} } #/** # # # void # # # # # endSkipping # # # # This function returns calls to the assert and fail functions to their # default behavior, i.e. they will be called. # # #*/ endSkipping() { __shunit_skip=${SHUNIT_FALSE} } #/** # # # boolean # # # # # isSkipping # # # # This function returns the state of skipping. # # #*/ isSkipping() { return ${__shunit_skip} } #----------------------------------------------------------------------------- # suite functions # #/** # # # void # # # # # suite # # # # This function can be optionally overridden by the user in their test # suite. # If this function exists, it will be called when # shunit2 is sourced. If it does not exist, shUnit2 will # search the parent script for all functions beginning with the word # test, and they will be added dynamically to the test # suite. # # #*/ # Note: see _shunit_mktempFunc() for actual implementation # suite() { :; } #/** # # # void # # # # # suite_addTest # string function # # # This function adds a function name to the list of tests scheduled for # execution as part of this test suite. This function should only be called # from within the suite() function. # # #*/ suite_addTest() { shunit_func_=${1:-} __shunit_suite="${__shunit_suite:+${__shunit_suite} }${shunit_func_}" __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` unset shunit_func_ } #/** # # # void # # # # # oneTimeSetUp # # # # This function can be be optionally overridden by the user in their # test suite. # If this function exists, it will be called once before any tests are # run. It is useful to prepare a common environment for all tests. # # #*/ # Note: see _shunit_mktempFunc() for actual implementation # oneTimeSetUp() { :; } #/** # # # void # # # # # oneTimeTearDown # # # # This function can be be optionally overridden by the user in their # test suite. # If this function exists, it will be called once after all tests are # completed. It is useful to clean up the environment after all tests. # # #*/ # Note: see _shunit_mktempFunc() for actual implementation # oneTimeTearDown() { :; } #/** # # # void # # # # # setUp # # # # This function can be be optionally overridden by the user in their # test suite. # If this function exists, it will be called before each test is run. # It is useful to reset the environment before each test. # # #*/ # Note: see _shunit_mktempFunc() for actual implementation # setUp() { :; } #/** # # # void # # # # # tearDown # # # # This function can be be optionally overridden by the user in their # test suite. # If this function exists, it will be called after each test completes. # It is useful to clean up the environment after each test. # # #*/ # Note: see _shunit_mktempFunc() for actual implementation # tearDown() { :; } #------------------------------------------------------------------------------ # internal shUnit2 functions # # this function is a cross-platform temporary directory creation tool. not all # OSes have the mktemp function, so one is included here. _shunit_mktempDir() { # try the standard mktemp function ( exec mktemp -dqt shunit.XXXXXX 2>/dev/null ) && return # the standard mktemp didn't work. doing our own. if [ -r '/dev/urandom' ]; then _shunit_random_=`od -vAn -N4 -tx4 "${_shunit_file_}" #! /bin/sh exit ${SHUNIT_TRUE} EOF # If the path is changed, put it back for this command PATH=/bin:/usr/bin chmod +x "${_shunit_file_}" done unset _shunit_file_ } _shunit_cleanup() { _shunit_name_=$1 case ${_shunit_name_} in EXIT) _shunit_signal_=0 ;; INT) _shunit_signal_=2 ;; TERM) _shunit_signal_=15 ;; *) _shunit_warn "unrecognized trap value (${_shunit_name_})" _shunit_signal_=0 ;; esac # do our work rm -fr "${__shunit_tmpDir}" # exit for all non-EXIT signals if [ ${_shunit_name_} != 'EXIT' ]; then _shunit_warn "trapped and now handling the (${_shunit_name_}) signal" # disable EXIT trap trap 0 # add 128 to signal and exit exit `expr ${_shunit_signal_} + 128` elif [ ${__shunit_reportGenerated} -eq ${SHUNIT_FALSE} ] ; then _shunit_assertFail 'Unknown failure encountered running a test' _shunit_generateReport exit ${SHUNIT_ERROR} fi unset _shunit_name_ _shunit_signal_ } # The actual running of the tests happens here. _shunit_execSuite() { for _shunit_test_ in ${__shunit_suite}; do __shunit_testSuccess=${SHUNIT_TRUE} # disable skipping endSkipping # execute the per-test setup function setUp # execute the test echo "${_shunit_test_}" eval ${_shunit_test_} # execute the per-test tear-down function tearDown # update stats if [ ${__shunit_testSuccess} -eq ${SHUNIT_TRUE} ]; then __shunit_testsPassed=`expr ${__shunit_testsPassed} + 1` else __shunit_testsFailed=`expr ${__shunit_testsFailed} + 1` fi done unset _shunit_test_ } # This function exits shUnit2 with the appropriate error code and OK/FAILED # message. _shunit_generateReport() { _shunit_ok_=${SHUNIT_TRUE} # if no exit code was provided one, determine an appropriate one [ ${__shunit_testsFailed} -gt 0 \ -o ${__shunit_testSuccess} -eq ${SHUNIT_FALSE} ] \ && _shunit_ok_=${SHUNIT_FALSE} echo if [ ${__shunit_testsTotal} -eq 1 ]; then echo "Ran ${__shunit_testsTotal} test." else echo "Ran ${__shunit_testsTotal} tests." fi _shunit_failures_='' _shunit_skipped_='' [ ${__shunit_assertsFailed} -gt 0 ] \ && _shunit_failures_="failures=${__shunit_assertsFailed}" [ ${__shunit_assertsSkipped} -gt 0 ] \ && _shunit_skipped_="skipped=${__shunit_assertsSkipped}" if [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then _shunit_msg_='OK' [ -n "${_shunit_skipped_}" ] \ && _shunit_msg_="${_shunit_msg_} (${_shunit_skipped_})" else _shunit_msg_="FAILED (${_shunit_failures_}" [ -n "${_shunit_skipped_}" ] \ && _shunit_msg_="${_shunit_msg_},${_shunit_skipped_}" _shunit_msg_="${_shunit_msg_})" fi echo echo ${_shunit_msg_} __shunit_reportGenerated=${SHUNIT_TRUE} unset _shunit_failures_ _shunit_msg_ _shunit_ok_ _shunit_skipped_ } _shunit_shouldSkip() { [ ${__shunit_skip} -eq ${SHUNIT_FALSE} ] && return ${SHUNIT_FALSE} _shunit_assertSkip } _shunit_assertPass() { __shunit_assertsPassed=`expr ${__shunit_assertsPassed} + 1` __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` } _shunit_assertFail() { _shunit_msg_=$1 __shunit_testSuccess=${SHUNIT_FALSE} __shunit_assertsFailed=`expr ${__shunit_assertsFailed} + 1` __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` echo "${__SHUNIT_ASSERT_MSG_PREFIX}${_shunit_msg_}" unset _shunit_msg_ } _shunit_assertSkip() { __shunit_assertsSkipped=`expr ${__shunit_assertsSkipped} + 1` __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` } #------------------------------------------------------------------------------ # main # # create a temporary storage location __shunit_tmpDir=`_shunit_mktempDir` # provide a public temporary directory for unit test scripts # TODO(kward): document this shunit_tmpDir="${__shunit_tmpDir}/tmp" mkdir "${shunit_tmpDir}" # setup traps to clean up after ourselves trap '_shunit_cleanup EXIT' 0 trap '_shunit_cleanup INT' 2 trap '_shunit_cleanup TERM' 15 # create phantom functions to work around issues with Cygwin _shunit_mktempFunc PATH="${__shunit_tmpDir}:${PATH}" # execute the oneTimeSetUp function (if it exists) oneTimeSetUp # execute the suite function defined in the parent test script # deprecated as of 2.1.0 suite # if no suite function was defined, dynamically build a list of functions if [ -z "${__shunit_suite}" ]; then shunit_funcs_=`grep "^[ \t]*test[A-Za-z0-9_]* *()" ${__SHUNIT_PARENT} \ |sed 's/[^A-Za-z0-9_]//g'` for shunit_func_ in ${shunit_funcs_}; do suite_addTest ${shunit_func_} done fi unset shunit_func_ shunit_funcs_ # execute the tests _shunit_execSuite # execute the oneTimeTearDown function (if it exists) oneTimeTearDown # generate the report _shunit_generateReport # that's it folks [ ${__shunit_testsFailed} -eq 0 ] exit $? #/** # #*/ amanda-3.3.6/packaging/sun-pkg/0000775000076400007640000000000012357750430017756 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/sun-pkg/server/0000775000076400007640000000000012357750430021264 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/sun-pkg/server/pkgproto0000664000076400007640000000021212357250001023034 0ustar00martineamartinea00000000000000i pkginfo=./pkginfo i depend=./depend i preinstall=./preinstall i postinstall=./postinstall i postrm=./postremove i copyright=./copyright amanda-3.3.6/packaging/sun-pkg/server/copyright0000664000076400007640000000264312357250001023211 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ amanda-3.3.6/packaging/sun-pkg/server/postinstall.src0000775000076400007640000000451012357250001024341 0ustar00martineamartinea00000000000000#!/bin/sh LOGFILE=`mktemp /tmp/amanda-server-postinstall.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to mktemp!" 1>&2 exit 1 fi amanda_user=amandabackup; export amanda_user amanda_group=disk; export amanda_group # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR="${basedir}%%AMANDAHOMEDIR%%"; export AMANDAHOMEDIR os=SunOS; export os arch=%%ARCH%%; export arch LOGDIR="${basedir}%%LOGDIR%%"; export LOGDIR INSTALL_LOG="${LOGDIR}/install.log"; export INSTALL_LOG SYSCONFDIR="${basedir}/etc"; export SYSCONFDIR SBINDIR="${basedir}/usr/sbin"; export SBINDIR AMTMP="/tmp/amanda" AMANDATES=${SYSCONFDIR}/amandates; export AMANDATES # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_INST_FUNCTIONS%% # -------- End Common functions ---------- add_service rel=`uname -r` if [ "$rel" = "5.8" ]; then check_inetd "amandaserver" case $? in 0) backup_inetd "amandaserver" install_inetd "amandaserver" ;; 1) install_inetd "amandaserver" ;; 2) logger "Error: Amanda service not installed because inetd config was not found: either inetd config is not present or inetd is a directory." ;; esac # Amanda clients should not have the server xinetd installed. check_inetd "amandaclient" case $? in 0) backup_inetd "amandaclient" ;; esac reload_inetd else # Solaris 10+ uses smf, but we can't differentiate server from client, all # entries end up named "amanda" check_smf "amanda" case $? in 0) backup_smf || logger "Warning: Backup of existing service failed. continuing..." install_smf "amandaserver" || \ logger "Warning: Amanda service not installed." ;; 1) install_smf "amandaserver" ;; esac fi create_amandates check_amandates create_gnupg check_gnupg create_amandahosts check_amandahosts_entry ${amanda_user} amdump check_amandahosts_perms create_ssh_key client create_profile check_profile install_client_conf create_amtmp logger "Amanda installation complete." cat $LOGFILE >> $INSTALL_LOG && { rm $LOGFILE echo "Amanda installation log can be found in '${INSTALL_LOG}'." } || \ echo "Amanda postinstall log can be found in $LOGFILE" amanda-3.3.6/packaging/sun-pkg/server/postremove.src0000775000076400007640000000220512357250001024167 0ustar00martineamartinea00000000000000#!/bin/sh LOGFILE=`mktemp /tmp/amanda-server-rm-log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi amanda_user=amandabackup amanda_group=disk # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR=${basedir}%%AMANDAHOMEDIR%% os=SunOS dist=%%DISTRO%% LOGDIR=${basedir}%%LOGDIR%% SYSCONFDIR=${basedir}/etc # ---------- Common functions ------------ # see packaging/common/ in the source tree %%COMMON_FUNCTIONS%% %%POST_RM_FUNCTIONS%% # -------- End Common functions ---------- rel=`uname -r` case $rel in 5.8|5.9) if check_inetd "amanda"; then rm_inetd "amanda" || { \ logger "Warning: Did not successfully remove amanda from SMF."; exit 1; } reload_inetd fi ;; 5.10) if check_smf "amanda"; then rm_smf "amanda" || { \ logger "Warning: Did not successfully remove amanda from SMF."; exit 1; } fi ;; esac logger "Amanda Server removed." amanda-3.3.6/packaging/sun-pkg/server/pkginfo.src0000664000076400007640000000111112357250001023411 0ustar00martineamartinea00000000000000PKG="AMANamanda-server" ARCH="%%ARCH%%" VERSION="%%VERSION%%-%%PKG_REV%%" CATEGORY="system" VENDOR="Amanda Project, http://www.amanda.org/" EMAIL="support@zmanda.com" BASEDIR="/" CLASSES="none" MAXINST=1 INTONLY=1 NAME="Amanda Community Backup Server" DESC="Amanda is the leading Open-Source Backup and Archiving software. This package contains the Amanda client and server. The Amanda server package needs to be installed on every server system. Documentation: http://wiki.zmanda.com/ Mailing Lists: http://www.amanda.org/support/mailinglists.php Forums: http://forums.zmanda.com/ amanda-3.3.6/packaging/sun-pkg/server/preinstall.src0000775000076400007640000000261412357250001024145 0ustar00martineamartinea00000000000000#!/usr/bin/sh PATH=/usr/bin:/usr/local/bin:/usr/sbin:/opt/csw/bin export PATH LOGFILE=`mktemp /tmp/amanda-server-install.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to mktemp!" 1>&2 exit 1 fi export LOGFILE amanda_user=amandabackup; export amanda_user amanda_group=disk; export amanda_group # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR="${basedir}%%AMANDAHOMEDIR%%"; export AMANDAHOMEDIR os=`uname`; export os wanted_shell=/usr/bin/bash; export wanted_shell LOGDIR="${basedir}%%LOGDIR%%"; export LOGDIR INSTALL_LOG=${LOGDIR}/install.log; export INSTALL_LOG SYSCONFDIR="${basedir}/etc"; export SYSCONFDIR # See packaging/common/ for shell function libraries. # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%PRE_INST_FUNCTIONS%% # -------- End Common functions ---------- logger "Preparing to install: Amanda Server %%VERSION%%" create_user check_user_group "${amanda_group}" || add_group "${amanda_group}" check_user_supplemental_group "tape" || add_group "tape" check_user_shell "${wanted_shell}" check_user_homedir "${AMANDAHOMEDIR}" check_homedir || create_homedir create_logdir logger "Preinstall done." cat $LOGFILE > $INSTALL_LOG && rm $LOGFILE || \ echo "Amanda preinstall logs can be found in '$LOGFILE'." amanda-3.3.6/packaging/sun-pkg/server/depend0000664000076400007640000000114412357250001022433 0ustar00martineamartinea00000000000000P SUNWcsu Core Solaris P SUNWbash GNU Bourne-again shell (bash) P SUNWsshcu SSH Common P SUNWscpu Source Compatibility P SUNWgzip GNU Zip P CSWgtar gnutar P SUNWgnome-base-libs GNOME base GUI libraries P CSWperl perl - A high-level, general-purpose programming language. P CSWlibcurl4 libcurl P SUNWflexruntime Lex Runtime Libraries I AmandaEnterpriseBackupClient Amanda Enterprise Backup Client from Zmanda I AmandaEnterpriseBackupServer Amanda Enterprise Backup Server from Zmanda I ZMANae-client Amanda Enterprise Backup Client from Zmanda I ZMANae-server Amanda Enterprise Backup Server from Zmanda amanda-3.3.6/packaging/sun-pkg/buildpkg0000775000076400007640000002653112357250001021501 0ustar00martineamartinea00000000000000#!/bin/sh # This is useful for debugging #set -x if [ "$1" = "-v" ]; then silent_make_flags="" shift else silent_make_flags="-s LIBTOOLFLAGS=--silent" fi if [ -f /opt/csw/bin/gmake ]; then MAKE=/opt/csw/bin/gmake else MAKE=make fi #### CHECKS if [ ! -f common-src/amanda.h ]; then echo "Error: 'buildpkg' must be run from the root of an otherwise unused amanda source" echo " directory." >&2 exit 1 fi if [ ! -f configure ]; then echo "Error: The source directory has not been autogen'd -- please download a source" echo " distribution tarball or run ./autogen. You will need autoconf, automake," echo " and libtool to run autogen (but not to compile from a distribution tarball)." exit 1 fi # Until we get package revisioning in community. [ -f "PKG_REV" ] || echo "1" > PKG_REV pkg_root=packaging/sun-pkg get_version() { # Get our version using substitute.pl echo "%%VERSION%%" > ${pkg_root}/version.src /opt/csw/bin/perl packaging/common/substitute.pl ${pkg_root}/version.src ${pkg_root}/version || exit 1 VERSION=`cat ${pkg_root}/version` rm ${pkg_root}/version.src ${pkg_root}/version || exit 1 } do_substitution() { file_list="client/pkginfo \ client/preinstall \ client/postinstall \ client/postremove \ server/pkginfo \ server/preinstall \ server/postinstall \ server/postremove" for file in ${file_list}; do /opt/csw/bin/perl packaging/common/substitute.pl \ ${pkg_root}/${file}.src \ ${pkg_root}/${file} || exit 1 done chmod ug+x ${pkg_root}/*/pre* ${pkg_root}/*/post* } do_build() { # Run for each server and client package. .pkg files don't get whacked. # $1 must be "client" or "server" [ x"$1" = x"client" ] || [ x"$1" = x"server" ] || \ { echo "client or server not given" && exit 1; } rm -rf ${INSTALL_DEST} ${PKG_DEST} mkdir ${INSTALL_DEST} ${PKG_DEST} || exit 1 ${MAKE} ${silent_make_flags} distclean echo "Running configure.." CONF="$CONF \ STAR=/opt/csw/bin/star \ GNUTAR=/opt/csw/bin/gtar \ --quiet \ --with-user=amandabackup \ --with-group=disk \ --prefix=/${PREFIX} \ --exec-prefix=/${PREFIX} \ --sbindir=/${PREFIX}/sbin \ --sysconfdir=/${ETCDIR} \ --with-amandates=/${ETCDIR}/amandates \ --mandir=/${PREFIX}/share/man \ --with-amlibexecdir=/${amlibdir}/amanda \ --with-amperldir=/${amlibdir}/amanda/perl \ --localstatedir=/${LOCALSTATEDIR} \ --with-amdatadir=/${AMSTATEDIR} \ --with-gnutar-listdir=/${AMSTATEDIR}/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ --with-fqdn \ --with-bsd-security \ --with-bsdtcp-security \ --with-bsdudp-security \ --with-udpportrange=800,840 \ --with-tcpportrange=11000,11040 \ --with-low-tcpportrange=800,840 \ --with-ssh-security \ --with-debugging=/${DBGDIR} \ --with-assertions \ --with-readline \ --disable-installperms \ --disable-syntax-checks \ --disable-static" # PKG_CONFIG_PATH was exported, so is in the environment. ./configure CFLAGS="${CFLAGS}" \ CPPFLAGS="${CPPFLAGS}" \ LDFLAGS="${LDFLAGS}" \ GLIB_CFLAGS="${GLIB_CFLAGS}" \ GLIB_LIBS="${GLIB_LIBS}" \ GLIB_GENMARSHAL=glib-genmarshal \ GOBJECT_QUERY=gobject-query \ GLIB_MKENUMS=glib-mkenums \ MAKE=${MAKE} \ ${CONF} || exit 1 echo "Building $1.." # rpcgen should be run natively on solaris, linux generated XDR stubs # are not compatible. Specially when being compiled in 64 bit mode. # Ideally this should be part of Make. (cd ndmp-src;rm -f ndmp?_xdr.c) ${MAKE} ${silent_make_flags}|| exit 1 ${MAKE} ${silent_make_flags} DESTDIR=${INSTALL_DEST} install || exit 1 # the gnulib makefiles create $amlibdir/charset.alias in hopes of "merging" # it with a similar file from other applications. This doesn't work with # DESTDIR, and anyway Amanda doesn't need this kind of fanciness because it # doesn't really use gettext. So we just kill the file. See bug 10955 for # more detail. rm -f ${INSTALL_DEST}/${amlibdir}/charset.alias # Create gnutar-lists mkdir ${INSTALL_DEST}/${PREFIX}/gnutar-lists echo "Amanda Enterprise Edition - version ${VERSION}" > ${INSTALL_DEST}/${PREFIX}/amanda-release || exit 1 } do_package() { # First parameter is the subpkg, in all lower case. subpkg=${1} gnu_triplet=`/bin/sh ${src_dir}/config/config.guess` # Some but not all solaris packages have arch-plat-os dependent depend # files. if [ -f ${src_dir}/${pkg_root}/${subpkg}/depend-${gnu_triplet} ]; then # Move the arch-plat-os specific depend file to "depend" mv ${src_dir}/${pkg_root}/${subpkg}/depend-${gnu_triplet} \ ${src_dir}/${pkg_root}/${subpkg}/depend || exit 1 # Delete extra depend-${gnu_triplet} files rm ${src_dir}/${pkg_root}/${subpkg}/depend-* fi cp ${src_dir}/${pkg_root}/${subpkg}/* ${PKG_DEST} || exit 1 cd ${INSTALL_DEST} || exit 1 # amanda does not create /etc/amanda mkdir -p ${AMSTATEDIR} || exit 1 mkdir -p ${ETCDIR}/amanda || exit 1 # Add the contents of 'pkgproto' along with all installed files to # 'prototype'. pkgproto will generate file list for provided base # directories including the base dir. Including base dir in the pkg should # be avoided as the pkg installation will try to alter the base directory # permissions and ownership per pkg settings if included. cat "${PKG_DEST}/pkgproto" \ >> ${PKG_DEST}/prototype || exit 1 pkgproto $PREFIX ${AMSTATEDIR} ${ETCDIR}/amanda >> ${PKG_DEST}/prototype || exit 1 # Using --disable-installperms creates installperms.sh, which this bit of # perl will merge into the prototype. Note that this perl script is # perl-5.4 compatible cat > "${src_dir}/process_proto" <<'EOF' use strict; # make a hash from installperms open(INSTPERM, "<" . shift @ARGV) or die("open installperms.sh: $!"); my %installperms = map { my ($u, $xtra, $g, $m, $fn) = ($_ =~ /^installperm "([^:"]+)(:?([^:"]+))?" "([^"]*)" "(.*)"/); $fn =~ s{^/}{}; # pkgproto has files without the leading slash ($fn, [ $u, $g, $m ]); } ; # set user/group/mode from installperms, defaulting to amandabackup:disk open(PROTO, "<" . shift @ARGV) or die("open proto: $!"); for my $line () { if ($line !~ /^[df]/) { print $line; next; } my ($type, $class, $file, $mode, $user, $group) = split(/ /, $line); # default to amandabackup:disk, without changing mode ($user, $group) = ( "amandabackup", "disk" ); if (exists $installperms{$file}) { my ($u, $g, $m) = @{$installperms{$file}}; $user = $u if $u; $group = $g if $g; $mode = $m if $m; } print "$type $class $file $mode $user $group\n"; } EOF perl "${src_dir}/process_proto" \ "${src_dir}/installperms.sh" \ "${PKG_DEST}/prototype" \ > "${PKG_DEST}/prototype~" || exit 1 mv "${PKG_DEST}/prototype~" "${PKG_DEST}/prototype" # Look for installed files in ${INSTALL_DEST}, send package to ${PKG_DEST} pkgmk -r ${INSTALL_DEST} -o -f ${PKG_DEST}/prototype -d ${PKG_DEST} \ || exit 1 # pkgtrans puts the package back in our src_dir, where I would expected # it, and "translates" it into a .pkg file at the same time. pkgtrans -s ${PKG_DEST} ${src_dir}/AMANamanda-${subpkg}-${VERSION}-${gnu_triplet}.pkg<&2 exit 1 fi amanda_user=amandabackup; export amanda_user amanda_group=disk; export amanda_group # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR="${basedir}%%AMANDAHOMEDIR%%"; export AMANDAHOMEDIR os=SunOS; export os arch=%%ARCH%%; export arch LOGDIR="${basedir}%%LOGDIR%%"; export LOGDIR INSTALL_LOG="${LOGDIR}/install.log"; export INSTALL_LOG SYSCONFDIR="${basedir}/etc"; export SYSCONFDIR SBINDIR="${basedir}/usr/sbin"; export SBINDIR AMTMP="/tmp/amanda" AMANDATES=${SYSCONFDIR}/amandates; export AMANDATES # uuencode is still standard on sol10, but haven't checked sol 11. encoder=`{ command -v base64 2>/dev/null; } || { command -v uuencode 2>/dev/null; }` # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_INST_FUNCTIONS%% # -------- End Common functions ---------- add_service rel=`uname -r` if [ "$rel" = "5.8" ]; then check_inetd "amandaclient" case $? in 0) backup_inetd "amandaclient" install_inetd "amandaclient" ;; 1) install_inetd "amandaclient" ;; 2) logger "Error: Amanda service not installed because inetd config was not found: either inetd config is not present or inetd is a directory." ;; esac # Amanda clients should not have the server xinetd installed. check_inetd "amandaserver" case $? in 0) backup_inetd "amandaserver" ;; esac reload_inetd else # Solaris 10+ uses smf, but we can't differentiate server from client, all # entries end up named "amanda" check_smf "amanda" case $? in 0) backup_smf || logger "Warning: Backup of existing service failed. continuing..." install_smf "amandaclient" || \ logger "Warning: Amanda service not installed." ;; 1) install_smf "amandaclient" ;; esac fi create_amandates check_amandates create_ampassphrase || \ logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created" create_gnupg create_amkey || \ logger "Info: amcrypt will not work until keys are created." # Checks permissions, but only tries decrypting if both .am_passphrase # and .gnupg/am_key.gpg exist. check_gnupg create_amandahosts check_amandahosts_entry root amindexd amidxtaped check_amandahosts_entry ${amanda_user} amdump check_amandahosts_perms create_ssh_key client create_profile check_profile install_client_conf create_amtmp logger "Amanda installation complete." exit_msg="Amanda installation log can be found in '${INSTALL_LOG}'." cat $LOGFILE >> $INSTALL_LOG && { rm $LOGFILE echo "${exit_msg} '${INSTALL_LOG}'." } || \ echo "${exit_msg} $LOGFILE." amanda-3.3.6/packaging/sun-pkg/client/depend-i386-pc-solaris2.100000664000076400007640000000124112357250001025443 0ustar00martineamartinea00000000000000P SUNWcsu Core Solaris (usr) P SUNWbash GNU Bourne-again shell (bash) P SUNWsshcu SSH Common (usr) P SUNWgzip The GNU Zip (gzip) compression utility P CSWgtar gtar - GNU tape archiver P SUNWgnome-base-libs GNOME base GUI libraries - platform dependent files, /usr filesystem P CSWperl perl - A high-level, general-purpose programming language. P SUNWflexruntime Flex Lexer (Runtime Libraries) I AmandaEnterpriseBackupServer Amanda Enterprise Backup Server from Zmanda I AmandaEnterpriseBackupClient Amanda Enterprise Backup Client from Zmanda I ZMANae-server Amanda Enterprise Backup Server from Zmanda I ZMANae-client Amanda Enterprise Backup Client from Zmanda amanda-3.3.6/packaging/sun-pkg/client/postremove.src0000775000076400007640000000220512357250001024137 0ustar00martineamartinea00000000000000#!/bin/sh LOGFILE=`mktemp /tmp/amanda-client-rm-log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi amanda_user=amandabackup amanda_group=disk # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR=${basedir}%%AMANDAHOMEDIR%% os=SunOS dist=%%DISTRO%% LOGDIR=${basedir}%%LOGDIR%% SYSCONFDIR=${basedir}/etc # ---------- Common functions ------------ # see packaging/common/ in the source tree %%COMMON_FUNCTIONS%% %%POST_RM_FUNCTIONS%% # -------- End Common functions ---------- rel=`uname -r` case $rel in 5.8|5.9) if check_inetd "amanda"; then rm_inetd "amanda" || { \ logger "Warning: Did not successfully remove amanda from SMF."; exit 1; } reload_inetd fi ;; 5.10) if check_smf "amanda"; then rm_smf "amanda" || { \ logger "Warning: Did not successfully remove amanda from SMF."; exit 1; } fi ;; esac logger "Amanda Client removed." amanda-3.3.6/packaging/sun-pkg/client/pkginfo.src0000664000076400007640000000111712357250001023367 0ustar00martineamartinea00000000000000PKG="AMANamanda-client" ARCH="%%ARCH%%" VERSION="%%VERSION%%-%%PKG_REV%%" CATEGORY="system" VENDOR="Amanda project, http://www.amanda.org/" EMAIL="support@zmanda.com" BASEDIR="/" CLASSES="none" MAXINST=1 INTONLY=1 NAME="Amanda Community Backup Client" DESC="Amanda is the leading Open-Source Backup and Archiving software. This package contains the Amanda client. The Amanda server package needs to be installed on every system that is being backed up. Documentation: http://wiki.zmanda.com/ Mailing Lists: http://www.amanda.org/support/mailinglists.php Forums: http://forums.zmanda.com/ amanda-3.3.6/packaging/sun-pkg/client/preinstall.src0000775000076400007640000000252312357250001024114 0ustar00martineamartinea00000000000000#!/usr/bin/sh PATH=/usr/bin:/usr/local/bin:/usr/sbin:/opt/csw/bin export PATH LOGFILE=`mktemp /tmp/amanda-client-install.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to mktemp!" 1>&2 exit 1 fi export LOGFILE amanda_user=amandabackup; export amanda_user amanda_group=disk; export amanda_group # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime. # Unfortunately, it messes things up to have basedir="/". [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR} AMANDAHOMEDIR="${basedir}%%AMANDAHOMEDIR%%"; export AMANDAHOMEDIR os=`uname`; export os wanted_shell=/usr/bin/bash; export wanted_shell LOGDIR="${basedir}%%LOGDIR%%"; export LOGDIR INSTALL_LOG=${LOGDIR}/install.log; export INSTALL_LOG SYSCONFDIR="${basedir}/etc"; export SYSCONFDIR # See packaging/common/ for shell function libraries. # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%PRE_INST_FUNCTIONS%% # -------- End Common functions ---------- logger "Preparing to install: Amanda Client %%VERSION%%" create_user check_user_group "${amanda_group}" || add_group "${amanda_group}" check_user_shell "${wanted_shell}" check_user_homedir "${AMANDAHOMEDIR}" check_homedir || create_homedir create_logdir logger "Preinstall done." cat $LOGFILE > $INSTALL_LOG && rm $LOGFILE || \ echo "Amanda preinstall logs can be found in '$LOGFILE'." amanda-3.3.6/packaging/sun-pkg/client/depend-sparc-sun-solaris2.100000664000076400007640000000123312357250001026266 0ustar00martineamartinea00000000000000P SUNWcsu Core Solaris (usr) P SUNWbash GNU Bourne-again shell (bash) P SUNWsshcu SSH Common P SUNWgzip The GNU Zip (gzip) compression utility P CSWgtar gtar - GNU tape archiver P SUNWgnome-base-libs GNOME base GUI libraries - platform dependent files, /usr filesystem P CSWperl perl - A high-level, general-purpose programming language. P SUNWflexruntime Flex Lexer (Runtime Libraries) I AmandaEnterpriseBackupServer Amanda Enterprise Backup Server from Zmanda I AmandaEnterpriseBackupClient Amanda Enterprise Backup Client from Zmanda I ZMANae-server Amanda Enterprise Backup Server from Zmanda I ZMANae-client Amanda Enterprise Backup Client from Zmanda amanda-3.3.6/packaging/README0000664000076400007640000000211012357250001017231 0ustar00martineamartinea00000000000000This directory contains scripts and data files necessary to build various binary (or source) installation packages. These are the currently functional packages: -.deb packages -RPMs for various OSes that use them. TODO: Wiki page with a full list of RPM using distros and versions the .spec supports. Coming soon: -ebuilds for Gentoo -.msi packages for Windows XP and Server 2003 -macosx-pkg builds -Solaris .pkg builds for 9,10 -Common files which can be shared by all packages such License.txt, README, or Copyrights. The Directory layout is as follows: packaging/ deb/ # Debian rpm/ # RPM Each subdirectory (except common) has a shell script named buildpkg. This script will actually build the package with Zmanda's defaults for you. Notes: -deb package changelog is non-standard when checked out. either use packaging/deb/buildpkg to build the package, or replace %%VERSION%% with the correct number supplied in configure.in at approximately line 10: AM_INIT_AUTOMAKE( ... ) See http://wiki.zmanda.com/index.php/Installation for more information. amanda-3.3.6/packaging/rpm/0000775000076400007640000000000012357750430017170 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/rpm/buildpkg0000775000076400007640000000503312357250001020705 0ustar00martineamartinea00000000000000#!/bin/bash # Buildpkg script for producing RPM packages. (Does not require root access.) # Buildpkg is designed to be used by both buildbot (to automate rpm production) # and by J Random User (to build an rpm for kicks). The odd way of handling # all optioins through environment variables is a product of buildbot. # # AMVER: the version of amanda we're working on. This will become part of the # rpm name. AMVER must line up with the version number mentioned in the # .spec file. # PKG_DIR: Rpmbuild expects absolute paths, so we provide this var. It also # allows you to build somewhere other than `pwd`. You probably don't want # to use the system-wide location, as the script tries to blow these # directories away. # # Other Hints: # Not everyone will want to use the ./configure options we provide. The # easiest way to change them is by editing the .spec file. This isn't so # easy, unfortunately. Look at the %build section, and the %define xxxx # statements immediately above it. good luck. # This is useful for debugging set -x # Check for $AMVER, or pull it from configure.in if [ -z $AMVER ]; then VER=`cat FULL_VERSION` AMVER=amanda-${VER} fi # Until we get package revisioning in community. [ -f "PKG_REV" ] || echo "1" > PKG_REV [ -f "./configure" ] || \ { echo "./configure does not exist, please run ./autogen"; exit 1; } # Substitute amanda.spec.src /usr/bin/perl packaging/common/substitute.pl \ packaging/rpm/amanda.spec.src packaging/rpm/amanda.spec || exit 1 PKG_TARBALL=${AMVER}.tar.gz if [ ! -f "${PKG_TARBALL}" ]; then mkdir ${AMVER} || exit 1 cp -Rfp * ${AMVER}/ tar -cf ${PKG_TARBALL} -z ${AMVER} || exit 1 rm -rf ${AMVER} || exit 1 fi # Check for the packaging dirs. if [ -z "$PKG_DIR" ]; then PKG_DIR=${PWD} fi if [ ! -d ${PKG_DIR} ]; then mkdir ${PKG_DIR} || exit 1 fi cd ${PKG_DIR} if [ -d rpm ]; then rm -rf rpm || exit 1 fi mkdir rpm mkdir rpm/SOURCES mkdir rpm/SRPMS mkdir rpm/SPECS mkdir rpm/BUILD mkdir rpm/RPMS || exit 1 # Make a copy of the tarball in the rpmbuild location cp ${PKG_TARBALL} rpm/SOURCES/${PKG_TARBALL} || exit 1 cp packaging/rpm/amanda.spec rpm/SPECS || exit 1 # Rpmbuild requires absolute paths. annoying. If you need to change the # default value of some rpm.spec variable, just pass extra --define options. # this is useful for changing %amanda_release or %amanda_version rpmbuild -ba --define "_topdir ${PKG_DIR}/rpm" \ ${PKG_DIR}/rpm/SPECS/amanda.spec || exit 1 cp rpm/RPMS/*/*.rpm . || exit 1 cp rpm/SRPMS/*.rpm . || exit 1 amanda-3.3.6/packaging/rpm/amanda.spec.src0000664000076400007640000006537112357250001022054 0ustar00martineamartinea00000000000000# # Copyright (C) 2005-2013 Zmanda Incorporated. # All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # %define build_srpm 0 %{?srpm_only: %define build_srpm 1} # Pkg-config sometimes needs its own path set, and we need to allow users to # override our guess during detection. This macro takes care of that. # If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is # set then use the env var. %{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}} %{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}\n}} # LDFLAGS: newer gnu linkers can use "-Wl,--as-needed", while older ones, # like rhel3 and sles9 can't. %define enable_as_needed --enable-as-needed # Define which Distribution we are building: # Try to detect the distribution we are building: %if %{_vendor} == amazon %define dist amazon %define disttag amzn %define distver 1 %define curl libcurl %endif %if %{_vendor} == redhat # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least # fc3-8. So RHEL and Fedora look at the same file. Different versions have # different numbers of spaces; hence the use of $3 vs. $4.. %if %(awk '$1 == "Fedora" { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver %(awk '{print $4}' /etc/redhat-release) %endif # if macro cannot have an empty test and we're just testing the existance %if %{?fedora:yes}%{!?fedora:no} == yes # In theory this should be more reliable than awking for distver. %define distver %{fedora} %endif %if "%{dist}" == "fedora" %if %{distver} <= 8 %define requires_libtermcap Requires: libtermcap.so.2 %define curl curl %endif %if %{distver} >= 9 %define curl libcurl %endif %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686 # Do nothing if PKG_CONFIG_PATH was set by the user above. %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig} %endif %endif %if %(awk '$1 == "Red" && $7 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 3 %define tarver 1.14 %define requires_libtermcap Requires: libtermcap.so.2 %define curl curl %define without_ipv6 --without-ipv6 %undefine enable_as_needed %define prereq_sharutils PreReq: sharutils %endif %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 4 %define tarver 1.14 %define requires_libtermcap Requires: libtermcap.so.2 %define curl curl %define prereq_sharutils PreReq: sharutils %endif %if %(awk '$1 == "CentOS" && $3 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 4 %define tarver 1.14 %define requires_libtermcap Requires: libtermcap.so.2 %define curl curl %define prereq_sharutils PreReq: sharutils %endif %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 5 %define curl curl %endif %if %(awk '$1 == "CentOS" && $3 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 5 %define curl curl %endif %if %(awk '$1 == "Red" && $7 ~ /6.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 6 %define curl libcurl %endif # If dist is undefined, we didn't detect. %{!?dist:%define dist unknown} %endif # Detect Suse variants. %if %{_vendor} == "suse" %define dist SuSE %define disttag %(awk '$1=="openSUSE" { print "suse"; } $1=="SUSE" {$3=="Enterprise" ? TAG="sles" : TAG="suse" ; print TAG}' /etc/SuSE-release) # use printf to be sure rpm gets a number type %define distver %(awk '$1=="openSUSE" { printf("%d", $2); } $1=="SUSE" {$3=="Enterprise" ? VER=$5 : VER=$3 ; printf("%d", VER)}' /etc/SuSE-release) %define curl curl %if %{distver} == 9 %undefine enable_as_needed %endif %if %{distver} < 11 %define prereq_sharutils PreReq: sharutils %endif %endif # Set options per distribution %if %{dist} == redhat || %{dist} == fedora %define rpm_group Applications/Archiving %define requires_initscripts Requires: initscripts %endif %if %{dist} == SuSE %define rpm_group Productivity/Archiving/Backup %endif # Let's die if we haven't detected the distro. This might save some frustration. # RPM does not provide a way to exit gracefully, hence the tag_to_cause_exit. %{!?distver: %{error:"Your distribution and its version were not detected."}; %tag_to_cause_exit } # Set minimum tar version if it wasn't set in the per-distro section %{!?tarver: %define tarver 1.15} # Define the native binary data encoder (for create_amkey) %define encoder %({ command -v base64 2>/dev/null; } || { command -v uuencode 2>/dev/null; }) %define packer %(%{__id_u} -n) # --- Definitions --- # Define amanda_version using the value determined by # packaging/common/substitute.pl. %{!?amanda_version: %define amanda_version %%VERSION%% } %{!?amanda_release: %define amanda_release 1} %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" %define amanda_user amandabackup %define amanda_group disk Summary: The Amanda Backup and Archiving System Name: amanda Version: %{amanda_version} %define rpm_release %{amanda_release}.%{disttag}%{distver} %if %{build_srpm} %define rpm_release %{amanda_release} %endif Release: %{rpm_release} Source: %{name}-%{version}.tar.gz License: http://wiki.zmanda.com/index.php/Amanda_Copyright Vendor: Zmanda, Inc. Packager: www.zmanda.com BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot Group: %{rpm_group} # TODO - Need required versions for these: BuildRequires: autoconf BuildRequires: automake BuildRequires: binutils BuildRequires: bison BuildRequires: flex BuildRequires: gcc BuildRequires: glib2 >= 2.2.0 BuildRequires: glib2-devel BuildRequires: gettext BuildRequires: readline # Note: newer distros have changed most *-devel to lib*-devel, and added a # provides tag for backwards compat. BuildRequires: readline-devel BuildRequires: %{curl} >= 7.10.0 BuildRequires: %{curl}-devel >= 7.10.0 BuildRequires: openssl BuildRequires: openssl-devel BuildRequires: perl(ExtUtils::Embed) %{?prereq_sharutils} Requires: /bin/awk Requires: /bin/date Requires: /usr/bin/id Requires: /sbin/ldconfig Requires: /bin/sh Requires: /usr/sbin/useradd Requires: /usr/sbin/usermod Requires: fileutils Requires: gettext Requires: grep Requires: gnuplot Requires: %{curl} >= 7.10.0 Requires: openssl Requires: xinetd Requires: perl >= 5.6.0 Requires: tar >= %{tarver} Requires: readline %{?requires_libtermcap} %{?requires_initscripts} %package backup_client Summary: The Amanda Backup and Archiving Client Group: %{rpm_group} Requires: /bin/awk Requires: fileutils Requires: grep %{?requires_libtermcap} %{?requires_initscripts} Requires: xinetd Requires: perl >= 5.6.0 Requires: tar >= %{tarver} Requires: readline Provides: amanda-backup_client = %{amanda_version} Provides: libamclient-%{version}.so = %{amanda_version} Provides: libamanda-%{version}.so = %{amanda_version} Conflicts: amanda-backup_server # Native package names Obsoletes: amanda, amanda-client, amanda-server %package backup_server Summary: The Amanda Backup and Archiving Server Group: %{rpm_group} Requires: /bin/awk Requires: fileutils Requires: grep %{?requires_libtermcap} %{?requires_initscripts} Requires: xinetd Requires: perl >= 5.6.0 Requires: tar >= %{tarver} Provides: amanda-backup_server = %{amanda_version} Provides: libamclient-%{version}.so = %{amanda_version} Provides: libamanda-%{version}.so = %{amanda_version} Provides: libamserver-%{version}.so = %{amanda_version} Provides: libamtape-%{version}.so = %{amanda_version} Provides: libamdevice-%{version}.so = %{amanda_version} Conflicts: amanda-backup_client # Native package names Obsoletes: amanda, amanda-client, amanda-server # --- Package descriptions --- %description Amanda is the leading Open-Source Backup and Archiving software. The amanda-backup_server package should be installed on the Amanda server, i.e. the machine attached to backup media (such as a tape drive or disk drives) where backups will be written. The amanda-backup_server package includes Amanda client. The amanda-backup_client package needs to be installed on every system that is being backed up. Amanda Forums is located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ %description backup_server Amanda is the leading Open-Source Backup and Archiving software. This package contains the Amanda server. The amanda-backup_server package should be installed on the Amanda server, i.e. the machine attached to backup media (such as a tape drive or disk drives) where backups will be written. The amanda-backup_server package includes Amanda client. Amanda Forums is located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ %description backup_client Amanda is the leading Open-Source Backup and Archiving software. This package contains the Amanda client. The amanda-backup_client package needs to be installed on every system that is being backed up. Amanda Forums is located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ # --- Directory setup --- # Configure directories: %define PREFIX /usr %define EPREFIX %{PREFIX} %define BINDIR %{EPREFIX}/bin %define SBINDIR %{EPREFIX}/sbin %define LIBEXECDIR %{EPREFIX}/libexec %define AMLIBEXECDIR %{LIBEXECDIR}/amanda %define DATADIR %{PREFIX}/share %define SYSCONFDIR /etc %define LOCALSTATEDIR /var %define AMANDATES %{AMANDAHOMEDIR}/amandates %define AMANDAHOMEDIR %{LOCALSTATEDIR}/lib/amanda %ifarch x86_64 %define LIBDIR %{EPREFIX}/lib64 %else %define LIBDIR %{EPREFIX}/lib %endif %define AMLIBDIR %{LIBDIR}/amanda %define INCLUDEDIR %{PREFIX}/include %define MANDIR %{DATADIR}/man %define LOGDIR /var/log/amanda %define PERLSITELIB %(eval "`perl -V:installsitelib`"; echo $installsitelib) %define AMDATADIR /var/lib/amanda # Installation directories: %define ROOT_SBINDIR %{buildroot}/%{SBINDIR} %define ROOT_LIBEXECDIR %{buildroot}/%{LIBEXECDIR} %define ROOT_DATADIR %{buildroot}/%{DATADIR} %define ROOT_LOCALSTATEDIR %{buildroot}/%{LOCALSTATEDIR} %define ROOT_SYSCONFDIR %{buildroot}/%{SYSCONFDIR} %define ROOT_AMANDAHOMEDIR %{buildroot}/%{AMANDAHOMEDIR} %define ROOT_LIBDIR %{buildroot}/%{LIBDIR} %define ROOT_MANDIR %{buildroot}/%{MANDIR} %define ROOT_LOGDIR %{buildroot}/%{LOGDIR} %define ROOT_AMDATADIR %{buildroot}/%{AMDATADIR} # --- Unpack --- %prep %setup -q # --- Configure and compile --- %build %define config_user %{amanda_user} %define config_group %{amanda_group} # Set PKG_CONFIG_PATH=some/path if some/path was set on the command line, or by # the platform detection bits. # without_ipv6 should only be defined on rhel3. # LDFLAGS macro is defined except on rhel3. # --enable-as-needed must be conditional until configure tests whether # ld can accept --as-needed. ./configure \ %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \ CFLAGS="%{optflags} -g -pipe" CXXFLAGS="%{optflags}" \ %{?LDFLAGS:LDFLAGS="${LDFLAGS} %{?LDFLAGS:%LDFLAGS}"} \ %{?enable_as_needed:%{enable_as_needed}} \ --quiet \ --prefix=%{PREFIX} \ --sysconfdir=%{SYSCONFDIR} \ --sharedstatedir=%{LOCALSTATEDIR} \ --localstatedir=%{LOCALSTATEDIR} \ --libdir=%{LIBDIR} \ --includedir=%{INCLUDEDIR} \ --mandir=%{MANDIR} \ --with-amdatadir=%{AMDATADIR} \ --with-gnuplot=/usr/bin/gnuplot \ --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ --with-user=%{config_user} \ --with-group=%{config_group} \ --with-owner=%{packer} \ --with-fqdn \ --with-bsd-security \ --with-bsdtcp-security \ --with-bsdudp-security \ --with-ssh-security \ --with-debugging=%{LOGDIR} \ --with-assertions \ --disable-installperms \ %{?without_ipv6} make -s LIBTOOLFLAGS=--silent # --- Install to buildroot --- %install if [ "%{buildroot}" != "/" ]; then if [ -d "%{buildroot}" ] ; then rm -rf %{buildroot} fi else echo "BuildRoot was somehow set to / !" exit -1 fi make -s -j1 LIBTOOLFLAGS=--silent DESTDIR=%{buildroot} install rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient mkdir %{buildroot}/{etc,var/log} mkdir %{ROOT_LOCALSTATEDIR}/amanda mkdir %{ROOT_SYSCONFDIR}/amanda mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists mkdir %{ROOT_LOGDIR} echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release # --- Clean up buildroot --- %clean if [ "%{buildroot}" != "/" ]; then if [ -d "%{buildroot}" ] ; then rm -rf %{buildroot} fi else echo "BuildRoot was somehow set to / !" exit -1 fi # --- Pre/post (un)installation scripts --- # Define script variables # Some versions of rpmbuild do not like multi-line macros in spec files. ugly. %define script_vars amanda_user=%{amanda_user}; amanda_group=%{amanda_group}; AMANDAHOMEDIR=%{AMANDAHOMEDIR}; os=Linux; wanted_shell=/bin/bash; dist=%{dist}; LOGDIR=%{LOGDIR}; INSTALL_LOG=$LOGDIR/install.log; SYSCONFDIR=%{SYSCONFDIR}; SBINDIR=%{SBINDIR}; encoder=%{encoder}; # --- Pre/post (un)installation scripts --- %pre backup_server ########################################## LOGFILE=`mktemp /tmp/amanda_server-preinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} # See packaging/common/ for shell function libraries. # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%PRE_INST_FUNCTIONS%% # -------- End Common functions ---------- logger "Preparing to install: Amanda Server %%VERSION%%" create_user check_user_group "${amanda_group}" || add_group "${amanda_group}" check_user_supplemental_group "tape" || add_group "tape" check_user_shell "${wanted_shell}" check_user_homedir "${AMANDAHOMEDIR}" check_homedir || create_homedir create_logdir logger "Preinstall done." cat $LOGFILE > $INSTALL_LOG && rm $LOGFILE || \ echo "Amanda preinstall logs can be found in '$LOGFILE'." %post backup_server ########################################## LOGFILE=`mktemp /tmp/amanda_server-postinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} AMANDATES=%{AMANDATES} # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_INST_FUNCTIONS%% # -------- End Common functions ---------- /sbin/ldconfig check_xinetd "amandaserver" case $? in 0) backup_xinetd "amandaserver" install_xinetd "amandaserver" ;; 1) install_xinetd "amandaserver" ;; 2) logger "Xinetd config not installed: either xinetd config is not present or xinetd.d is a file." ;; *) logger "bad return from check_xinetd"; exit 1 ;; esac # Amanda servers should not have the client xinetd installed. check_xinetd "amandaclient" case $? in 0) backup_xinetd "amandaclient" ;; esac check_superserver_running "xinetd" [ "$?" = "0" ] && action=restart || action=start reload_xinetd $action create_amandates check_amandates create_ampassphrase || \ logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created" create_gnupg create_amkey || \ logger "Info: amcrypt will not work until keys are created." # Checks permissions, but only tries decrypting if both .am_passphrase # and .gnupg/am_key.gpg exist. check_gnupg create_amandahosts check_amandahosts_entry root amindexd amidxtaped check_amandahosts_entry ${amanda_user} amdump check_amandahosts_perms create_ssh_key server create_ssh_key client create_profile check_profile install_client_conf logger "Amanda installation complete." cat $LOGFILE >> $INSTALL_LOG && { rm $LOGFILE; echo "Amanda installation log can be found in '${INSTALL_LOG}'."; } || \ echo "Amanda postinstall logs can be found in '$LOGFILE'." %postun backup_server ########################################## LOGFILE=`mktemp /tmp/amanda_server-remove.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_RM_FUNCTIONS%% # -------- End Common functions ---------- /sbin/ldconfig # Check for parameter to script (are we upgrading?) if [ $1 -gt 0 ]; then # We're upgrading action="upgrade" else # We're uninstalling action="uninstall" fi # See http://fedoraproject.org/wiki/Packaging/ScriptletSnippets for the reason # we only remove xinetd on uninstall. if [ "$action" = "uninstall" ]; then # Check for and remove existing xinetd configs check_xinetd "amandaserver" if [ $? -eq 0 ] ; then rm_xinetd "amandaserver" check_superserver_running "xinetd" && reload_xinetd fi check_inetd "amandaserver" if [ $? -eq 0 ] ; then rm_inetd "amandaserver" check_superserver_running "inetd" && reload_inetd fi if [ -f ${SYSCONFDIR}/amandates ]; then logger "Removing ${SYSCONFDIR}/amandates..." rm -rf ${SYSCONFDIR}/amandates fi if [ -d ${SYSCONFDIR}/amanda ]; then logger "Removing ${SYSCONFDIR}/amanda if empty..." rmdir ${SYSCONFDIR}/amanda 2> /dev/null || true fi if [ -d /var/lib/amanda/gnutar-lists ]; then rm -rf /var/lib/amanda/gnutar-lists # Remove ${amanda_user} from sensitive groups. if which deluser >/dev/null 2>&1 ; then for group in tape; do # only call deluser when amandabackup is in $group if getent group "$group" | awk -F: '{ print $4 }' | awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' | grep "^${amanda_user}$" > /dev/null; then deluser ${amanda_user} $group || true fi done fi echo "Amanda removal log can be found in '$LOGFILE'." fi %pre backup_client ########################################## LOGFILE=`mktemp /tmp/amanda_client-preinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%PRE_INST_FUNCTIONS%% # -------- End Common functions ---------- logger "Preparing to install: %{amanda_version_info}" create_user check_user_group "${amanda_group}" || add_group "${amanda_group}" check_user_shell "${wanted_shell}" check_user_homedir "${AMANDAHOMEDIR}" check_homedir || create_homedir create_logdir logger "Preinstall done." cat $LOGFILE >> $INSTALL_LOG && rm $LOGFILE || \ echo "Amanda preinstall logs can be found in '$LOGFILE'." %post backup_client ########################################## LOGFILE=`mktemp /tmp/amanda_client-postinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} AMANDATES=%{AMANDATES} # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_INST_FUNCTIONS%% # -------- End Common functions ---------- /sbin/ldconfig check_xinetd "amandaclient" case $? in 0) backup_xinetd "amandaclient" install_xinetd "amandaclient" ;; 1) install_xinetd "amandaclient" ;; 2) logger "Xinetd config not installed: either xinetd config is not present or xinetd.d is a file." ;; *) logger "bad return from check_xinetd"; exit 1 ;; esac # Amanda clients should not have the server xinetd installed. check_xinetd "amandaserver" case $? in 0) backup_xinetd "amandaserver" ;; esac reload_xinetd create_amandates check_amandates create_ampassphrase || \ logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created" create_gnupg create_amkey || \ logger "Info: amcrypt will not work until keys are created." # Checks permissions, but only tries decrypting if both .am_passphrase # and .gnupg/am_key.gpg exist. check_gnupg create_amandahosts check_amandahosts_entry ${amanda_user} amdump check_amandahosts_perms create_ssh_key server create_ssh_key client create_profile check_profile install_client_conf logger "Amanda installation complete." cat $LOGFILE >> $INSTALL_LOG && { rm $LOGFILE; echo "Amanda installation log can be found in '${INSTALL_LOG}'."; } || \ echo "Amanda postinstall logs can be found in '$LOGFILE'." echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG} if [ -x /usr/bin/wget ]; then /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client fi %postun backup_client ########################################## LOGFILE=`mktemp /tmp/amanda_client-remove.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi %{script_vars} # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_RM_FUNCTIONS%% # -------- End Common functions ---------- /sbin/ldconfig # Check for parameter to script (are we upgrading?) if [ $1 -gt 0 ]; then # We're upgrading action="upgrade" else # We're uninstalling action="uninstall" fi # See http://fedoraproject.org/wiki/Packaging/ScriptletSnippets for the reason # we only remove xinetd on uninstall. if [ "$action" = "uninstall" ]; then # Check for and remove existing xinetd configs check_xinetd "amandaclient" if [ $? -eq 0 ] ; then rm_xinetd "amandaclient" reload_xinetd fi check_inetd "amandaclient" if [ $? -eq 0 ] ; then rm_inetd "amandaclient" reload_inetd fi if [ -f ${SYSCONFDIR}/amandates ]; then logger "Removing ${SYSCONFDIR}/amandates..." rm -rf ${SYSCONFDIR}/amandates fi if [ -d ${SYSCONFDIR}/amanda ]; then logger "Removing ${SYSCONFDIR}/amanda if empty..." rmdir ${SYSCONFDIR}/amanda 2> /dev/null || true fi if [ -d ${AMANDAHOMEDIR} ]; then logger "Removing ${AMANDAHOMEDIR}..." rm -rf ${AMANDAHOMEDIR} fi # Remove ${amanda_user} from sensitive groups. if which deluser >/dev/null 2>&1 ; then for group in tape; do # only call deluser when amandabackup is in $group if getent group "$group" | awk -F: '{ print $4 }' | awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' | grep "^${amanda_user}$" > /dev/null; then deluser ${amanda_user} $group || true fi done fi echo "Amanda removal log can be found in '$LOGFILE'." fi %files backup_client # --- Files to install --- # Notes: Do not use wildcards on directories not wholly owned by amanda. An # uninstall of the software will attempt to delete whatever matches here. %defattr(0755,%{amanda_user},%{amanda_group},0755) %{AMLIBEXECDIR} %{AMLIBDIR} %{PERLSITELIB}/auto/Amanda %defattr(4750,root,disk) %{AMLIBEXECDIR}/application/amgtar %{AMLIBEXECDIR}/application/amstar %{AMLIBEXECDIR}/calcsize %{AMLIBEXECDIR}/killpgrp %{AMLIBEXECDIR}/rundump %{AMLIBEXECDIR}/runtar %defattr(0750,%{amanda_user},%{amanda_group},0750) %{LOGDIR} %{SBINDIR}/amaespipe %{SBINDIR}/amcryp* %{SBINDIR}/amgpgcrypt %{SBINDIR}/amoldrecover %{SBINDIR}/amrecover %{SYSCONFDIR}/amanda %defattr(0644,%{amanda_user},%{amanda_group},0755) %{LOCALSTATEDIR}/amanda %{PERLSITELIB}/Amanda %{AMLIBEXECDIR}/amcat.awk %{AMANDAHOMEDIR}/gnutar-lists %doc %{AMANDAHOMEDIR}/amanda-release %doc %{AMANDAHOMEDIR}/example/xinetd.amandaclient %doc %{AMANDAHOMEDIR}/example/xinetd.amandaserver %doc %{AMANDAHOMEDIR}/example/amanda-client.conf %doc %{AMANDAHOMEDIR}/template.d/README %doc %{AMANDAHOMEDIR}/template.d/dumptypes %defattr(0644,root,root,0755) %docdir %{MANDIR} %{MANDIR}/man5/amanda.conf.5.gz %{MANDIR}/man5/amanda-client.conf.5.gz %{MANDIR}/man7/amanda-devices.7.gz %{MANDIR}/man7/amanda-applications.7.gz %{MANDIR}/man7/amanda-scripts.7.gz %{MANDIR}/man8/amaespipe.8.gz %{MANDIR}/man8/amanda.8.gz %{MANDIR}/man8/amcheckdump.8.gz %{MANDIR}/man8/amcrypt* %{MANDIR}/man8/amgpgcrypt.8.gz %{MANDIR}/man8/amrecover.8.gz %doc %{DATADIR}/amanda %files backup_server %defattr(0755,%{amanda_user},%{amanda_group}) %{AMLIBEXECDIR} %{AMLIBDIR} %{PERLSITELIB}/Amanda %{PERLSITELIB}/auto/Amanda %{AMANDAHOMEDIR} %{LOCALSTATEDIR}/amanda %{SBINDIR}/am* %defattr(4750,root,disk) %{AMLIBEXECDIR}/application/amgtar %{AMLIBEXECDIR}/application/amstar %{AMLIBEXECDIR}/calcsize %{AMLIBEXECDIR}/killpgrp %{AMLIBEXECDIR}/rundump %{AMLIBEXECDIR}/runtar %{AMLIBEXECDIR}/dumper %{AMLIBEXECDIR}/planner %{SBINDIR}/amcheck %{SBINDIR}/amservice %defattr(0750,%{amanda_user},%{amanda_group},0750) %{LOGDIR} %{SYSCONFDIR}/amanda # Files in standard dirs must be listed explicitly %{SBINDIR}/activate-devpay %{SBINDIR}/amaespipe %{SBINDIR}/amcrypt %{SBINDIR}/amcrypt-ossl %{SBINDIR}/amcrypt-ossl-asym %{SBINDIR}/amcryptsimple %{SBINDIR}/amgpgcrypt %{SBINDIR}/amoldrecover %{SBINDIR}/amrecover %defattr(0644,%{amanda_user},%{amanda_group}) %{AMLIBEXECDIR}/amcat.awk %{AMLIBEXECDIR}/amplot.awk %{AMLIBEXECDIR}/amplot.g %{AMLIBEXECDIR}/amplot.gp %doc %{AMANDAHOMEDIR}/amanda-release %docdir %{AMANDAHOMEDIR}/example %docdir %{AMANDAHOMEDIR}/template.d %defattr(0644,root,root,0755) %docdir %{MANDIR} %{MANDIR}/man5/am* %{MANDIR}/man5/disklist.5.gz %{MANDIR}/man5/tapelist.5.gz %{MANDIR}/man7/am* %{MANDIR}/man8/am* %{MANDIR}/man8/script-email.8.gz %doc %{DATADIR}/amanda # --- ChangeLog %changelog * %%DATE%% Dan Locks %{version} - Package created * Fri Aug 20 2010 Dan Locks 3.2.0alpha - use %%VERSION% macro instead of reading a file. error reported by ssgelm * Thu Aug 19 2010 Dan Locks 3.2.0alpha - Added detection of openSuSE 11 as suggested by ssgelm amanda-3.3.6/packaging/deb/0000775000076400007640000000000012357750430017124 5ustar00martineamartinea00000000000000amanda-3.3.6/packaging/deb/amanda-backup-server.dirs0000664000076400007640000000027112357250001023764 0ustar00martineamartinea00000000000000etc/amanda usr/share/lintian/overrides usr/share/man/man5 usr/share/man/man8 var/amanda var/lib/amanda var/lib/amanda/gnutar-lists var/lib/amanda/example/label-templates var/log/amanda amanda-3.3.6/packaging/deb/copyright0000664000076400007640000000246112357250001021047 0ustar00martineamartinea00000000000000 Builder: Zmanda Amanda copyright: http://wiki.zmanda.com/index.php/Amanda_Copyright /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991, 1996 University of Maryland at College Park * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ amanda-3.3.6/packaging/deb/amanda-backup-server.lintian0000664000076400007640000000175712357250001024473 0ustar00martineamartinea00000000000000amanda-backup-server: binary-or-shlib-defines-rpath usr/lib/amanda/* amanda-backup-server: binary-or-shlib-defines-rpath usr/libexec/amanda/* amanda-backup-server: binary-or-shlib-defines-rpath usr/sbin/am* amanda-backup-server: binary-without-manpage amoldrecover amanda-backup-server: manpage-has-bad-whatis-entry amanda-backup-server: file-in-unusual-dir usr/libexec/amanda/* amanda-backup-server: non-standard-dir-in-usr usr/libexec amanda-backup-server: non-standard-dir-perm var/lib/amanda/gnutar-lists amanda-backup-server: non-standard-dir-perm var/log/amanda amanda-backup-server: package-name-doesnt-match-sonames amanda-backup-server: setuid-binary usr/libexec/amanda/calcsize amanda-backup-server: setuid-binary usr/libexec/amanda/dumper amanda-backup-server: setuid-binary usr/libexec/amanda/killgrp amanda-backup-server: setuid-binary usr/libexec/amanda/planner amanda-backup-server: setuid-binary usr/libexec/amanda/rundump amanda-backup-server: setuid-binary usr/libexec/amanda/runtar amanda-3.3.6/packaging/deb/amanda-backup-server.install0000664000076400007640000000046112357250001024472 0ustar00martineamartinea00000000000000usr/lib/amanda/* usr/lib/amanda/application/* usr/libexec/amanda/* usr/libexec/amanda/application/* usr/sbin/* usr/share/man/man5/* usr/share/man/man7/* usr/share/man/man8/* var/lib/amanda/* var/lib/amanda/gnutar-lists/* var/lib/amanda/example/* var/lib/amanda/example/label-templates/* var/log/amanda/* amanda-3.3.6/packaging/deb/compat0000664000076400007640000000000212357250001020307 0ustar00martineamartinea000000000000004 amanda-3.3.6/packaging/deb/debian-binary0000664000076400007640000000001512357250001021534 0ustar00martineamartinea00000000000000version: 2.0 amanda-3.3.6/packaging/deb/amanda-backup-server.README.Debian0000664000076400007640000000032412357250001025140 0ustar00martineamartinea00000000000000Amanda Forums are located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ amanda-3.3.6/packaging/deb/control0000664000076400007640000000337012357250001020517 0ustar00martineamartinea00000000000000Source: amanda Section: utils Priority: optional Maintainer: Zmanda Inc Build-Depends: debhelper, dump, fakeroot, flex, gettext, gnuplot-nox|gnuplot, libtool, mailx|bsd-mailx, mtx, perl (>=5.6.0), procps, smbclient, libcurl-dev, libglib2.0-dev, libncurses5-dev, libreadline5-dev|libreadline-dev, libssl-dev Standards-Version: 3.6.1 Package: amanda-backup-server Architecture: any Depends: ca-certificates, xinetd, perl (>=5.6.0), gettext, mailx|bsd-mailx, ${shlibs:Depends}, ${perl:Depends} Suggests: gnuplot-nox|gnuplot Conflicts: amanda-client, amanda-common, amanda-server, amanda-backup-client Description: Amanda Network Backup and Archiving software . Amanda is the leading Open-Source Backup and Archiving software. . This package contains the Amanda server. The amanda-backup_server package should be installed on the Amanda server, i.e. the machine attached to backup media (such as a tape drive or disk drives) where backups will be written. The amanda-backup_server package includes Amanda client. . Amanda Forums are located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ Package: amanda-backup-client Architecture: any Depends: ca-certificates, xinetd, perl (>=5.6.0), gettext, ${shlibs:Depends}, ${perl:Depends} Conflicts: amanda-backup-server, amanda-client, amanda-common, amanda-server Description: Amanda Network Backup and Archiving software . Amanda is the leading Open-Source Backup and Archiving software. . This package contains the Amanda client. The amanda-backup_client package needs to be installed on every system that is being backed up. . Amanda Forums are located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ amanda-3.3.6/packaging/deb/amanda-backup-client.install0000664000076400007640000000117612357250001024446 0ustar00martineamartinea00000000000000usr/lib/amanda/* usr/lib/amanda/application/* usr/libexec/amanda/* usr/libexec/amanda/application/* usr/sbin/amaespipe usr/sbin/amcryp* usr/sbin/amgpgcrypt usr/sbin/amoldrecover usr/sbin/amrecover usr/sbin/amgetconf usr/share/man/man5/amanda.conf.5 usr/share/man/man5/amanda-client.conf.5 usr/share/man/man7/amanda-devices.7 usr/share/man/man7/amanda-applications.7 usr/share/man/man8/amanda.8 usr/share/man/man8/amcheckdump.8 usr/share/man/man8/amrecover.8 usr/share/man/man8/amgetconf.8 var/lib/amanda/* var/lib/amanda/gnutar-lists/* var/lib/amanda/example/xinetd.amandaclient var/lib/amanda/example/amanda-client.conf var/log/amanda/* amanda-3.3.6/packaging/deb/docs0000664000076400007640000000002412357250001017760 0ustar00martineamartinea00000000000000AUTHORS NEWS README amanda-3.3.6/packaging/deb/amanda-backup-server.postinst0000664000076400007640000000017412357250001024710 0ustar00martineamartinea00000000000000#!/bin/sh # Debian recommends this. Script exits on simple command failure. # set -e pkg_type=server other_pkg_type=client amanda-3.3.6/packaging/deb/changelog.src0000664000076400007640000000021212357250001021544 0ustar00martineamartinea00000000000000amanda (%%VERSION%%-1%%DISTRO%%%%DEB_REL%%) unstable; urgency=low * Initial debian release. -- Zmanda %%DATE%% amanda-3.3.6/packaging/deb/amanda-backup-client.postinst0000664000076400007640000000017412357250001024660 0ustar00martineamartinea00000000000000#!/bin/sh # Debian recommends this. Script exits on simple command failure. # set -e pkg_type=client other_pkg_type=server amanda-3.3.6/packaging/deb/watch0000664000076400007640000000006612357250001020144 0ustar00martineamartinea00000000000000# Compulsory line, this is a version 2 file version=2 amanda-3.3.6/packaging/deb/postrm.src0000775000076400007640000000443312357250001021155 0ustar00martineamartinea00000000000000# This get appended to amanda-backup-*-.postrm # vim: ft=sh LOGFILE=`mktemp /tmp/amanda-remove.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi amanda_user=amandabackup amanda_group=disk AMANDAHOMEDIR=%%AMANDAHOMEDIR%% os=Linux dist=%%DISTRO%% LOGDIR=%%LOGDIR%% SYSCONFDIR=/etc # ---------- Common functions ------------ # see packaging/common/ in the source tree %%COMMON_FUNCTIONS%% %%POST_RM_FUNCTIONS%% # -------- End Common functions ---------- remove() { if check_xinetd "amanda${pkg_type}"; then rm_xinetd "amanda${pkg_type}" || { \ logger "Warning: Did not successfully remove amanda${pkg_type} from xinetd."; exit 1; } check_superserver_running "xinetd" && reload_xinetd fi # Check for and remove existing inetd configs if check_inetd "amanda${pkg_type}"; then rm_inetd "amanda${pkg_type}" check_superserver_running "inetd" && reload_inetd fi } purge() { if [ -d ${SYSCONFDIR}/amanda ]; then logger "Removing ${SYSCONFDIR}/amanda if empty..." rmdir ${SYSCONFDIR}/amanda 2> /dev/null || true fi if [ -d ${LOGDIR} ]; then logger "Removing ${LOGDIR}..." rm -rf ${LOGDIR} fi if ! rmdir $AMANDAHOMEDIR; then logger "Message: $AMANDAHOMEDIR was not empty, and was not deleted: Contents are often backupsets. " fi if [ -f ${SYSCONFDIR}/amandates ]; then logger "Removing ${SYSCONFDIR}/amandates..." rm -rf ${SYSCONFDIR}/amandates fi # Remove ${amanda_user} from sensitive groups. if which deluser >/dev/null 2>&1 ; then for group in tape; do # only call deluser when amandabackup is in $group if getent group "$group" | awk -F: '{ print $4 }' | awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' | grep "^${amanda_user}$" > /dev/null; then deluser ${amanda_user} $group || true fi done fi } case "$1" in purge|abort-install) remove purge ;; remove|upgrade|deconfigure) remove ;; failed-upgrade|abort-upgrade) check_xinetd "amanda${pkg_type}" if [ $? -eq 1 ] ; then install_xinetd reload_xinetd fi ;; *) echo "unknown argument --> $1" >&2 exit 0 ;; esac amanda-3.3.6/packaging/deb/rules0000775000076400007640000001715112357250001020176 0ustar00martineamartinea00000000000000#!/usr/bin/make -f # debian/rules for amanda using debhelper. GNU copyright 2008 by Dan Locks, # based on work by Bdale Garbee. # Warning - do *not* use -j on an SMP machine, or the build gets # confused... some sort of race condition in the makefiles? # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 AMVER=`cat FULL_VERSION` # These are variables that the user can override. They get used in various # places during configure, build, and install. PREFIX=/usr BINDIR=$(PREFIX)/bin LIBDIR=$(PREFIX)/lib AMLIBDIR=$(LIBDIR)/amanda LIBEXECDIR=$(PREFIX)/libexec AMLIBEXECDIR=$(LIBEXECDIR)/amanda MANDIR=$(PREFIX)/share/man DOCDIR=$(PREFIX)/share/doc SYSCONFDIR=/etc LOCALSTATEDIR=/var AMANDAHOMEDIR=$(LOCALSTATEDIR)/lib/amanda LOGDIR=$(LOCALSTATEDIR)/log/amanda # Extract the perl site_lib directory. This is used to install amanda's perl # libs. If configure finds a different install or you specify a different path using # --with-amperldir= make sure you change this variable as well. PERLSITELIB=$(shell perl -V:installsitelib|sed -e"s:installsitelib='/::;s:'\;::") AMANDAUSER=amandabackup AMANDAGROUP=disk WITHOUT_SERVER="False" WITHOUT_CLIENT="False" r=$(shell pwd)/debian/tmp server=$(shell pwd)/debian/amanda-backup-server client=$(shell pwd)/debian/amanda-backup-client log=$(shell pwd)/debian/dpkg.log # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) WD=$(shell pwd) build: build-stamp build-stamp: /sbin/dump /usr/bin/smbclient dh_testdir ./configure \ MAKEFLAGS="-j1 " \ CFLAGS="-pipe " \ MAILER=/usr/bin/mail \ --enable-as-needed \ --quiet \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=$(PREFIX) \ --bindir=$(BINDIR) \ --mandir=$(MANDIR) \ --libexecdir=$(LIBEXECDIR) \ --enable-shared \ --sysconfdir=$(SYSCONFDIR) \ --localstatedir=$(LOCALSTATEDIR) \ --with-amdatadir=$(AMANDAHOMEDIR) \ --with-gnutar-listdir=$(AMANDAHOMEDIR)/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ --with-user=$(AMANDAUSER) \ --with-group=$(AMANDAGROUP) \ --with-fqdn \ --with-bsd-security \ --with-bsdtcp-security \ --with-bsdudp-security \ --with-amandahosts \ --with-smbclient=$(BINDIR)/smbclient \ --with-debugging=$(LOGDIR) \ --with-ssh-security \ --with-assertions \ --enable-s3-device \ --disable-installperms touch missing # Preinst is the same for client and server, but we leave room for # differences by just appending here. cat $(WD)/debian/preinst >> $(WD)/debian/amanda-backup-client.preinst cat $(WD)/debian/preinst >> $(WD)/debian/amanda-backup-server.preinst # Postinst and postrm keep client/server differences to just variables; # the postinst/postrm logic is otherwise the same. cat $(WD)/debian/postinst >> $(WD)/debian/amanda-backup-client.postinst cat $(WD)/debian/postinst >> $(WD)/debian/amanda-backup-server.postinst cat $(WD)/debian/postrm >> $(WD)/debian/amanda-backup-client.postrm cat $(WD)/debian/postrm >> $(WD)/debian/amanda-backup-server.postrm make -s LIBTOOLFLAGS=--silent touch build-stamp clean: dh_testdir >> $(log) 2>&1 dh_testroot >> $(log) 2>&1 -make -s LIBTOOLFLAGS=--silent clean -make -s LIBTOOLFLAGS=--silent distclean -rm -f build-stamp missing config/config.h common-src/genversion -find . -type d -name .deps -exec rm -rf {} \; -test -r /usr/share/misc/config.sub && \ cp -f /usr/share/misc/config.sub config/config.sub -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess config/config.guess dh_clean >> $(log) 2>&1 # Build architecture-dependent files here. binary-arch: build echo "---->dh_testdir: " >> $(log) dh_testdir >> $(log) 2>&1 echo "---->dh_testroot: " >> $(log) dh_testroot >> $(log) 2>&1 echo "---->dh_clean: " >> $(log) dh_clean -k >> $(log) 2>&1 echo "---->dh_installdirs: " >> $(log) dh_installdirs -v >> $(log) 2>&1 make -s LIBTOOLFLAGS=--silent install DESTDIR=$(r) echo "---->dh_installdocs: " >> $(log) dh_installdocs -v >> $(log) 2>&1 install -d $(r)/$(DOCDIR)/amanda-common/examples cp -a example/* $(r)/$(DOCDIR)/amanda-common/examples cp ChangeLog $(r)/$(DOCDIR)/amanda-common/changelog echo "---->dh_installchangelogs: " >> $(log) dh_installchangelogs -v >> $(log) 2>&1 # Here's how we get the perl modules installed into sitelib echo $(PERLSITELIB)/* >> debian/amanda-backup-server.install echo "---->dh_install -v --fail-missing: " >> $(log) dh_install -v --sourcedir=$(r) >> $(log) 2>&1 echo "---->dh_strip: " >> $(log) dh_strip >> $(log) 2>&1 echo "---->dh_compress: " >> $(log) dh_compress >> $(log) 2>&1 echo "---->dh_fixperms: " >> $(log) dh_fixperms -v >> $(log) 2>&1 # fix perms manually chown -R $(AMANDAUSER):$(AMANDAGROUP) debian/*/var/lib/* #chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/* chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(LOGDIR) $(server)/$(LOGDIR) #chmod -R u=rwX,g=rwX,o-rwx $(server)/$(LOGDIR) chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(SYSCONFDIR)/amanda $(server)/$(SYSCONFDIR)/amanda chmod -R u=rwX,g=rwX,o-rwx $(client)/$(SYSCONFDIR)/amanda chmod -R u=rwX,g=rwX,o-rwx $(server)/$(SYSCONFDIR)/amanda chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMANDAHOMEDIR)/gnutar-lists $(server)/$(AMANDAHOMEDIR)/gnutar-lists chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMANDAHOMEDIR)/gnutar-lists $(server)/$(AMANDAHOMEDIR)/gnutar-lists # .. setuid chown root:disk \ $(client)/$(AMLIBEXECDIR)/application/amgtar \ $(client)/$(AMLIBEXECDIR)/application/amstar \ $(client)/$(AMLIBEXECDIR)/killpgrp \ $(client)/$(AMLIBEXECDIR)/rundump \ $(client)/$(AMLIBEXECDIR)/runtar \ $(client)/$(AMLIBEXECDIR)/calcsize \ $(server)/$(AMLIBEXECDIR)/application/amgtar \ $(server)/$(AMLIBEXECDIR)/application/amstar \ $(server)/$(AMLIBEXECDIR)/killpgrp \ $(server)/$(AMLIBEXECDIR)/rundump \ $(server)/$(AMLIBEXECDIR)/runtar \ $(server)/$(AMLIBEXECDIR)/calcsize \ $(server)/$(AMLIBEXECDIR)/dumper \ $(server)/$(AMLIBEXECDIR)/planner \ $(server)/usr/sbin/amcheck \ $(server)/usr/sbin/amservice chmod u=srwx,g=rx,o=r \ $(client)/$(AMLIBEXECDIR)/application/amgtar \ $(client)/$(AMLIBEXECDIR)/application/amstar \ $(client)$(AMLIBEXECDIR)/killpgrp \ $(client)$(AMLIBEXECDIR)/rundump \ $(client)$(AMLIBEXECDIR)/runtar \ $(client)$(AMLIBEXECDIR)/calcsize \ $(server)/$(AMLIBEXECDIR)/application/amgtar \ $(server)/$(AMLIBEXECDIR)/application/amstar \ $(server)$(AMLIBEXECDIR)/killpgrp \ $(server)$(AMLIBEXECDIR)/rundump \ $(server)$(AMLIBEXECDIR)/runtar \ $(server)$(AMLIBEXECDIR)/calcsize \ $(server)$(AMLIBEXECDIR)/dumper \ $(server)$(AMLIBEXECDIR)/planner \ $(server)/usr/sbin/amcheck \ $(server)/usr/sbin/amservice echo "Amanda version $(AMVER)" > $(server)/$(AMANDAHOMEDIR)/amanda-release echo "Amanda version $(AMVER)" > $(client)/$(AMANDAHOMEDIR)/amanda-release install -o root -g root -m 0644 debian/amanda-backup-client.lintian \ $(client)/usr/share/lintian/overrides/amanda-backup-client install -o root -g root -m 0644 debian/amanda-backup-server.lintian \ $(server)/usr/share/lintian/overrides/amanda-backup-server dh_makeshlibs >> $(log) 2>&1 dh_perl >> $(log) 2>&1 dh_shlibdeps -l"$(r)/usr/lib:$(client)/usr/lib:$(server)/usr/lib" >> $(log) 2>&1 dh_installdeb >> $(log) 2>&1 dh_gencontrol >> $(log) 2>&1 dh_md5sums >> $(log) 2>&1 dh_builddeb >> $(log) 2>&1 source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-arch .PHONY: build clean binary-arch binary amanda-3.3.6/packaging/deb/amanda-backup-client.lintian0000664000076400007640000000223312357250001024431 0ustar00martineamartinea00000000000000amanda-backup-client: binary-or-shlib-defines-rpath usr/lib/amanda/* amanda-backup-client: binary-or-shlib-defines-rpath usr/libexec/amanda/* amanda-backup-client: binary-or-shlib-defines-rpath amoldrecover amrecover amanda-backup-client: binary-without-manpage amaespipe amanda-backup-client: binary-without-manpage amcryp* amanda-backup-client: binary-without-manpage amgpgcrypt amanda-backup-client: binary-without-manpage amoldrecover amanda-backup-client: file-in-unusual-dir usr/libexec/amanda/* amanda-backup-client: manpage-has-bad-whatis-entry amanda-backup-client: non-standard-dir-in-usr usr/libexec amanda-backup-client: non-standard-dir-in-var var/log/amanda amanda-backup-client: non-standard-dir-perm var/lib/amanda/gnutar-lists amanda-backup-client: non-standard-dir-perm var/log/amanda amanda-backup-client: package-name-doesnt-match-sonames amanda-backup-client: setuid-binary usr/libexec/amanda/calcsize amanda-backup-client: setuid-binary usr/libexec/amanda/killgrp amanda-backup-client: setuid-binary usr/libexec/amanda/planner amanda-backup-client: setuid-binary usr/libexec/amanda/rundump amanda-backup-client: setuid-binary usr/libexec/amanda/runtar amanda-3.3.6/packaging/deb/preinst.src0000775000076400007640000000224212357250001021311 0ustar00martineamartinea00000000000000#!/bin/sh # This is appended to packaging/deb/amanda-backup-*.preinst # vim: ft=sh LOGFILE=`mktemp /tmp/amanda-preinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to mktemp!" 1>&2 exit 1 fi amanda_user=amandabackup amanda_group=disk AMANDAHOMEDIR=%%AMANDAHOMEDIR%% os=`uname` wanted_shell=/bin/bash dist=%%DISTRO%% LOGDIR=%%LOGDIR%% INSTALL_LOG=${LOGDIR}/install.log SYSCONFDIR=/etc # We require amandabackup to have a specific uid because buildtime uid is # recorded in deb packages. This number should avoid conflict deb_uid=63998 # See packaging/common/ for shell function libraries. # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%PRE_INST_FUNCTIONS%% # -------- End Common functions ---------- logger "Preparing to install: Amanda Server %%VERSION%%" create_user check_user_group "${amanda_group}" || add_group "${amanda_group}" check_user_supplemental_group "tape" || add_group "tape" check_user_shell "${wanted_shell}" check_user_homedir "${AMANDAHOMEDIR}" check_homedir || create_homedir create_logdir logger "Preinstall done." cat $LOGFILE >> $INSTALL_LOG && rm $LOGFILE || \ echo "Amanda preinstall logs can be found in '$LOGFILE'." amanda-3.3.6/packaging/deb/amanda-backup-server.postrm0000664000076400007640000000006312357250001024346 0ustar00martineamartinea00000000000000#!/bin/sh -e pkg_type=server other_pkg_type=client amanda-3.3.6/packaging/deb/amanda-backup-client.dirs0000664000076400007640000000031312357250001023731 0ustar00martineamartinea00000000000000etc/amanda usr/lib/amanda usr/libexec/amanda usr/share/lintian/overrides usr/share/man/man5 usr/share/man/man8 var/amanda var/lib/amanda var/lib/amanda/gnutar-lists var/lib/amanda/example var/log/amanda amanda-3.3.6/packaging/deb/amanda-backup-client.README.Debian0000664000076400007640000000032212357250001025106 0ustar00martineamartinea00000000000000Amanda Forums are located at: http://forums.zmanda.com/ Amanda Documentation is available at: http://wiki.zmanda.com/ amanda-3.3.6/packaging/deb/postinst.src0000664000076400007640000000446312357250001021514 0ustar00martineamartinea00000000000000# This is appended to packaging/deb/amanda-backup-*.postinst # vim: ft=sh # Note: this script needs to do the same things in all maintainer # script cases: configure, abort-remove, abort-upgrade. LOGFILE=`mktemp /tmp/amanda-postinst.log.XXXXXXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create log file!" exit 1 fi amanda_user=amandabackup amanda_group=disk AMANDAHOMEDIR=%%AMANDAHOMEDIR%% os=Linux dist=%%DISTRO%% LOGDIR=%%LOGDIR%% INSTALL_LOG="${LOGDIR}/install.log" SYSCONFDIR=/etc SBINDIR=/usr/sbin AMTMP="/tmp/amanda" AMANDATES=${SYSCONFDIR}/amandates encoder=`{ command -v base64 2>/dev/null; } || { command -v uuencode 2>/dev/null; }` # ---------- Common functions ------------ %%COMMON_FUNCTIONS%% %%POST_INST_FUNCTIONS%% # -------- End Common functions ---------- check_xinetd "amanda${pkg_type}" case $? in 0) backup_xinetd "amanda${pkg_type}" install_xinetd "amanda${pkg_type}" ;; 1) install_xinetd "amanda${pkg_type}" ;; 2) logger "Xinetd config not installed: either xinetd config is not present or xinetd.d is a file." ;; *) logger "bad return from check_xinetd" cat ${LOGFILE} >> ${INSTALL_LOG} exit 1 ;; esac # amanda${pkg_type} should not have the amanda${other_pkg_type} xinetd installed. check_xinetd "amanda${other_pkg_type}" case $? in 0) backup_xinetd "amanda${other_pkg_type}" ;; esac check_superserver_running "xinetd" [ "$?" = "0" ] && action=restart || action=start reload_xinetd $action create_amandates check_amandates create_ampassphrase || \ logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created" create_gnupg create_amkey || \ logger "Info: amcrypt will not work until keys are created." # Checks permissions, but only tries decrypting if both .am_passphrase # and .gnupg/am_key.gpg exist. check_gnupg create_amandahosts check_amandahosts_entry root amindexd amidxtaped check_amandahosts_entry ${amanda_user} amdump check_amandahosts_perms create_ssh_key ${pkg_type} if [ "${pkg_type}" = "server" ]; then create_ssh_key ${other_pkg_type} fi create_profile check_profile install_client_conf create_amtmp logger "Amanda ${pkg_type} installation complete." cat $LOGFILE >> $INSTALL_LOG && { rm $LOGFILE; echo "Amanda installation log can be found in '${INSTALL_LOG}'."; } || \ echo "Amanda installation log can be found in '${LOGFILE}'."; amanda-3.3.6/packaging/deb/buildpkg0000775000076400007640000000470312357250001020644 0ustar00martineamartinea00000000000000#! /bin/bash set -x #### Configure variables. Feel free to change these, but be careful! SRCDIR=$PWD # You can pass your own temp directory as an environment variable. # This prefix is prepended to all directories during "make install" FAKEROOT="${SRCDIR}/froot" # Configure and Compilation directory. BUILDDIR="${SRCDIR}/build" # Config variables to mirror those in RPM .spec file amanda_user=amandabackup amanda_group=admin PREFIX="/usr" EPREFIX="${PREFIX}" BINDIR="${EPREFIX}/bin" SBINDIR="${EPREFIX}/sbin" LIBEXECDIR="${EPREFIX}/lib/amanda" DATADIR="${PREFIX}/share" SYSCONFDIR="/etc" LOCALSTATEDIR="/var" AMANDAHOMEDIR="${LOCALSTATEDIR}/lib/amanda" LIBDIR="${EPREFIX}/lib" INCLUDEDIR="${PREFIX}/include" INFODIR="${PREFIX}/info" MANDIR="${DATADIR}/man" LOGDIR="${LOCALSTATEDIR}/log/amanda" #### CHECKS if [ ! -f common-src/amanda.h ] then echo "'buildpkg' must be run from the root of an otherwise unused amanda source directory." >&2 exit 1 fi if [ ! -f configure ] then echo "The source directory has not been autogen'd -- please download a source distribution tarball or run ./autogen." echo "You will need autoconf, automake, and libtool to run autogen (but not to compile from a distribution tarball)." exit 1 fi # Until we get package revisioning in community. [ -f "PKG_REV" ] || echo "1" > PKG_REV #### Build functions do_substitute() { # We need to edit packaging/deb/changelog to reflect our current distro # and release. This can't be done within the debian packaging system; # dpkg assumes that packages will have the same name on all releases and # that apt will prevent users from downloading the wrong build. We want # this information helpfully obvious since we can't rely on apt. file_list="packaging/deb/changelog \ packaging/deb/postinst \ packaging/deb/postrm \ packaging/deb/preinst" for file in ${file_list}; do /usr/bin/perl packaging/common/substitute.pl \ ${file}.src ${file} || exit 1 done } do_resources() { # Setup directories and files as dpkg-buildpkg expects. if [ -d debian ]; then rm -rf debian fi cp -Rf packaging/deb debian if [ -d $BUILDDIR ]; then rm -rf $BUILDDIR fi mkdir -p $BUILDDIR cp -Rfp * $BUILDDIR } do_package() { echo "Building package" cd $BUILDDIR # Create unsigned packages dpkg-buildpackage -rfakeroot -uc -us } do_substitute do_resources do_package amanda-3.3.6/packaging/deb/amanda-backup-client.postrm0000664000076400007640000000006312357250001024316 0ustar00martineamartinea00000000000000#!/bin/sh -e pkg_type=client other_pkg_type=server amanda-3.3.6/COPYRIGHT0000664000076400007640000000264312357250010015733 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ amanda-3.3.6/amandad-src/0000775000076400007640000000000012357750426016625 5ustar00martineamartinea00000000000000amanda-3.3.6/amandad-src/Makefile.in0000664000076400007640000020404112357750237020673 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda client programs. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) amlibexec_PROGRAMS = amandad$(EXEEXT) subdir = amandad-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" LTLIBRARIES = $(amlib_LTLIBRARIES) libamandad_la_DEPENDENCIES = ../common-src/libamanda.la am_libamandad_la_OBJECTS = amandad_util.lo libamandad_la_OBJECTS = $(am_libamandad_la_OBJECTS) libamandad_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamandad_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(amlibexec_PROGRAMS) amandad_SOURCES = amandad.c amandad_OBJECTS = amandad.$(OBJEXT) amandad_LDADD = $(LDADD) amandad_DEPENDENCIES = ../common-src/libamanda.la libamandad.la \ ../common-src/libamanda.la ../gnulib/libgnu.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamandad_la_SOURCES) amandad.c DIST_SOURCES = $(libamandad_la_SOURCES) amandad.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) amlib_LTLIBRARIES = libamandad.la libamandad_la_SOURCES = amandad_util.c libamandad_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamandad_la_LIBADD = ../common-src/libamanda.la noinst_HEADERS = amandad.h ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ libamandad.la \ ../common-src/libamanda.la \ ../gnulib/libgnu.la all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu amandad-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu amandad-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || 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)$(amlibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \ } uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \ done clean-amlibLTLIBRARIES: -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libamandad.la: $(libamandad_la_OBJECTS) $(libamandad_la_DEPENDENCIES) $(EXTRA_libamandad_la_DEPENDENCIES) $(libamandad_la_LINK) -rpath $(amlibdir) $(libamandad_la_OBJECTS) $(libamandad_la_LIBADD) $(LIBS) install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || 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)$(amlibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files clean-amlibexecPROGRAMS: @list='$(amlibexec_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 amandad$(EXEEXT): $(amandad_OBJECTS) $(amandad_DEPENDENCIES) $(EXTRA_amandad_DEPENDENCIES) @rm -f amandad$(EXEEXT) $(LINK) $(amandad_OBJECTS) $(amandad_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandad_util.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-amlibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-amlibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS .MAKE: all check install install-am install-data-am install-exec-am \ install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-amlibLTLIBRARIES install-amlibexecPROGRAMS \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ 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 uninstall \ uninstall-am uninstall-amlibLTLIBRARIES \ uninstall-amlibexecPROGRAMS installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< lint: @ for p in $(amlibexec_PROGRAMS); do \ p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ done; \ exit 0 # 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: amanda-3.3.6/amandad-src/Makefile.am0000664000076400007640000000315612357250002020647 0ustar00martineamartinea00000000000000# Makefile for Amanda client programs. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) LINT=$(AMLINT) LINTFLAGS=$(AMLINTFLAGS) amlib_LTLIBRARIES = libamandad.la amlibexec_PROGRAMS = amandad libamandad_la_SOURCES= amandad_util.c libamandad_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamandad_la_LIBADD = ../common-src/libamanda.la noinst_HEADERS = amandad.h ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ libamandad.la \ ../common-src/libamanda.la \ ../gnulib/libgnu.la lint: @ for p in $(amlibexec_PROGRAMS); do \ p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ done; \ exit 0 amanda-3.3.6/amandad-src/amandad_util.c0000664000076400007640000001172612357250002021403 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amandad_util.c,v 1.5 2006/07/19 17:46:07 martinea Exp $ * */ #include "amanda.h" #include "amandad.h" #include "util.h" #define MAXMAXDUMPS 16 void init_g_options( g_option_t * g_options) { g_options->str = NULL; g_options->features = NULL; g_options->hostname = NULL; g_options->auth = NULL; g_options->maxdumps = 0; g_options->config = NULL; } g_option_t * parse_g_options( char * str, int verbose) { g_option_t *g_options; char *p, *tok; int new_maxdumps; g_options = alloc(sizeof(g_option_t)); init_g_options(g_options); g_options->str = stralloc(str); p = stralloc(str); tok = strtok(p,";"); while (tok != NULL) { if(strncmp(tok,"features=", 9) == 0) { char *t = tok+9; char *u = strchr(t, ';'); if (u) *u = '\0'; if(g_options->features != NULL) { dbprintf(_("multiple features option\n")); if(verbose) { g_printf(_("ERROR [multiple features option]\n")); } } if((g_options->features = am_string_to_feature(t)) == NULL) { dbprintf(_("bad features value \"%s\"\n"), t); if(verbose) { g_printf(_("ERROR [bad features value \"%s\"]\n"), t); } } if (u) *u = ';'; } else if(strncmp(tok,"hostname=", 9) == 0) { if(g_options->hostname != NULL) { dbprintf(_("multiple hostname option\n")); if(verbose) { g_printf(_("ERROR [multiple hostname option]\n")); } } g_options->hostname = stralloc(tok+9); } else if(strncmp(tok,"auth=", 5) == 0) { if(g_options->auth != NULL) { dbprintf(_("multiple auth option\n")); if(verbose) { g_printf(_("ERROR [multiple auth option]\n")); } } g_options->auth = stralloc(tok+5); } else if(strncmp(tok,"maxdumps=", 9) == 0) { if(g_options->maxdumps != 0) { dbprintf(_("multiple maxdumps option\n")); if(verbose) { g_printf(_("ERROR [multiple maxdumps option]\n")); } } if(sscanf(tok+9, "%d;", &new_maxdumps) == 1) { if (new_maxdumps > MAXMAXDUMPS) { g_options->maxdumps = MAXMAXDUMPS; } else if (new_maxdumps > 0) { g_options->maxdumps = new_maxdumps; } else { dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else { dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else if(strncmp(tok,"config=", 7) == 0) { if(g_options->config != NULL) { dbprintf(_("multiple config option\n")); if(verbose) { g_printf(_("ERROR [multiple config option]\n")); } } g_options->config = stralloc(tok+7); if (strchr(g_options->config, '/')) { amfree(g_options->config); dbprintf(_("invalid character in config option\n")); if(verbose) { g_printf(_("ERROR [invalid character in config option]\n")); } } } else { dbprintf(_("unknown option \"%s\"\n"), tok); if(verbose) { g_printf(_("ERROR [unknown option \"%s\"]\n"), tok); } } tok = strtok(NULL, ";"); } if(g_options->features == NULL) { g_options->features = am_set_default_feature_set(); } if(g_options->maxdumps == 0) /* default */ g_options->maxdumps = 1; amfree(p); return g_options; } void free_g_options( g_option_t * g_options) { if (g_options != NULL) { amfree(g_options->str); am_release_feature_set(g_options->features); amfree(g_options->hostname); amfree(g_options->auth); amfree(g_options->config); amfree(g_options); } } amanda-3.3.6/amandad-src/amandad.c0000664000076400007640000014732312357250002020351 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1999 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amandad.c,v 1.18 2006/08/21 20:17:09 martinea Exp $ * * handle client-host side of Amanda network communications, including * security checks, execution of the proper service, and acking the * master side */ #include "amanda.h" #include "amandad.h" #include "clock.h" #include "event.h" #include "amfeatures.h" #include "packet.h" #include "version.h" #include "security.h" #include "stream.h" #include "util.h" #include "conffile.h" #define REP_TIMEOUT (6*60*60) /* secs for service to reply */ #define ACK_TIMEOUT 10 /* XXX should be configurable */ #define STDERR_PIPE (DATA_FD_COUNT + 1) #define amandad_debug(i, ...) do { \ if ((i) <= debug_amandad) { \ dbprintf(__VA_ARGS__); \ } \ } while (0) /* * These are the actions for entering the state machine */ typedef enum { A_START, A_RECVPKT, A_RECVREP, A_PENDING, A_FINISH, A_CONTINUE, A_SENDNAK, A_TIMEOUT } action_t; /* * This is a state in the state machine. It is a function pointer to * the function that actually implements the state. */ struct active_service; typedef action_t (*state_t)(struct active_service *, action_t, pkt_t *); /* string that we scan for in sendbackup's MESG stream */ static const char info_end_str[] = "sendbackup: info end\n"; #define INFO_END_LEN (sizeof(info_end_str)-1) /* * Here are the services that we allow. * Must be in the same order as services[]. */ typedef enum { SERVICE_NOOP, SERVICE_SENDSIZE, SERVICE_SENDBACKUP, SERVICE_SELFCHECK, SERVICE_AMINDEXD, SERVICE_AMIDXTAPED, SERVICE_AMDUMPD } service_t; static struct services { char *name; int active; service_t service; } services[] = { { "noop", 1, SERVICE_NOOP }, { "sendsize", 1, SERVICE_SENDSIZE }, { "sendbackup", 1, SERVICE_SENDBACKUP }, { "selfcheck", 1, SERVICE_SELFCHECK }, { "amindexd", 0, SERVICE_AMINDEXD }, { "amidxtaped", 0, SERVICE_AMIDXTAPED }, { "amdumpd", 0, SERVICE_AMDUMPD } }; #define NSERVICES (int)(sizeof(services) / sizeof(services[0])) /* * This structure describes an active running service. * * An active service is something running that we have received * a request for. This structure holds info on that service, including * file descriptors for data, etc, as well as the security handle * for communications with the amanda server. */ struct active_service { service_t service; /* service name */ char *cmd; /* name of command we ran */ char *arguments; /* arguments we sent it */ security_handle_t *security_handle; /* remote server */ state_t state; /* how far this has progressed */ pid_t pid; /* pid of subprocess */ int send_partial_reply; /* send PREP packet */ int reqfd; /* pipe to write requests */ int repfd; /* pipe to read replies */ int errfd; /* pipe to read stderr */ event_handle_t *ev_repfd; /* read event handle for repfd */ event_handle_t *ev_reptimeout; /* timeout for rep data */ event_handle_t *ev_errfd; /* read event handle for errfd */ pkt_t rep_pkt; /* rep packet we're sending out */ char *errbuf; /* buffer to read the err into */ char *repbuf; /* buffer to read the rep into */ size_t bufsize; /* length of repbuf */ size_t repbufsize; /* length of repbuf */ int repretry; /* times we'll retry sending the rep */ int seen_info_end; /* have we seen "sendbackup info end\n"? */ char info_end_buf[INFO_END_LEN]; /* last few bytes read, used for scanning for info end */ /* * General user streams to the process, and their equivalent * network streams. */ struct datafd_handle { int fd_read; /* pipe to child process */ int fd_write; /* pipe to child process */ event_handle_t *ev_read; /* it's read event handle */ event_handle_t *ev_write; /* it's write event handle */ security_stream_t *netfd; /* stream to amanda server */ struct active_service *as; /* pointer back to our enclosure */ } data[DATA_FD_COUNT]; char databuf[NETWORK_BLOCK_BYTES]; /* buffer to relay netfd data in */ }; /* * Queue of outstanding requests that we are running. */ GSList *serviceq = NULL; static event_handle_t *exit_event; static int exit_on_qlength = 1; static char *auth = NULL; static kencrypt_type amandad_kencrypt = KENCRYPT_NONE; int main(int argc, char **argv); static int allocstream(struct active_service *, int); static void exit_check(void *); static void protocol_accept(security_handle_t *, pkt_t *); static void state_machine(struct active_service *, action_t, pkt_t *); static action_t s_sendack(struct active_service *, action_t, pkt_t *); static action_t s_repwait(struct active_service *, action_t, pkt_t *); static action_t s_processrep(struct active_service *, action_t, pkt_t *); static action_t s_sendrep(struct active_service *, action_t, pkt_t *); static action_t s_ackwait(struct active_service *, action_t, pkt_t *); static void repfd_recv(void *); static void process_errfd(void *cookie); static void errfd_recv(void *); static void timeout_repfd(void *); static void protocol_recv(void *, pkt_t *, security_status_t); static void process_readnetfd(void *); static void process_writenetfd(void *, void *, ssize_t); static struct active_service *service_new(security_handle_t *, const char *, service_t, const char *); static void service_delete(struct active_service *); static int writebuf(struct active_service *, const void *, size_t); static ssize_t do_sendpkt(security_handle_t *handle, pkt_t *pkt); static char *amandad_get_security_conf (char *, void *); static const char *state2str(state_t); static const char *action2str(action_t); int main( int argc, char ** argv) { int i, j; int have_services; int in, out; const security_driver_t *secdrv; int no_exit = 0; char *pgm = "amandad"; /* in case argv[0] is not set */ #if defined(USE_REUSEADDR) const int on = 1; int r; #endif /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); safe_cd(); /* * Nexenta needs the SUN_PERSONALITY env variable to be unset, otherwise * the Sun version of tar in /usr/sun/sbin/tar is called instead. * * On other operating systems this will have no effect. */ #ifdef HAVE_UNSETENV unsetenv("SUN_PERSONALITY"); #endif /* * When called via inetd, it is not uncommon to forget to put the * argv[0] value on the config line. On some systems (e.g. Solaris) * this causes argv and/or argv[0] to be NULL, so we have to be * careful getting our name. */ if ((argv == NULL) || (argv[0] == NULL)) { pgm = "amandad"; /* in case argv[0] is not set */ } else { pgm = basename(argv[0]); /* Strip of leading path get debug name */ } set_pname(pgm); dbopen(DBG_SUBDIR_AMANDAD); if(argv == NULL) { error(_("argv == NULL\n")); /*NOTREACHED*/ } if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { printf("amandad-%s\n", VERSION); return (0); } /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); /* Parse the configuration; we'll handle errors later */ config_init(CONFIG_INIT_CLIENT, NULL); if (geteuid() == 0) { check_running_as(RUNNING_AS_ROOT); initgroups(CLIENT_LOGIN, get_client_gid()); if(setgid(get_client_gid()) != 0) { error("Can't set gid"); }; if(setegid(get_client_gid()) != 0) { error("Can't set egid"); }; if(seteuid(get_client_uid()) != 0) { error("Can't set euid"); }; } else { check_running_as(RUNNING_AS_CLIENT_LOGIN); } add_amanda_log_handler(amanda_log_stderr); add_amanda_log_handler(amanda_log_syslog); /* * ad-hoc argument parsing * * We accept -auth=[authentication type] * -no-exit * -tcp=[port] * -udp=[port] * We also add a list of services that amandad can launch */ secdrv = NULL; in = 0; out = 1; /* default to stdin/stdout */ have_services = 0; for (i = 1; i < argc; i++) { /* * Get a driver for a security type specified after -auth= */ if (strncmp(argv[i], "-auth=", strlen("-auth=")) == 0) { argv[i] += strlen("-auth="); secdrv = security_getdriver(argv[i]); auth = argv[i]; if (secdrv == NULL) { error(_("no driver for security type '%s'\n"), argv[i]); /*NOTREACHED*/ } if (strcmp(auth, "local") == 0 || strcmp(auth, "rsh") == 0 || strcmp(auth, "ssh") == 0) { int i; for (i=0; i < NSERVICES; i++) { services[i].active = 1; } } continue; } /* * If -no-exit is specified, always run even after requests have * been satisfied. */ else if (strcmp(argv[i], "-no-exit") == 0) { no_exit = 1; continue; } /* * Allow us to directly bind to a udp port for debugging. * This may only apply to some security types. */ else if (strncmp(argv[i], "-udp=", strlen("-udp=")) == 0) { #ifdef WORKING_IPV6 struct sockaddr_in6 sin; #else struct sockaddr_in sin; #endif argv[i] += strlen("-udp="); #ifdef WORKING_IPV6 in = out = socket(AF_INET6, SOCK_DGRAM, 0); #else in = out = socket(AF_INET, SOCK_DGRAM, 0); #endif if (in < 0) { error(_("can't create dgram socket: %s\n"), strerror(errno)); /*NOTREACHED*/ } #ifdef USE_REUSEADDR r = setsockopt(in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, (socklen_t_equiv)sizeof(on)); if (r < 0) { dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"), strerror(errno)); } #endif #ifdef WORKING_IPV6 sin.sin6_family = (sa_family_t)AF_INET6; sin.sin6_addr = in6addr_any; sin.sin6_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #else sin.sin_family = (sa_family_t)AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #endif if (bind(in, (struct sockaddr *)&sin, (socklen_t_equiv)sizeof(sin)) < 0) { error(_("can't bind to port %d: %s\n"), atoi(argv[i]), strerror(errno)); /*NOTREACHED*/ } } /* * Ditto for tcp ports. */ else if (strncmp(argv[i], "-tcp=", strlen("-tcp=")) == 0) { #ifdef WORKING_IPV6 struct sockaddr_in6 sin; #else struct sockaddr_in sin; #endif int sock; socklen_t_equiv n; argv[i] += strlen("-tcp="); #ifdef WORKING_IPV6 sock = socket(AF_INET6, SOCK_STREAM, 0); #else sock = socket(AF_INET, SOCK_STREAM, 0); #endif if (sock < 0) { error(_("can't create tcp socket: %s\n"), strerror(errno)); /*NOTREACHED*/ } #ifdef USE_REUSEADDR r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, (socklen_t_equiv)sizeof(on)); if (r < 0) { dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"), strerror(errno)); } #endif #ifdef WORKING_IPV6 sin.sin6_family = (sa_family_t)AF_INET6; sin.sin6_addr = in6addr_any; sin.sin6_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #else sin.sin_family = (sa_family_t)AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #endif if (bind(sock, (struct sockaddr *)&sin, (socklen_t_equiv)sizeof(sin)) < 0) { error(_("can't bind to port %d: %s\n"), atoi(argv[i]), strerror(errno)); /*NOTREACHED*/ } listen(sock, 10); n = (socklen_t_equiv)sizeof(sin); in = out = accept(sock, (struct sockaddr *)&sin, &n); } /* * It must be a service name */ else { /* clear all services */ if(!have_services) { for (j = 0; j < (int)NSERVICES; j++) services[j].active = 0; } have_services = 1; if(strcmp(argv[i],"amdump") == 0) { services[0].active = 1; services[1].active = 1; services[2].active = 1; services[3].active = 1; } else { for (j = 0; j < (int)NSERVICES; j++) if (strcmp(services[j].name, argv[i]) == 0) break; if (j == (int)NSERVICES) { dbprintf(_("%s: invalid service\n"), argv[i]); exit(1); } services[j].active = 1; } } } /* * If no security type specified, use BSDTCP */ if (secdrv == NULL) { secdrv = security_getdriver("BSDTCP"); auth = "bsdtcp"; if (secdrv == NULL) { error(_("no driver for default security type 'BSDTCP'\n")); /*NOTREACHED*/ } } if(strcasecmp(auth, "rsh") == 0 || strcasecmp(auth, "ssh") == 0 || strcasecmp(auth, "local") == 0 || strcasecmp(auth, "bsdtcp") == 0) { exit_on_qlength = 1; } #ifndef SINGLE_USERID if (geteuid() == 0) { if (strcasecmp(auth, "krb5") != 0) { struct passwd *pwd; /* lookup our local user name */ if ((pwd = getpwnam(CLIENT_LOGIN)) == NULL) { error(_("getpwnam(%s) failed."), CLIENT_LOGIN); } if (pwd->pw_uid != 0) { error(_("'amandad' must be run as user '%s' when using '%s' authentication"), CLIENT_LOGIN, auth); } } } else { if (strcasecmp(auth, "krb5") == 0) { error(_("'amandad' must be run as user 'root' when using 'krb5' authentication")); } } #endif /* initialize */ startclock(); dbprintf(_("version %s\n"), VERSION); for (i = 0; version_info[i] != NULL; i++) { dbprintf(" %s", version_info[i]); } if (! (argc >= 1 && argv != NULL && argv[0] != NULL)) { dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n")); } /* krb5 require the euid to be 0 */ if (strcasecmp(auth, "krb5") == 0) { if(seteuid((uid_t)0) != 0) { error("Can't set euid to 0"); }; } /* * Schedule to call protocol_accept() when new security handles * are created on stdin. */ security_accept(secdrv, amandad_get_security_conf, in, out, protocol_accept, NULL); /* * Schedule an event that will try to exit every 30 seconds if there * are no requests outstanding. */ exit_event = event_register((event_id_t)30, EV_TIME, exit_check, &no_exit); /* * Call event_loop() with an arg of 0, telling it to block until all * events are completed. */ event_loop(0); close(in); close(out); dbclose(); return(0); } /* * This runs periodically and checks to see if we have any active services * still running. If we don't, then we quit. */ static void exit_check( void * cookie) { int no_exit; assert(cookie != NULL); no_exit = *(int *)cookie; /* * If things are still running, then don't exit. */ if (g_slist_length(serviceq) > 0) return; /* * If the caller asked us to never exit, then we're done */ if (no_exit) return; g_debug("timeout exit"); dbclose(); exit(0); } /* * Handles new incoming protocol handles. This is a callback for * security_accept(), which gets called when new handles are detected. */ static void protocol_accept( security_handle_t * handle, pkt_t * pkt) { pkt_t pkt_out; GSList *iter; struct active_service *as; char *pktbody, *tok, *service, *arguments; char *service_path = NULL; GSList *errlist = NULL; int i; char *peer_name; pkt_out.body = NULL; /* * If handle is NULL, then the connection is closed. */ if (handle == NULL) { if (exit_on_qlength && exit_event) { /* remove the timeout, we will exit once the service terminate */ event_release(exit_event); exit_event = NULL; } return; } /* * If we have errors (not warnings) from the config file, let the remote system * know immediately. Unfortunately, we only get one ERROR line, so if there * are multiple errors, we just show the first. */ if (config_errors(&errlist) >= CFGERR_ERRORS) { GSList *iter = errlist; char *errmsg; gboolean multiple_errors = FALSE; if (iter) { errmsg = (char *)iter->data; if (iter->next) multiple_errors = TRUE; } else { errmsg = "(no error message)"; } pkt_init(&pkt_out, P_NAK, "ERROR %s%s", errmsg, multiple_errors? _(" (additional errors not displayed)"):""); do_sendpkt(handle, &pkt_out); amfree(pkt_out.body); security_close(handle); return; } peer_name = security_get_authenticated_peer_name(handle); g_debug("authenticated peer name is '%s'", peer_name); amfree(peer_name); /* * If pkt is NULL, then there was a problem with the new connection. */ if (pkt == NULL) { dbprintf(_("accept error: %s\n"), security_geterror(handle)); pkt_init(&pkt_out, P_NAK, "ERROR %s\n", security_geterror(handle)); do_sendpkt(handle, &pkt_out); amfree(pkt_out.body); security_close(handle); return; } dbprintf(_("accept recv %s pkt:\n<<<<<\n%s>>>>>\n"), pkt_type2str(pkt->type), pkt->body); /* * If this is not a REQ packet, just forget about it. */ if (pkt->type != P_REQ) { dbprintf(_("received unexpected %s packet:\n<<<<<\n%s>>>>>\n\n"), pkt_type2str(pkt->type), pkt->body); security_close(handle); return; } pktbody = service = arguments = NULL; as = NULL; /* * Parse out the service and arguments */ pktbody = stralloc(pkt->body); tok = strtok(pktbody, " "); if (tok == NULL) goto badreq; if (strcmp(tok, "SERVICE") != 0) goto badreq; tok = strtok(NULL, " \n"); if (tok == NULL) goto badreq; service = stralloc(tok); /* we call everything else 'arguments' */ tok = strtok(NULL, ""); if (tok == NULL) goto badreq; arguments = stralloc(tok); /* see if it's one we allow */ for (i = 0; i < (int)NSERVICES; i++) if (services[i].active == 1 && strcmp(services[i].name, service) == 0) break; if (i == (int)NSERVICES) { dbprintf(_("%s: invalid service\n"), service); pkt_init(&pkt_out, P_NAK, _("ERROR %s: invalid service, add '%s' as argument to amandad\n"), service, service); goto send_pkt_out; } service_path = vstralloc(amlibexecdir, "/", service, NULL); if (access(service_path, X_OK) < 0) { dbprintf(_("can't execute %s: %s\n"), service_path, strerror(errno)); pkt_init(&pkt_out, P_NAK, _("ERROR execute access to \"%s\" denied\n"), service_path); goto send_pkt_out; } /* see if its already running */ for (iter = serviceq; iter != NULL; iter = g_slist_next(iter)) { as = (struct active_service *)iter->data; if (strcmp(as->cmd, service_path) == 0 && strcmp(as->arguments, arguments) == 0) { dbprintf(_("%s %s: already running, acking req\n"), service, arguments); pkt_init_empty(&pkt_out, P_ACK); goto send_pkt_out_no_delete; } } /* * create a new service instance, and send the arguments down * the request pipe. */ dbprintf(_("creating new service: %s\n%s\n"), service, arguments); as = service_new(handle, service_path, services[i].service, arguments); if (writebuf(as, arguments, strlen(arguments)) < 0) { const char *errmsg = strerror(errno); dbprintf(_("error sending arguments to %s: %s\n"), service, errmsg); pkt_init(&pkt_out, P_NAK, _("ERROR error writing arguments to %s: %s\n"), service, errmsg); goto send_pkt_out; } aclose(as->reqfd); amfree(pktbody); amfree(service); amfree(service_path); amfree(arguments); /* * Move to the sendack state, and start up the state * machine. */ as->state = s_sendack; state_machine(as, A_START, NULL); return; badreq: pkt_init(&pkt_out, P_NAK, _("ERROR invalid REQ\n")); dbprintf(_("received invalid %s packet:\n<<<<<\n%s>>>>>\n\n"), pkt_type2str(pkt->type), pkt->body); send_pkt_out: if(as) service_delete(as); send_pkt_out_no_delete: amfree(pktbody); amfree(service_path); amfree(service); amfree(arguments); do_sendpkt(handle, &pkt_out); security_close(handle); amfree(pkt_out.body); } /* * Handles incoming protocol packets. Routes responses to the proper * running service. */ static void state_machine( struct active_service * as, action_t action, pkt_t * pkt) { action_t retaction; state_t curstate; pkt_t nak; amandad_debug(1, _("state_machine: %p entering\n"), as); for (;;) { curstate = as->state; amandad_debug(1, _("state_machine: %p curstate=%s action=%s\n"), as, state2str(curstate), action2str(action)); retaction = (*curstate)(as, action, pkt); amandad_debug(1, _("state_machine: %p curstate=%s returned %s (nextstate=%s)\n"), as, state2str(curstate), action2str(retaction), state2str(as->state)); switch (retaction) { /* * State has queued up and is now blocking on input. */ case A_PENDING: amandad_debug(1, _("state_machine: %p leaving (A_PENDING)\n"), as); return; /* * service has switched states. Loop. */ case A_CONTINUE: break; /* * state has determined that the packet it received was bogus. * Send a nak, and return. */ case A_SENDNAK: dbprintf(_("received unexpected %s packet\n"), pkt_type2str(pkt->type)); dbprintf(_("<<<<<\n%s----\n\n"), pkt->body); pkt_init(&nak, P_NAK, _("ERROR unexpected packet type %s\n"), pkt_type2str(pkt->type)); do_sendpkt(as->security_handle, &nak); amfree(nak.body); security_recvpkt(as->security_handle, protocol_recv, as, -1); amandad_debug(1, _("state_machine: %p leaving (A_SENDNAK)\n"), as); return; /* * Service is done. Remove it and finish. */ case A_FINISH: amandad_debug(1, _("state_machine: %p leaving (A_FINISH)\n"), as); service_delete(as); return; default: assert(0); break; } } /*NOTREACHED*/ } /* * This state just sends an ack. After that, we move to the repwait * state to wait for REP data to arrive from the subprocess. */ static action_t s_sendack( struct active_service * as, action_t action, pkt_t * pkt) { pkt_t ack; (void)action; /* Quiet unused parameter warning */ (void)pkt; /* Quiet unused parameter warning */ pkt_init_empty(&ack, P_ACK); if (do_sendpkt(as->security_handle, &ack) < 0) { dbprintf(_("error sending ACK: %s\n"), security_geterror(as->security_handle)); amfree(ack.body); return (A_FINISH); } amfree(ack.body); /* * move to the repwait state * Setup a listener for data on the reply fd, but also * listen for packets over the wire, as the server may * poll us if we take a long time. * Setup a timeout that will fire if it takes too long to * receive rep data. */ as->state = s_repwait; as->ev_repfd = event_register((event_id_t)as->repfd, EV_READFD, repfd_recv, as); as->ev_reptimeout = event_register(REP_TIMEOUT, EV_TIME, timeout_repfd, as); as->errbuf = NULL; as->ev_errfd = event_register((event_id_t)as->errfd, EV_READFD, errfd_recv, as); security_recvpkt(as->security_handle, protocol_recv, as, -1); return (A_PENDING); } /* * This is the repwait state. We have responded to the initial REQ with * an ACK, and we are now waiting for the process we spawned to pass us * data to send in a REP. */ static action_t s_repwait( struct active_service * as, action_t action, pkt_t * pkt) { ssize_t n; char *repbuf_temp; char *what; char *msg; int code = 0; int pid; amwait_t retstat; /* * We normally shouldn't receive any packets while waiting * for our REP data, but in some cases we do. */ if (action == A_RECVPKT) { assert(pkt != NULL); /* * Another req for something that's running. Just send an ACK * and go back and wait for more data. */ if (pkt->type == P_REQ) { dbprintf(_("received dup P_REQ packet, ACKing it\n")); amfree(as->rep_pkt.body); pkt_init_empty(&as->rep_pkt, P_ACK); do_sendpkt(as->security_handle, &as->rep_pkt); security_recvpkt(as->security_handle, protocol_recv, as, -1); return (A_PENDING); } /* something unexpected. Nak it */ return (A_SENDNAK); } if (action == A_TIMEOUT) { amfree(as->rep_pkt.body); pkt_init(&as->rep_pkt, P_NAK, _("ERROR timeout on reply pipe\n")); dbprintf(_("%s timed out waiting for REP data\n"), as->cmd); do_sendpkt(as->security_handle, &as->rep_pkt); return (A_FINISH); } assert(action == A_RECVREP); if(as->bufsize == 0) { as->bufsize = NETWORK_BLOCK_BYTES; as->repbuf = alloc(as->bufsize); } do { n = read(as->repfd, as->repbuf + as->repbufsize, as->bufsize - as->repbufsize - 1); } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) { const char *errstr = strerror(errno); dbprintf(_("read error on reply pipe: %s\n"), errstr); amfree(as->rep_pkt.body); pkt_init(&as->rep_pkt, P_NAK, _("ERROR read error on reply pipe: %s\n"), errstr); do_sendpkt(as->security_handle, &as->rep_pkt); return (A_FINISH); } /* If end of service, wait for process status */ if (n == 0) { pid = waitpid(as->pid, &retstat, WNOHANG); if (as->service == SERVICE_NOOP || as->service == SERVICE_SENDSIZE || as->service == SERVICE_SELFCHECK) { int t = 0; while (t<5 && pid == 0) { sleep(1); t++; pid = waitpid(as->pid, &retstat, WNOHANG); } } process_errfd(as); if (pid == 0) pid = waitpid(as->pid, &retstat, WNOHANG); if (pid > 0) { what = NULL; if (! WIFEXITED(retstat)) { what = _("signal"); code = WTERMSIG(retstat); } else if (WEXITSTATUS(retstat) != 0) { what = _("code"); code = WEXITSTATUS(retstat); } if (what) { dbprintf(_("service %s failed: pid %u exited with %s %d\n"), (as->cmd)?as->cmd:_("??UNKONWN??"), (unsigned)as->pid, what, code); msg = vstrallocf( _("ERROR service %s failed: pid %u exited with %s %d\n"), (as->cmd)?as->cmd:_("??UNKONWN??"), (unsigned)as->pid, what, code); if (as->repbufsize + strlen(msg) >= (as->bufsize - 1)) { as->bufsize *= 2; repbuf_temp = alloc(as->bufsize); memcpy(repbuf_temp, as->repbuf, as->repbufsize + 1); amfree(as->repbuf); as->repbuf = repbuf_temp; } strcpy(as->repbuf + as->repbufsize, msg); as->repbufsize += strlen(msg); amfree(msg); } } } /* * If we got some data, go back and wait for more, or EOF. Nul terminate * the buffer first. */ as->repbuf[n + as->repbufsize] = '\0'; if (n > 0) { as->repbufsize += n; if(as->repbufsize >= (as->bufsize - 1)) { as->bufsize *= 2; repbuf_temp = alloc(as->bufsize); memcpy(repbuf_temp, as->repbuf, as->repbufsize + 1); amfree(as->repbuf); as->repbuf = repbuf_temp; } else if(as->send_partial_reply) { amfree(as->rep_pkt.body); pkt_init(&as->rep_pkt, P_PREP, "%s", as->repbuf); do_sendpkt(as->security_handle, &as->rep_pkt); amfree(as->rep_pkt.body); pkt_init_empty(&as->rep_pkt, P_REP); } return (A_PENDING); } /* * If we got 0, then we hit EOF. Process the data and release * the timeout. */ assert(n == 0); assert(as->ev_repfd != NULL); event_release(as->ev_repfd); as->ev_repfd = NULL; assert(as->ev_reptimeout != NULL); event_release(as->ev_reptimeout); as->ev_reptimeout = NULL; as->state = s_processrep; aclose(as->repfd); return (A_CONTINUE); } /* * After we have read in all of the rep data, we process it and send * it out as a REP packet. */ static action_t s_processrep( struct active_service * as, action_t action, pkt_t * pkt) { char *tok, *repbuf; (void)action; /* Quiet unused parameter warning */ (void)pkt; /* Quiet unused parameter warning */ /* * Copy the rep lines into the outgoing packet. * * If this line is a CONNECT, translate it * Format is "CONNECT etc... * Example: * * CONNECT DATA 4 MESG 5 INDEX 6 * * The tags are arbitrary. The handles are in the DATA_FD pool. * We need to map these to security streams and pass them back * to the amanda server. If the handle is -1, then we don't map. */ if (strncmp_const(as->repbuf,"KENCRYPT\n") == 0) { amandad_kencrypt = KENCRYPT_WILL_DO; repbuf = stralloc(as->repbuf + 9); } else { repbuf = stralloc(as->repbuf); } amfree(as->rep_pkt.body); pkt_init_empty(&as->rep_pkt, P_REP); tok = strtok(repbuf, " "); if (tok == NULL) goto error; if (strcmp(tok, "CONNECT") == 0) { char *line, *nextbuf; /* Save the entire line */ line = strtok(NULL, "\n"); /* Save the buf following the line */ nextbuf = strtok(NULL, ""); if (line == NULL || nextbuf == NULL) goto error; pkt_cat(&as->rep_pkt, "CONNECT"); /* loop over the id/handle pairs */ for (;;) { /* id */ tok = strtok(line, " "); line = NULL; /* keep working from line */ if (tok == NULL) break; pkt_cat(&as->rep_pkt, " %s", tok); /* handle */ tok = strtok(NULL, " \n"); if (tok == NULL) goto error; /* convert the handle into something the server can process */ pkt_cat(&as->rep_pkt, " %d", allocstream(as, atoi(tok))); } pkt_cat(&as->rep_pkt, "\n%s", nextbuf); } else { error: pkt_cat(&as->rep_pkt, "%s", as->repbuf); } /* * We've setup our REP packet in as->rep_pkt. Now move to the transmission * state. */ as->state = s_sendrep; as->repretry = getconf_int(CNF_REP_TRIES); amfree(repbuf); return (A_CONTINUE); } /* * This is the state where we send the REP we just collected from our child. */ static action_t s_sendrep( struct active_service * as, action_t action, pkt_t * pkt) { (void)action; /* Quiet unused parameter warning */ (void)pkt; /* Quiet unused parameter warning */ /* * Transmit it and move to the ack state. */ do_sendpkt(as->security_handle, &as->rep_pkt); security_recvpkt(as->security_handle, protocol_recv, as, ACK_TIMEOUT); as->state = s_ackwait; return (A_PENDING); } /* * This is the state in which we wait for the server to ACK the REP * we just sent it. */ static action_t s_ackwait( struct active_service * as, action_t action, pkt_t * pkt) { struct datafd_handle *dh; int npipes; /* * If we got a timeout, try again, but eventually give up. */ if (action == A_TIMEOUT) { if (--as->repretry > 0) { as->state = s_sendrep; return (A_CONTINUE); } dbprintf(_("timeout waiting for ACK for our REP\n")); return (A_FINISH); } amandad_debug(1, _("received ACK, now opening streams\n")); assert(action == A_RECVPKT); if (pkt->type == P_REQ) { dbprintf(_("received dup P_REQ packet, resending REP\n")); as->state = s_sendrep; return (A_CONTINUE); } if (pkt->type != P_ACK) return (A_SENDNAK); if (amandad_kencrypt == KENCRYPT_WILL_DO) { amandad_kencrypt = KENCRYPT_YES; } /* * Got the ack, now open the pipes */ for (dh = &as->data[0]; dh < &as->data[DATA_FD_COUNT]; dh++) { if (dh->netfd == NULL) continue; dbprintf("opening security stream for fd %d\n", (int)(dh - as->data) + DATA_FD_OFFSET); if (security_stream_accept(dh->netfd) < 0) { dbprintf(_("stream %td accept failed: %s\n"), dh - &as->data[0], security_geterror(as->security_handle)); security_stream_close(dh->netfd); dh->netfd = NULL; continue; } /* setup an event for reads from it. As a special case, don't start * listening on as->data[0] until we read some data on another fd, if * the service is sendbackup. This ensures that we send a MESG or * INDEX token before any DATA tokens, as dumper assumes. This is a * hack, if that wasn't already obvious! */ if (dh != &as->data[0] || as->service != SERVICE_SENDBACKUP) { dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD, process_readnetfd, dh); } else { amandad_debug(1, "Skipping registration of sendbackup's data FD\n"); } security_stream_read(dh->netfd, process_writenetfd, dh); } /* * Pipes are open, so auth them. Count them at the same time. */ for (npipes = 0, dh = &as->data[0]; dh < &as->data[DATA_FD_COUNT]; dh++) { if (dh->netfd == NULL) continue; if (security_stream_auth(dh->netfd) < 0) { security_stream_close(dh->netfd); dh->netfd = NULL; event_release(dh->ev_read); event_release(dh->ev_write); dh->ev_read = NULL; dh->ev_write = NULL; } else { npipes++; } } /* * If no pipes are open, then we're done. Otherwise, just start running. * The event handlers on all of the pipes will take it from here. */ amandad_debug(1, _("at end of s_ackwait, npipes is %d\n"), npipes); if (npipes == 0) return (A_FINISH); else { security_close(as->security_handle); as->security_handle = NULL; return (A_PENDING); } } /* * Called when a repfd has received data */ static void repfd_recv( void * cookie) { struct active_service *as = cookie; assert(as != NULL); assert(as->ev_repfd != NULL); state_machine(as, A_RECVREP, NULL); } static void process_errfd( void *cookie) { struct active_service *as = cookie; /* Process errfd before sending the REP packet */ if (as->ev_errfd) { SELECT_ARG_TYPE readset; struct timeval tv; int nfound; memset(&tv, 0, SIZEOF(tv)); FD_ZERO(&readset); FD_SET(as->errfd, &readset); nfound = select(as->errfd+1, &readset, NULL, NULL, &tv); if (nfound && FD_ISSET(as->errfd, &readset)) { errfd_recv(as); } } } /* * Called when a errfd has received data */ static void errfd_recv( void * cookie) { struct active_service *as = cookie; char buf[32769]; int n; char *r; assert(as != NULL); assert(as->ev_errfd != NULL); n = read(as->errfd, &buf, 32768); /* merge buffer */ if (n > 0) { /* Terminate it with '\0' */ buf[n+1] = '\0'; if (as->errbuf) { as->errbuf = vstrextend(&as->errbuf, buf, NULL); } else { as->errbuf = stralloc(buf); } } else if (n == 0) { event_release(as->ev_errfd); as->ev_errfd = NULL; } else { /* n < 0 */ event_release(as->ev_errfd); as->ev_errfd = NULL; g_snprintf(buf, 32768, "error reading stderr or service: %s\n", strerror(errno)); } /* for each line terminate by '\n' */ while (as->errbuf != NULL && (r = strchr(as->errbuf, '\n')) != NULL) { char *s; *r = '\0'; s = vstrallocf("ERROR service %s: %s\n", services[as->service].name, as->errbuf); /* Add to repbuf, error message will be in the REP packet if it * is not already sent */ n = strlen(s); if (as->bufsize == 0) { as->bufsize = NETWORK_BLOCK_BYTES; as->repbuf = alloc(as->bufsize); } while (as->bufsize < as->repbufsize + n) { char *repbuf_temp; as->bufsize *= 2; repbuf_temp = alloc(as->bufsize); memcpy(repbuf_temp, as->repbuf, as->repbufsize + 1); amfree(as->repbuf); as->repbuf = repbuf_temp; } memcpy(as->repbuf + as->repbufsize, s, n); as->repbufsize += n; dbprintf("%s", s); /* remove first line from buffer */ r++; s = stralloc(r); amfree(as->errbuf); as->errbuf = s; } } /* * Called when a repfd has timed out */ static void timeout_repfd( void * cookie) { struct active_service *as = cookie; assert(as != NULL); assert(as->ev_reptimeout != NULL); state_machine(as, A_TIMEOUT, NULL); } /* * Called when a handle has received data */ static void protocol_recv( void * cookie, pkt_t * pkt, security_status_t status) { struct active_service *as = cookie; assert(as != NULL); switch (status) { case S_OK: dbprintf(_("received %s pkt:\n<<<<<\n%s>>>>>\n"), pkt_type2str(pkt->type), pkt->body); state_machine(as, A_RECVPKT, pkt); break; case S_TIMEOUT: dbprintf(_("timeout\n")); state_machine(as, A_TIMEOUT, NULL); break; case S_ERROR: dbprintf(_("receive error: %s\n"), security_geterror(as->security_handle)); break; } } /* * This is a generic relay function that just reads data from one of * the process's pipes and passes it up the equivalent security_stream_t */ static void process_readnetfd( void * cookie) { pkt_t nak; struct datafd_handle *dh = cookie; struct active_service *as = dh->as; ssize_t n; nak.body = NULL; do { n = read(dh->fd_read, as->databuf, SIZEOF(as->databuf)); } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); /* * Process has died. */ if (n < 0) { pkt_init(&nak, P_NAK, _("A ERROR data descriptor %d broken: %s\n"), dh->fd_read, strerror(errno)); goto sendnak; } /* * Process has closed the pipe. Just remove this event handler. * If all pipes are closed, shut down this service. */ if (n == 0) { event_release(dh->ev_read); dh->ev_read = NULL; if(dh->ev_write == NULL) { security_stream_close(dh->netfd); dh->netfd = NULL; } for (dh = &as->data[0]; dh < &as->data[DATA_FD_COUNT]; dh++) { if (dh->netfd != NULL) return; } service_delete(as); return; } /* Handle the special case of recognizing "sendbackup info end" * from sendbackup's MESG fd */ if (as->service == SERVICE_SENDBACKUP && !as->seen_info_end && dh == &as->data[1]) { /* make a buffer containing the combined data from info_end_buf * and what we've read this time, and search it for info_end_strj * This includes a NULL byte for strstr's sanity. */ char *combined_buf = malloc(INFO_END_LEN + n + 1); memcpy(combined_buf, as->info_end_buf, INFO_END_LEN); memcpy(combined_buf+INFO_END_LEN, as->databuf, n); combined_buf[INFO_END_LEN+n] = '\0'; as->seen_info_end = (strstr(combined_buf, info_end_str) != NULL); /* fill info_end_buf from the tail end of combined_buf */ memcpy(as->info_end_buf, combined_buf + n, INFO_END_LEN); amfree(combined_buf); /* if we did see info_end_str, start reading the data fd (fd 0) */ if (as->seen_info_end) { struct datafd_handle *dh = &as->data[0]; amandad_debug(1, "Opening datafd to sendbackup (delayed until sendbackup sent header info)\n"); dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD, process_readnetfd, dh); } else { amandad_debug(1, "sendbackup header info still not complete\n"); } } if (security_stream_write(dh->netfd, as->databuf, (size_t)n) < 0) { /* stream has croaked */ pkt_init(&nak, P_NAK, _("ERROR write error on stream %d: %s\n"), security_stream_id(dh->netfd), security_stream_geterror(dh->netfd)); goto sendnak; } return; sendnak: do_sendpkt(as->security_handle, &nak); service_delete(as); amfree(nak.body); } /* * This is a generic relay function that just read data from one of * the security_stream_t and passes it up the equivalent process's pipes */ static void process_writenetfd( void * cookie, void * buf, ssize_t size) { struct datafd_handle *dh; assert(cookie != NULL); dh = cookie; if (dh->fd_write <= 0) { dbprintf(_("process_writenetfd: dh->fd_write <= 0\n")); } else if (size > 0) { full_write(dh->fd_write, buf, (size_t)size); } else { aclose(dh->fd_write); } } /* * Convert a local stream handle (DATA_FD...) into something that * can be sent to the amanda server. * * Returns a number that should be sent to the server in the REP packet. */ static int allocstream( struct active_service * as, int handle) { struct datafd_handle *dh; /* note that handle is in the range DATA_FD_OFFSET to DATA_FD_COUNT, but * it is NOT a file descriptor! */ /* if the handle is -1, then we don't bother */ if (handle < 0) return (-1); /* make sure the handle's kosher */ if (handle < DATA_FD_OFFSET || handle >= DATA_FD_OFFSET + DATA_FD_COUNT) return (-1); /* get a pointer into our handle array */ dh = &as->data[handle - DATA_FD_OFFSET]; /* make sure we're not already using the net handle */ if (dh->netfd != NULL) return (-1); /* allocate a stream from the security layer and return */ dh->netfd = security_stream_server(as->security_handle); if (dh->netfd == NULL) { dbprintf(_("couldn't open stream to server: %s\n"), security_geterror(as->security_handle)); return (-1); } /* * convert the stream into a numeric id that can be sent to the * remote end. */ return (security_stream_id(dh->netfd)); } /* * Create a new service instance */ static struct active_service * service_new( security_handle_t * security_handle, const char * cmd, service_t service, const char * arguments) { int i; int data_read[DATA_FD_COUNT + 2][2]; int data_write[DATA_FD_COUNT + 2][2]; struct active_service *as; pid_t pid; int newfd; char *peer_name; char *amanda_remote_host_env[2]; assert(security_handle != NULL); assert(cmd != NULL); assert(arguments != NULL); /* a plethora of pipes */ /* data_read[0] : stdin * data_write[0] : stdout * data_read[1], data_write[1] : first stream * data_read[2], data_write[2] : second stream * data_read[3], data_write[3] : third stream * data_write[4] : stderr */ for (i = 0; i < DATA_FD_COUNT + 1; i++) { if (pipe(data_read[i]) < 0) { error(_("pipe: %s\n"), strerror(errno)); /*NOTREACHED*/ } if (pipe(data_write[i]) < 0) { error(_("pipe: %s\n"), strerror(errno)); /*NOTREACHED*/ } } if (pipe(data_write[STDERR_PIPE]) < 0) { error(_("pipe: %s\n"), strerror(errno)); /*NOTREACHED*/ } switch(pid = fork()) { case -1: error(_("could not fork service %s: %s\n"), cmd, strerror(errno)); /*NOTREACHED*/ default: /* * The parent. Close the far ends of our pipes and return. */ as = g_new0(struct active_service, 1); as->cmd = stralloc(cmd); as->arguments = stralloc(arguments); as->security_handle = security_handle; as->state = NULL; as->service = service; as->pid = pid; as->send_partial_reply = 0; as->seen_info_end = FALSE; /* fill in info_end_buf with non-null characters */ memset(as->info_end_buf, '-', sizeof(as->info_end_buf)); if(service == SERVICE_SENDSIZE) { g_option_t *g_options; char *option_str, *p; option_str = stralloc(as->arguments+8); p = strchr(option_str,'\n'); if(p) *p = '\0'; g_options = parse_g_options(option_str, 1); if(am_has_feature(g_options->features, fe_partial_estimate)) { as->send_partial_reply = 1; } free_g_options(g_options); amfree(option_str); } /* write to the request pipe */ aclose(data_read[0][0]); as->reqfd = data_read[0][1]; /* * read from the reply pipe */ as->repfd = data_write[0][0]; aclose(data_write[0][1]); as->ev_repfd = NULL; as->repbuf = NULL; as->repbufsize = 0; as->bufsize = 0; as->repretry = 0; as->rep_pkt.body = NULL; /* * read from the stderr pipe */ as->errfd = data_write[STDERR_PIPE][0]; aclose(data_write[STDERR_PIPE][1]); as->ev_errfd = NULL; as->errbuf = NULL; /* * read from the rest of the general-use pipes * (netfds are opened as the client requests them) */ for (i = 0; i < DATA_FD_COUNT; i++) { aclose(data_read[i + 1][1]); aclose(data_write[i + 1][0]); as->data[i].fd_read = data_read[i + 1][0]; as->data[i].fd_write = data_write[i + 1][1]; as->data[i].ev_read = NULL; as->data[i].ev_write = NULL; as->data[i].netfd = NULL; as->data[i].as = as; } /* add it to the service queue */ /* increment the active service count */ serviceq = g_slist_append(serviceq, (gpointer)as); return (as); case 0: /* * The child. Put our pipes in their advertised locations * and start up. */ /* set up the AMANDA_AUTHENTICATED_PEER env var so child services * can use it to authenticate */ peer_name = security_get_authenticated_peer_name(security_handle); amanda_remote_host_env[0] = NULL; amanda_remote_host_env[1] = NULL; if (*peer_name) { amanda_remote_host_env[0] = g_strdup_printf("AMANDA_AUTHENTICATED_PEER=%s", peer_name); } /* * The data stream is stdin in the new process */ if (dup2(data_read[0][0], 0) < 0) { error(_("dup %d to %d failed: %s\n"), data_read[0][0], 0, strerror(errno)); /*NOTREACHED*/ } aclose(data_read[0][0]); aclose(data_read[0][1]); /* * The reply stream is stdout */ if (dup2(data_write[0][1], 1) < 0) { error(_("dup %d to %d failed: %s\n"), data_write[0][1], 1, strerror(errno)); } aclose(data_write[0][0]); aclose(data_write[0][1]); for (i = 0; i < DATA_FD_COUNT; i++) { aclose(data_read[i + 1][0]); aclose(data_write[i + 1][1]); } /* * Make sure they are not open in the range DATA_FD_OFFSET to * DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1 */ for (i = 0; i < DATA_FD_COUNT; i++) { while(data_read[i + 1][1] >= DATA_FD_OFFSET && data_read[i + 1][1] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) { newfd = dup(data_read[i + 1][1]); if(newfd == -1) error(_("Can't dup out off DATA_FD range")); data_read[i + 1][1] = newfd; } while(data_write[i + 1][0] >= DATA_FD_OFFSET && data_write[i + 1][0] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) { newfd = dup(data_write[i + 1][0]); if(newfd == -1) error(_("Can't dup out off DATA_FD range")); data_write[i + 1][0] = newfd; } } while(data_write[4][0] >= DATA_FD_OFFSET && data_write[4][0] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) { newfd = dup(data_write[4][0]); if (newfd == -1) error(_("Can't dup out off DATA_FD range")); data_write[4][0] = newfd; } while(data_write[4][1] >= DATA_FD_OFFSET && data_write[4][1] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) { newfd = dup(data_write[4][1]); if (newfd == -1) error(_("Can't dup out off DATA_FD range")); data_write[4][1] = newfd; } for (i = 0; i < DATA_FD_COUNT*2; i++) close(DATA_FD_OFFSET + i); /* * The rest start at the offset defined in amandad.h, and continue * through the internal defined. */ for (i = 0; i < DATA_FD_COUNT; i++) { if (dup2(data_read[i + 1][1], i*2 + DATA_FD_OFFSET) < 0) { error(_("dup %d to %d failed: %s\n"), data_read[i + 1][1], i + DATA_FD_OFFSET, strerror(errno)); } aclose(data_read[i + 1][1]); if (dup2(data_write[i + 1][0], i*2 + 1 + DATA_FD_OFFSET) < 0) { error(_("dup %d to %d failed: %s\n"), data_write[i + 1][0], i + DATA_FD_OFFSET, strerror(errno)); } aclose(data_write[i + 1][0]); } /* close all unneeded fd */ close(STDERR_FILENO); dup2(data_write[STDERR_PIPE][1], 2); aclose(data_write[STDERR_PIPE][0]); aclose(data_write[STDERR_PIPE][1]); safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2); execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env_full(amanda_remote_host_env)); error(_("could not exec service %s: %s\n"), cmd, strerror(errno)); /*NOTREACHED*/ } return NULL; } /* * Unallocate a service instance */ static void service_delete( struct active_service * as) { int i; int count; pid_t pid; struct datafd_handle *dh; amandad_debug(1, _("closing service: %s\n"), (as->cmd)?as->cmd:_("??UNKONWN??")); assert(as != NULL); assert(as->cmd != NULL); amfree(as->cmd); assert(as->arguments != NULL); amfree(as->arguments); if (as->reqfd != -1) aclose(as->reqfd); if (as->repfd != -1) aclose(as->repfd); if (as->errfd != -1) { process_errfd(as); aclose(as->errfd); } if (as->ev_repfd != NULL) event_release(as->ev_repfd); if (as->ev_reptimeout != NULL) event_release(as->ev_reptimeout); if (as->ev_errfd != NULL) event_release(as->ev_errfd); for (i = 0; i < DATA_FD_COUNT; i++) { dh = &as->data[i]; aclose(dh->fd_read); aclose(dh->fd_write); if (dh->netfd != NULL) security_stream_close(dh->netfd); if (dh->ev_read != NULL) event_release(dh->ev_read); if (dh->ev_write != NULL) event_release(dh->ev_write); } if (as->security_handle != NULL) security_close(as->security_handle); /* try to kill the process; if this fails, then it's already dead and * likely some of the other zombie cleanup ate its brains, so we don't * bother to waitpid for it */ assert(as->pid > 0); pid = waitpid(as->pid, NULL, WNOHANG); if (pid == 0 && kill(as->pid, SIGTERM) == 0) { pid = waitpid(as->pid, NULL, WNOHANG); count = 5; while (pid == 0 && count > 0) { count--; sleep(1); pid = waitpid(as->pid, NULL, WNOHANG); } if (pid == 0) { g_debug("Process %d failed to exit", (int)as->pid); } } else { g_debug("Waitpid for process %d failed: %s", (int)as->pid, strerror(errno)); } serviceq = g_slist_remove(serviceq, (gpointer)as); amfree(as->cmd); amfree(as->arguments); amfree(as->repbuf); amfree(as->rep_pkt.body); amfree(as); if(exit_on_qlength == 0 && g_slist_length(serviceq) == 0) { dbclose(); exit(0); } } /* * Like 'fullwrite', but does the work in a child process so pipelines * do not hang. */ static int writebuf( struct active_service * as, const void * bufp, size_t size) { pid_t pid; size_t writesize; switch (pid=fork()) { case -1: break; default: waitpid(pid, NULL, WNOHANG); return 0; /* this is the parent */ case 0: /* this is the child */ close(as->repfd); writesize = full_write(as->reqfd, bufp, size); exit(writesize != size); /* NOTREACHED */ } return -1; } static ssize_t do_sendpkt( security_handle_t * handle, pkt_t * pkt) { dbprintf(_("sending %s pkt:\n<<<<<\n%s>>>>>\n"), pkt_type2str(pkt->type), pkt->body); if (handle) return security_sendpkt(handle, pkt); else return 1; } /* * Convert a state into a string */ static const char * state2str( state_t state) { static const struct { state_t state; const char str[13]; } states[] = { #define X(state) { state, stringize(state) } X(s_sendack), X(s_repwait), X(s_processrep), X(s_sendrep), X(s_ackwait), #undef X }; int i; for (i = 0; i < (int)(sizeof(states) / sizeof(states[0])); i++) if (state == states[i].state) return (states[i].str); return (_("INVALID STATE")); } /* * Convert an action into a string */ static const char * action2str( action_t action) { static const struct { action_t action; const char str[12]; } actions[] = { #define X(action) { action, stringize(action) } X(A_START), X(A_RECVPKT), X(A_RECVREP), X(A_PENDING), X(A_FINISH), X(A_CONTINUE), X(A_SENDNAK), X(A_TIMEOUT), #undef X }; int i; for (i = 0; i < (int)(sizeof(actions) / sizeof(actions[0])); i++) if (action == actions[i].action) return (actions[i].str); return (_("UNKNOWN ACTION")); } static char * amandad_get_security_conf( char * string, void * arg) { (void)arg; /* Quiet unused parameter warning */ if (!string || !*string) return(NULL); if (strcmp(string, "kencrypt")==0) { if (amandad_kencrypt == KENCRYPT_YES) return ("yes"); else return (NULL); } return(NULL); } amanda-3.3.6/amandad-src/amandad.h0000664000076400007640000000365412357250002020354 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amandad.h,v 1.5 2006/07/19 17:46:07 martinea Exp $ * */ #ifndef AMANDAD_UTIL_H #define AMANDAD_UTIL_H #include "amanda.h" #include "amfeatures.h" #include "am_sl.h" #include "util.h" /* for bstrncmp() */ typedef struct g_option_s { char *str; am_feature_t *features; char *hostname; char *auth; int maxdumps; char *config; } g_option_t; void init_g_options(g_option_t *g_options); g_option_t *parse_g_options(char *str, int verbose); void free_g_options(g_option_t *); #endif amanda-3.3.6/oldrecover-src/0000775000076400007640000000000012357750427017405 5ustar00martineamartinea00000000000000amanda-3.3.6/oldrecover-src/help.c0000664000076400007640000000713112357250001020462 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: help.c,v 1.2 2006/05/25 01:47:13 johnfranks Exp $ * * implements the "help" command in amrecover */ #include "amanda.h" #include "amrecover.h" /* print a list of valid commands */ void help_list(void) { g_printf(_("valid commands are:\n\n")); g_printf(_("add path1 ... - add to extraction list (shell wildcards)\n")); g_printf(_("addx path1 ... - add to extraction list (regular expressions)\n")); g_printf(_("cd directory - change cwd on virtual file system (shell wildcards)\n")); g_printf(_("cdx directory - change cwd on virtual file system (regular expressions)\n")); g_printf(_("clear - clear extraction list\n")); g_printf(_("delete path1 ... - delete from extraction list (shell wildcards)\n")); g_printf(_("deletex path1 ... - delete from extraction list (regular expressions)\n")); g_printf(_("extract - extract selected files from tapes\n")); g_printf(_("exit\n")); g_printf(_("help\n")); g_printf(_("history - show dump history of disk\n")); g_printf(_("list [filename] - show extraction list, optionally writing to file\n")); g_printf(_("lcd directory - change cwd on local file system\n")); g_printf(_("ls - list directory on virtual file system\n")); g_printf(_("lpwd - show cwd on local file system\n")); g_printf(_("mode - show the method used to extract SMB shares\n")); g_printf(_("pwd - show cwd on virtual file system\n")); g_printf(_("quit\n")); g_printf(_("listhost - list hosts\n")); g_printf(_("listdisk [diskdevice] - list disks\n")); g_printf(_("setdate {YYYY-MM-DD|--MM-DD|---DD} - set date of look\n")); g_printf(_(" {YYYY-MM-DD-HH-MM-SS} - set date of look\n")); g_printf(_("setdisk diskname [mountpoint] - select disk on dump host\n")); g_printf(_("sethost host - select dump host\n")); g_printf(_("settape [host:][device|default] - select tape server and/or device\n")); g_printf(_("setmode smb|tar - select the method used to extract SMB shares\n")); g_printf(_("\n")); } amanda-3.3.6/oldrecover-src/Makefile.in0000664000076400007640000020065412357750241021453 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda file recovery programs. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/vars.am uparse.c uparse.h \ uscan.c @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) sbin_PROGRAMS = amoldrecover$(EXEEXT) subdir = oldrecover-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am__objects_1 = amrecover.$(OBJEXT) display_commands.$(OBJEXT) \ extract_list.$(OBJEXT) help.$(OBJEXT) set_commands.$(OBJEXT) am_amoldrecover_OBJECTS = $(am__objects_1) uparse.$(OBJEXT) \ uscan.$(OBJEXT) amoldrecover_OBJECTS = $(am_amoldrecover_OBJECTS) amoldrecover_LDADD = $(LDADD) am__DEPENDENCIES_1 = amoldrecover_DEPENDENCIES = ../common-src/libamanda.la \ $(am__DEPENDENCIES_1) ../client-src/libamclient.la \ ../common-src/libamanda.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) YLWRAP = $(top_srcdir)/config/ylwrap YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) SOURCES = $(amoldrecover_SOURCES) DIST_SOURCES = $(amoldrecover_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/client-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ @LEXLIB@ \ $(READLINE_LIBS) \ ../client-src/libamclient.la \ ../common-src/libamanda.la amoldrecover_CSRC = amrecover.c \ display_commands.c extract_list.c \ help.c set_commands.c amoldrecover_SOURCES = $(amoldrecover_CSRC) uparse.y uscan.l noinst_HEADERS = amrecover.h uparse.h AM_YFLAGS = -d all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu oldrecover-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu oldrecover-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-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 uparse.h: uparse.c @if test ! -f $@; then rm -f uparse.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) uparse.c; else :; fi amoldrecover$(EXEEXT): $(amoldrecover_OBJECTS) $(amoldrecover_DEPENDENCIES) $(EXTRA_amoldrecover_DEPENDENCIES) @rm -f amoldrecover$(EXEEXT) $(LINK) $(amoldrecover_OBJECTS) $(amoldrecover_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amrecover.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display_commands.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_commands.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uscan.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -rm -f uparse.c -rm -f uparse.h -rm -f uscan.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: all check install install-am install-data-am install-exec-am \ install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags 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-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-sbinPROGRAMS installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< # so that uscan.c is never generated before uparse.h # otherwise we might have makedepend problems uscan.c: uparse.h # these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS) # since we don't want warnings for generated code uscan.$(OBJEXT): uscan.c $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $< uparse.$(OBJEXT): uparse.c $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $< lint: @ f="$(amoldrecover_CSRC)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ exit 0 # 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: amanda-3.3.6/oldrecover-src/amrecover.c0000664000076400007640000004226012357250001021517 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amrecover.c,v 1.7 2006/07/25 18:27:57 martinea Exp $ * * an interactive program for recovering backed-up files */ #include "amanda.h" #include "stream.h" #include "amfeatures.h" #include "amrecover.h" #include "getfsent.h" #include "dgram.h" #include "util.h" #include "conffile.h" extern int process_line(char *line); int guess_disk(char *cwd, size_t cwd_len, char **dn_guess, char **mpt_guess); int get_line(void); int grab_reply(int show); void sigint_handler(int signum); int main(int argc, char **argv); #define USAGE _("Usage: amoldrecover [[-C] ] [-s ] [-t ] [-d ]\n") char *config = NULL; char *server_name = NULL; int server_socket; char *server_line = NULL; char *dump_datestamp = NULL; /* date we are restoring */ char *dump_hostname; /* which machine we are restoring */ char *disk_name = NULL; /* disk we are restoring */ char *mount_point = NULL; /* where disk was mounted */ char *disk_path = NULL; /* path relative to mount point */ char dump_date[STR_SIZE]; /* date on which we are restoring */ int quit_prog; /* set when time to exit parser */ char *tape_server_name = NULL; int tape_server_socket; char *tape_device_name = NULL; am_feature_t *our_features = NULL; am_feature_t *indexsrv_features = NULL; am_feature_t *tapesrv_features = NULL; /* gets a "line" from server and put in server_line */ /* server_line is terminated with \0, \r\n is striped */ /* returns -1 if error */ int get_line(void) { char *line = NULL; char *part = NULL; size_t len; while(1) { if((part = areads(server_socket)) == NULL) { int save_errno = errno; if(server_line) { fputs(server_line, stderr); /* show the last line read */ fputc('\n', stderr); } if(save_errno != 0) { g_fprintf(stderr, _("%s: Error reading line from server: %s\n"), get_pname(), strerror(save_errno)); } else { g_fprintf(stderr, _("%s: Unexpected end of file, check amindexd*debug on server %s\n"), get_pname(), server_name); } errno = save_errno; break; /* exit while loop */ } if(line) { strappend(line, part); amfree(part); } else { line = part; part = NULL; } if((len = strlen(line)) > 0 && line[len-1] == '\r') { line[len-1] = '\0'; server_line = newstralloc(server_line, line); amfree(line); return 0; } /* * Hmmm. We got a "line" from areads(), which means it saw * a '\n' (or EOF, etc), but there was not a '\r' before it. * Put a '\n' back in the buffer and loop for more. */ strappend(line, "\n"); } amfree(line); amfree(server_line); return -1; } /* get reply from server and print to screen */ /* handle multi-line reply */ /* return -1 if error */ /* return code returned by server always occupies first 3 bytes of global variable server_line */ int grab_reply( int show) { do { if (get_line() == -1) { return -1; } if(show) puts(server_line); } while (server_line[3] == '-'); if(show) fflush(stdout); return 0; } /* get 1 line of reply */ /* returns -1 if error, 0 if last (or only) line, 1 if more to follow */ int get_reply_line(void) { if (get_line() == -1) return -1; return server_line[3] == '-'; } /* returns pointer to returned line */ char * reply_line(void) { return server_line; } /* returns 0 if server returned an error code (ie code starting with 5) and non-zero otherwise */ int server_happy(void) { return server_line[0] != '5'; } int send_command( char * cmd) { /* * NOTE: this routine is called from sigint_handler, so we must be * **very** careful about what we do since there is no way to know * our state at the time the interrupt happened. For instance, * do not use any stdio or malloc routines here. */ struct iovec msg[2]; ssize_t bytes; memset(msg, 0, sizeof(msg)); msg[0].iov_base = cmd; msg[0].iov_len = strlen(msg[0].iov_base); msg[1].iov_base = "\r\n"; msg[1].iov_len = strlen(msg[1].iov_base); bytes = (ssize_t)(msg[0].iov_len + msg[1].iov_len); if (writev(server_socket, msg, 2) < bytes) { return -1; } return (0); } /* send a command to the server, get reply and print to screen */ int converse( char * cmd) { if (send_command(cmd) == -1) return -1; if (grab_reply(1) == -1) return -1; return 0; } /* same as converse() but reply not echoed to stdout */ int exchange( char * cmd) { if (send_command(cmd) == -1) return -1; if (grab_reply(0) == -1) return -1; return 0; } /* basic interrupt handler for when user presses ^C */ /* Bale out, letting server know before doing so */ void sigint_handler( int signum) { /* * NOTE: we must be **very** careful about what we do here since there * is no way to know our state at the time the interrupt happened. * For instance, do not use any stdio routines here or in any called * routines. Also, use _exit() instead of exit() to make sure stdio * buffer flushing is not attempted. */ (void)signum; /* Quiet unused parameter warning */ if (extract_restore_child_pid != -1) (void)kill(extract_restore_child_pid, SIGKILL); extract_restore_child_pid = -1; (void)send_command("QUIT"); _exit(1); } void clean_pathname( char * s) { size_t length; length = strlen(s); /* remove "/" at end of path */ if(length>1 && s[length-1]=='/') s[length-1]='\0'; /* change "/." to "/" */ if(strcmp(s,"/.")==0) s[1]='\0'; /* remove "/." at end of path */ if(strcmp(&(s[length-2]),"/.")==0) s[length-2]='\0'; } /* try and guess the disk the user is currently on. Return -1 if error, 0 if disk not local, 1 if disk local, 2 if disk local but can't guess name */ /* do this by looking for the longest mount point which matches the current directory */ int guess_disk ( char * cwd, size_t cwd_len, char ** dn_guess, char ** mpt_guess) { size_t longest_match = 0; size_t current_length; size_t cwd_length; int local_disk = 0; generic_fsent_t fsent; char *fsname = NULL; char *disk_try = NULL; *dn_guess = NULL; *mpt_guess = NULL; if (getcwd(cwd, cwd_len) == NULL) { return -1; /*NOTREACHED*/ } cwd_length = strlen(cwd); dbprintf(_("guess_disk: %zu: \"%s\"\n"), cwd_length, cwd); if (open_fstab() == 0) { return -1; /*NOTREACHED*/ } while (get_fstab_nextentry(&fsent)) { current_length = fsent.mntdir ? strlen(fsent.mntdir) : (size_t)0; dbprintf(_("guess_disk: %zu: %zu: \"%s\": \"%s\"\n"), longest_match, current_length, fsent.mntdir ? fsent.mntdir : _("(mntdir null)"), fsent.fsname ? fsent.fsname : _("(fsname null)")); if ((current_length > longest_match) && (current_length <= cwd_length) && (strncmp(fsent.mntdir, cwd, current_length) == 0)) { longest_match = current_length; *mpt_guess = newstralloc(*mpt_guess, fsent.mntdir); if(strncmp(fsent.fsname,DEV_PREFIX,(strlen(DEV_PREFIX)))) { fsname = newstralloc(fsname, fsent.fsname); } else { fsname = newstralloc(fsname,fsent.fsname+strlen(DEV_PREFIX)); } local_disk = is_local_fstype(&fsent); dbprintf(_("guess_disk: local_disk = %d, fsname = \"%s\"\n"), local_disk, fsname); } } close_fstab(); if (longest_match == 0) { amfree(*mpt_guess); amfree(fsname); return -1; /* ? at least / should match */ } if (!local_disk) { amfree(*mpt_guess); amfree(fsname); return 0; } /* have mount point now */ /* disk name may be specified by mount point (logical name) or device name, have to determine */ g_printf(_("Trying disk %s ...\n"), *mpt_guess); disk_try = stralloc2("DISK ", *mpt_guess); /* try logical name */ if (exchange(disk_try) == -1) exit(1); amfree(disk_try); if (server_happy()) { *dn_guess = stralloc(*mpt_guess); /* logical is okay */ amfree(fsname); return 1; } g_printf(_("Trying disk %s ...\n"), fsname); disk_try = stralloc2("DISK ", fsname); /* try device name */ if (exchange(disk_try) == -1) exit(1); amfree(disk_try); if (server_happy()) { *dn_guess = stralloc(fsname); /* dev name is okay */ amfree(fsname); return 1; } /* neither is okay */ amfree(*mpt_guess); amfree(fsname); return 2; } void quit(void) { quit_prog = 1; (void)converse("QUIT"); } char *localhost = NULL; #ifdef DEFAULT_TAPE_SERVER # define DEFAULT_TAPE_SERVER_FAILOVER (DEFAULT_TAPE_SERVER) #else # define DEFAULT_TAPE_SERVER_FAILOVER (NULL) #endif int main( int argc, char ** argv) { in_port_t my_port; struct servent *sp; int i; time_t timer; char *lineread = NULL; struct sigaction act, oact; extern char *optarg; extern int optind; char cwd[STR_SIZE], *dn_guess = NULL, *mpt_guess = NULL; char *service_name; char *line = NULL; struct tm *tm; /* * Configure program for internationalization: * 1) Only set the message locale for now. * 2) Set textdomain for all amanda related programs to "amanda" * We don't want to be forced to support dozens of message catalogs. */ setlocale(LC_MESSAGES, "C"); textdomain("amanda"); safe_fd(-1, 0); set_pname("amoldrecover"); /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); dbopen(DBG_SUBDIR_CLIENT); localhost = alloc(MAX_HOSTNAME_LENGTH+1); if (gethostname(localhost, MAX_HOSTNAME_LENGTH) != 0) { error(_("cannot determine local host name\n")); /*NOTREACHED*/ } localhost[MAX_HOSTNAME_LENGTH] = '\0'; config = newstralloc(config, DEFAULT_CONFIG); check_running_as(RUNNING_AS_ROOT); amfree(server_name); server_name = getenv("AMANDA_SERVER"); if(!server_name) server_name = DEFAULT_SERVER; server_name = stralloc(server_name); amfree(tape_server_name); tape_server_name = getenv("AMANDA_TAPESERVER"); if(!tape_server_name) tape_server_name = DEFAULT_TAPE_SERVER; tape_server_name = stralloc(tape_server_name); config_init(CONFIG_INIT_CLIENT, NULL); if (config_errors(NULL) >= CFGERR_WARNINGS) { config_print_errors(); if (config_errors(NULL) >= CFGERR_ERRORS) { g_critical(_("errors processing config file")); } } if (argc > 1 && argv[1][0] != '-') { /* * If the first argument is not an option flag, then we assume * it is a configuration name to match the syntax of the other * Amanda utilities. */ char **new_argv; new_argv = (char **) alloc((size_t)((argc + 1 + 1) * sizeof(*new_argv))); new_argv[0] = argv[0]; new_argv[1] = "-C"; for (i = 1; i < argc; i++) { new_argv[i + 1] = argv[i]; } new_argv[i + 1] = NULL; argc++; argv = new_argv; } while ((i = getopt(argc, argv, "C:s:t:d:U")) != EOF) { switch (i) { case 'C': config = newstralloc(config, optarg); break; case 's': server_name = newstralloc(server_name, optarg); break; case 't': tape_server_name = newstralloc(tape_server_name, optarg); break; case 'd': tape_device_name = newstralloc(tape_device_name, optarg); break; case 'U': case '?': (void)g_printf(USAGE); return 0; } } if (optind != argc) { (void)g_fprintf(stderr, USAGE); exit(1); } dbrename(config, DBG_SUBDIR_CLIENT); amfree(disk_name); amfree(mount_point); amfree(disk_path); dump_date[0] = '\0'; /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); /* set up signal handler */ act.sa_handler = sigint_handler; sigemptyset(&act.sa_mask); act.sa_flags = 0; #ifdef SA_RESTORER act.sa_restorer = NULL; #endif if (sigaction(SIGINT, &act, &oact) != 0) { error(_("error setting signal handler: %s"), strerror(errno)); /*NOTREACHED*/ } service_name = stralloc2("amandaidx", SERVICE_SUFFIX); g_printf(_("AMRECOVER Version %s. Contacting server on %s ...\n"), VERSION, server_name); if ((sp = getservbyname(service_name, "tcp")) == NULL) { error(_("%s/tcp unknown protocol"), service_name); /*NOTREACHED*/ } amfree(service_name); server_socket = stream_client_privileged(server_name, (in_port_t)ntohs((in_port_t)sp->s_port), 0, 0, &my_port, 0); if (server_socket < 0) { error(_("cannot connect to %s: %s"), server_name, strerror(errno)); /*NOTREACHED*/ } if (my_port >= IPPORT_RESERVED) { aclose(server_socket); error(_("did not get a reserved port: %d"), my_port); /*NOTREACHED*/ } /* get server's banner */ if (grab_reply(1) == -1) { aclose(server_socket); exit(1); } if (!server_happy()) { dbclose(); aclose(server_socket); exit(1); } /* do the security thing */ line = get_security(); if (converse(line) == -1) { aclose(server_socket); exit(1); } if (!server_happy()) { aclose(server_socket); exit(1); } memset(line, '\0', strlen(line)); amfree(line); /* try to get the features from the server */ { char *our_feature_string = NULL; char *their_feature_string = NULL; our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); line = stralloc2("FEATURES ", our_feature_string); if(exchange(line) == 0) { their_feature_string = stralloc(server_line+13); indexsrv_features = am_string_to_feature(their_feature_string); } else { indexsrv_features = am_set_default_feature_set(); } amfree(our_feature_string); amfree(their_feature_string); amfree(line); } /* set the date of extraction to be today */ (void)time(&timer); tm = localtime(&timer); if (tm) strftime(dump_date, sizeof(dump_date), "%Y-%m-%d", tm); else error(_("BAD DATE")); g_printf(_("Setting restore date to today (%s)\n"), dump_date); line = stralloc2("DATE ", dump_date); if (converse(line) == -1) { aclose(server_socket); exit(1); } amfree(line); line = stralloc2("SCNF ", config); if (converse(line) == -1) { aclose(server_socket); exit(1); } amfree(line); if (server_happy()) { /* set host we are restoring to this host by default */ amfree(dump_hostname); set_host(localhost); if (dump_hostname) { /* get a starting disk and directory based on where we currently are */ switch (guess_disk(cwd, sizeof(cwd), &dn_guess, &mpt_guess)) { case 1: /* okay, got a guess. Set disk accordingly */ g_printf(_("$CWD '%s' is on disk '%s' mounted at '%s'.\n"), cwd, dn_guess, mpt_guess); set_disk(dn_guess, mpt_guess); set_directory(cwd); if (server_happy() && strcmp(cwd, mpt_guess) != 0) g_printf(_("WARNING: not on root of selected filesystem, check man-page!\n")); amfree(dn_guess); amfree(mpt_guess); break; case 0: g_printf(_("$CWD '%s' is on a network mounted disk\n"), cwd); g_printf(_("so you must 'sethost' to the server\n")); /* fake an unhappy server */ server_line[0] = '5'; break; case 2: case -1: default: g_printf(_("Use the setdisk command to choose dump disk to recover\n")); /* fake an unhappy server */ server_line[0] = '5'; break; } } } quit_prog = 0; do { if ((lineread = readline("amrecover> ")) == NULL) { clearerr(stdin); putchar('\n'); break; } if (lineread[0] != '\0') { add_history(lineread); process_line(lineread); /* act on line's content */ } amfree(lineread); } while (!quit_prog); dbclose(); aclose(server_socket); return 0; } char * get_security(void) { struct passwd *pwptr; if((pwptr = getpwuid(getuid())) == NULL) { error(_("can't get login name for my uid %ld"), (long)getuid()); /*NOTREACHED*/ } return stralloc2("SECURITY USER ", pwptr->pw_name); } amanda-3.3.6/oldrecover-src/Makefile.am0000664000076400007640000000375512357250001021432 0ustar00martineamartinea00000000000000# Makefile for Amanda file recovery programs. include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/client-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) LINT=$(AMLINT) LINTFLAGS=$(AMLINTFLAGS) sbin_PROGRAMS = amoldrecover ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ @LEXLIB@ \ $(READLINE_LIBS) \ ../client-src/libamclient.la \ ../common-src/libamanda.la amoldrecover_CSRC = amrecover.c \ display_commands.c extract_list.c \ help.c set_commands.c amoldrecover_SOURCES = $(amoldrecover_CSRC) uparse.y uscan.l noinst_HEADERS = amrecover.h uparse.h AM_YFLAGS = -d # so that uscan.c is never generated before uparse.h # otherwise we might have makedepend problems uscan.c: uparse.h # these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS) # since we don't want warnings for generated code uscan.$(OBJEXT): uscan.c $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $< uparse.$(OBJEXT): uparse.c $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $< lint: @ f="$(amoldrecover_CSRC)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ exit 0 amanda-3.3.6/oldrecover-src/set_commands.c0000664000076400007640000003451412357250001022213 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: set_commands.c,v 1.3 2006/07/05 13:14:58 martinea Exp $ * * implements the "set" commands in amrecover */ #include "amanda.h" #include "match.h" #include "util.h" #include "amrecover.h" #ifdef SAMBA_CLIENT extern unsigned short samba_extract_method; #endif /* SAMBA_CLIENT */ /* sets a date, mapping given date into standard form if needed */ int set_date( char * date) { char *cmd = NULL; clear_dir_list(); cmd = stralloc2("DATE ", date); if (converse(cmd) == -1) exit(1); /* if a host/disk/directory is set, then check if that directory is still valid at the new date, and if not set directory to mount_point */ if (disk_path != NULL) { cmd = newstralloc2(cmd, "OISD ", disk_path); if (exchange(cmd) == -1) exit(1); if (server_happy()) { suck_dir_list_from_server(); } else { g_printf(_("No index records for cwd on new date\n")); g_printf(_("Setting cwd to mount point\n")); disk_path = newstralloc(disk_path, "/"); /* fake it */ clear_dir_list(); } } amfree(cmd); return 0; } void set_host( const char * host) { char *cmd = NULL; struct hostent *hp; char **hostp; int found_host = 0; char *uqhost = unquote_string(host); if (is_extract_list_nonempty()) { g_printf(_("Must clear extract list before changing host\n")); return; } cmd = stralloc2("HOST ", uqhost); if (converse(cmd) == -1) exit(1); if (server_happy()) { found_host = 1; } else { /* * Try converting the given host to a fully qualified name * and then try each of the aliases. */ if ((hp = gethostbyname(uqhost)) != NULL) { host = hp->h_name; g_printf(_("Trying host %s ...\n"), host); cmd = newstralloc2(cmd, "HOST ", host); if (converse(cmd) == -1) exit(1); if(server_happy()) { found_host = 1; } else { for (hostp = hp->h_aliases; (host = *hostp) != NULL; hostp++) { g_printf(_("Trying host %s ...\n"), host); cmd = newstralloc2(cmd, "HOST ", host); if (converse(cmd) == -1) exit(1); if(server_happy()) { found_host = 1; break; } } } } } if(found_host) { dump_hostname = newstralloc(dump_hostname, host); amfree(disk_name); amfree(mount_point); amfree(disk_path); clear_dir_list(); } amfree(cmd); amfree(uqhost); } void list_host(void) { char *cmd = NULL; cmd = stralloc("LISTHOST"); if (converse(cmd) == -1) exit(1); amfree(cmd); } void set_disk( char * dsk, char * mtpt) { char *cmd = NULL; char *uqdsk; char *uqmtpt = NULL; if (is_extract_list_nonempty()) { g_printf(_("Must clear extract list before changing disk\n")); return; } /* if mount point specified, check it is valid */ if (mtpt != NULL) { uqmtpt = unquote_string(mtpt); if (*mtpt != '/') { g_printf(_("Mount point \"%s\" invalid - must start with /\n"), uqmtpt); amfree(uqmtpt); return; } } clear_dir_list(); uqdsk = unquote_string(dsk); cmd = stralloc2("DISK ", uqdsk); if (converse(cmd) == -1) exit(1); amfree(cmd); if (!server_happy()) return; disk_name = newstralloc(disk_name, uqdsk); if (mtpt == NULL) { /* mount point not specified */ if (*uqdsk == '/') { /* disk specified by mount point, hence use it */ mount_point = newstralloc(mount_point, uqdsk); } else { /* device name given, use '/' because nothing better */ mount_point = newstralloc(mount_point, "/"); } } else { /* mount point specified */ mount_point = newstralloc(mount_point, uqmtpt); } /* set the working directory to the mount point */ /* there is the possibility that there are no index records for the disk for the given date, hence setting the directory to the mount point will fail. Preempt this by checking first so we can write a more informative message. */ if (exchange("OISD /") == -1) exit(1); if (server_happy()) { disk_path = newstralloc(disk_path, "/"); suck_dir_list_from_server(); /* get list of directory contents */ } else { g_printf(_("No index records for disk for specified date\n")); g_printf(_("If date correct, notify system administrator\n")); disk_path = newstralloc(disk_path, "/"); /* fake it */ clear_dir_list(); } amfree(uqmtpt); amfree(uqdsk); } void list_disk( char * amdevice) { char *cmd = NULL; char *uqamdevice; if(amdevice) { uqamdevice = unquote_string(amdevice); cmd = stralloc2("LISTDISK ", uqamdevice); amfree(uqamdevice); if (converse(cmd) == -1) exit(1); amfree(cmd); } else { cmd = stralloc("LISTDISK"); if (converse(cmd) == -1) exit(1); amfree(cmd); } } void local_cd( char *dir) { char *uqdir = unquote_string(dir); if (chdir(uqdir) == -1) { perror(uqdir); } amfree(uqdir); } void cd_glob( char * glob) { char *regex; char *regex_path; char *s; char *uqglob; char *path_on_disk = NULL; if (disk_name == NULL) { g_printf(_("Must select disk before changing directory\n")); return; } uqglob = unquote_string(glob); regex = glob_to_regex(uqglob); dbprintf(_("cd_glob (%s) -> %s\n"), uqglob, regex); if ((s = validate_regexp(regex)) != NULL) { g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob); puts(s); amfree(regex); return; } /* * glob_to_regex() anchors the beginning of the pattern with ^, * but we will be tacking it onto the end of the current directory * in add_file, so strip that off. Also, it anchors the end with * $, but we need to match a trailing /, add it if it is not there */ regex_path = stralloc(regex + 1); amfree(regex); if(regex_path[strlen(regex_path) - 2] != '/' ) { regex_path[strlen(regex_path) - 1] = '\0'; strappend(regex_path, "/$"); } /* convert path (assumed in cwd) to one on disk */ if (strcmp(disk_path, "/") == 0) path_on_disk = stralloc2("/", regex_path); else { char *clean_disk_path = clean_regex(disk_path, 0); path_on_disk = vstralloc(clean_disk_path, "/", regex_path, NULL); amfree(clean_disk_path); } cd_dir(path_on_disk, uqglob); amfree(regex_path); amfree(path_on_disk); amfree(uqglob); } void cd_regex( char * regex) { char *s; char *uqregex; char *path_on_disk = NULL; if (disk_name == NULL) { g_printf(_("Must select disk before changing directory\n")); return; } uqregex = unquote_string(regex); if ((s = validate_regexp(uqregex)) != NULL) { g_printf(_("\"%s\" is not a valid regular expression: "), uqregex); amfree(uqregex); puts(s); return; } /* convert path (assumed in cwd) to one on disk */ if (strcmp(disk_path, "/") == 0) path_on_disk = stralloc2("/", regex); else { char *clean_disk_path = clean_regex(disk_path, 0); path_on_disk = vstralloc(clean_disk_path, "/", regex, NULL); amfree(clean_disk_path); } cd_dir(path_on_disk, uqregex); amfree(path_on_disk); amfree(uqregex); } void cd_dir( char * path_on_disk, char * default_dir) { char *path_on_disk_slash = NULL; char *dir = NULL; int nb_found; size_t i; DIR_ITEM *ditem; path_on_disk_slash = stralloc2(path_on_disk, "/"); nb_found = 0; for (ditem=get_dir_list(); ditem!=NULL && nb_found <= 1; ditem=get_next_dir_item(ditem)) { if (match(path_on_disk, ditem->path) || match(path_on_disk_slash, ditem->path)) { i = strlen(ditem->path); if((i > 0 && ditem->path[i-1] == '/') || (i > 1 && ditem->path[i-2] == '/' && ditem->path[i-1] == '.')) { /* It is a directory */ char *dir1, *dir2; nb_found++; dir = newstralloc(dir,ditem->path); if(dir[strlen(dir)-1] == '/') dir[strlen(dir)-1] = '\0'; /* remove last / */ /* remove everything before the last / */ dir1 = strrchr(dir,'/'); if (dir1) { dir1++; dir2 = stralloc(dir1); amfree(dir); dir = dir2; } } } } amfree(path_on_disk_slash); if(nb_found==0) { set_directory(default_dir); } else if(nb_found==1) { set_directory(dir); } else { g_printf(_("Too many directory\n")); } amfree(dir); } void set_directory( char * dir) { char *cmd = NULL; char *new_dir = NULL; char *dp, *de; char *ldir = NULL; /* do nothing if "." */ if(strcmp(dir,".")==0) { show_directory(); /* say where we are */ return; /*NOTREACHED*/ } if (disk_name == NULL) { g_printf(_("Must select disk before setting directory\n")); return; /*NOTREACHED*/ } ldir = stralloc(dir); clean_pathname(ldir); /* convert directory into absolute path relative to disk mount point */ if (ldir[0] == '/') { /* absolute path specified, must start with mount point */ if (strcmp(mount_point, "/") == 0) { new_dir = stralloc(ldir); } else { if (strncmp(mount_point, ldir, strlen(mount_point)) != 0) { g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"), mount_point); amfree(ldir); return; /*NOTREACHED*/ } new_dir = stralloc(ldir+strlen(mount_point)); if (strlen(new_dir) == 0) { new_dir = newstralloc(new_dir, "/"); /* i.e. ldir == mount_point */ } } } else { new_dir = stralloc(disk_path); dp = ldir; /* strip any leading ..s */ while (strncmp(dp, "../", 3) == 0) { de = strrchr(new_dir, '/'); /* always at least 1 */ if (de == new_dir) { /* at top of disk */ *(de + 1) = '\0'; dp = dp + 3; } else { *de = '\0'; dp = dp + 3; } } if (strcmp(dp, "..") == 0) { if (strcmp(new_dir, "/") == 0) { /* at top of disk */ g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"), mount_point); /*@ignore@*/ amfree(new_dir); /*@end@*/ amfree(ldir); return; /*NOTREACHED*/ } de = strrchr(new_dir, '/'); /* always at least 1 */ if (de == new_dir) { /* at top of disk */ *(de+1) = '\0'; } else { *de = '\0'; } } else { /*@ignore@*/ if (strcmp(new_dir, "/") != 0) { strappend(new_dir, "/"); } strappend(new_dir, ldir); /*@end@*/ } } cmd = stralloc2("OISD ", new_dir); if (exchange(cmd) == -1) { exit(1); /*NOTREACHED*/ } amfree(cmd); if (server_happy()) { disk_path = newstralloc(disk_path, new_dir); suck_dir_list_from_server(); /* get list of directory contents */ show_directory(); /* say where we moved to */ } else { g_printf(_("Invalid directory - %s\n"), dir); } /*@ignore@*/ amfree(new_dir); amfree(ldir); /*@end@*/ } /* prints the current working directory */ void show_directory(void) { if (mount_point == NULL || disk_path == NULL) g_printf(_("Must select disk first\n")); else if (strcmp(mount_point, "/") == 0) g_printf("%s\n", disk_path); else if (strcmp(disk_path, "/") == 0) g_printf("%s\n", mount_point); else g_printf("%s%s\n", mount_point, disk_path); } /* set the tape server and device */ void set_tape( char * tape) { char *uqtape = unquote_string(tape); char *tapedev = strchr(uqtape, ':'); if (tapedev) { if (tapedev != uqtape) { if((strchr(tapedev+1, ':') == NULL) && (strncmp(uqtape, "null:", 5) == 0 || strncmp(uqtape, "rait:", 5) == 0 || strncmp(uqtape, "file:", 5) == 0 || strncmp(uqtape, "tape:", 5) == 0)) { tapedev = uqtape; } else { *tapedev = '\0'; tape_server_name = newstralloc(tape_server_name, uqtape); ++tapedev; } } else { /* reset server_name if start with : */ amfree(tape_server_name); ++tapedev; } } else tapedev = uqtape; if (tapedev[0]) { if (strcmp(tapedev, "default") == 0) amfree(tape_device_name); else tape_device_name = newstralloc(tape_device_name, tapedev); } if (tape_device_name) g_printf (_("Using tape \"%s\""), tape_device_name); else g_printf (_("Using default tape")); if (tape_server_name) g_printf (_(" from server %s.\n"), tape_server_name); else g_printf (_(".\nTape server unspecified, assumed to be %s.\n"), server_name); } void set_mode( int mode) { #ifdef SAMBA_CLIENT if (mode == SAMBA_SMBCLIENT) { g_printf (_("SAMBA dumps will be extracted using smbclient\n")); samba_extract_method = SAMBA_SMBCLIENT; } else { if (mode == SAMBA_TAR) { g_printf (_("SAMBA dumps will be extracted as TAR dumps\n")); samba_extract_method = SAMBA_TAR; } } #else (void)mode; /* Quiet unused parameter warning */ #endif /* SAMBA_CLIENT */ } void show_mode(void) { #ifdef SAMBA_CLIENT g_printf (_("SAMBA dumps are extracted ")); if (samba_extract_method == SAMBA_TAR) { g_printf (_(" as TAR dumps\n")); } else { g_printf (_("using smbclient\n")); } #endif /* SAMBA_CLIENT */ } amanda-3.3.6/oldrecover-src/uscan.c0000664000076400007640000015615712357750335020677 0ustar00martineamartinea00000000000000 #line 3 "uscan.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 40 #define YY_END_OF_BUFFER 41 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[131] = { 0, 0, 0, 0, 0, 41, 40, 39, 38, 34, 38, 38, 22, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 35, 37, 40, 39, 38, 38, 38, 38, 38, 8, 38, 38, 38, 38, 38, 38, 38, 38, 13, 38, 38, 38, 38, 38, 38, 35, 36, 38, 38, 38, 14, 9, 38, 38, 38, 38, 38, 38, 23, 38, 38, 38, 19, 38, 38, 26, 27, 29, 38, 38, 15, 38, 38, 11, 38, 21, 38, 16, 24, 28, 10, 38, 38, 38, 38, 30, 31, 20, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 17, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 18, 25, 12, 38, 38, 5, 4, 3, 6, 7, 38, 2, 1, 33, 38, 32, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 4, 4, 4, 4, 10, 11, 12, 13, 14, 4, 4, 15, 16, 4, 17, 18, 19, 4, 20, 21, 22, 23, 24, 25, 26, 4, 27, 28, 29, 4, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } ; static yyconst flex_int32_t yy_meta[30] = { 0, 1, 1, 2, 3, 4, 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } ; static yyconst flex_int16_t yy_base[135] = { 0, 0, 0, 25, 26, 161, 162, 30, 0, 162, 154, 30, 0, 146, 25, 144, 129, 25, 28, 136, 128, 128, 28, 143, 0, 162, 0, 43, 0, 44, 145, 47, 138, 122, 135, 130, 32, 129, 122, 132, 120, 116, 0, 129, 128, 124, 114, 127, 114, 0, 162, 129, 49, 52, 107, 0, 124, 119, 107, 108, 109, 104, 0, 103, 114, 112, 0, 100, 47, 0, 0, 117, 116, 115, 0, 98, 95, 0, 109, 0, 98, 48, 0, 0, 0, 54, 97, 96, 105, 107, 61, 0, 99, 100, 88, 94, 89, 83, 83, 82, 92, 83, 96, 74, 76, 71, 75, 74, 83, 79, 70, 80, 79, 67, 0, 0, 0, 72, 58, 0, 0, 0, 0, 0, 64, 0, 0, 69, 62, 58, 162, 76, 79, 84, 87 } ; static yyconst flex_int16_t yy_def[135] = { 0, 130, 1, 131, 131, 130, 130, 130, 132, 130, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 130, 134, 130, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 130, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 0, 130, 130, 130, 130 } ; static yyconst flex_int16_t yy_nxt[192] = { 0, 6, 7, 7, 8, 9, 10, 11, 12, 8, 13, 8, 14, 15, 16, 17, 8, 8, 18, 19, 8, 20, 21, 8, 22, 23, 8, 8, 8, 8, 25, 25, 27, 27, 26, 26, 30, 31, 33, 37, 39, 38, 46, 34, 40, 27, 27, 47, 58, 41, 51, 52, 42, 30, 31, 72, 52, 59, 73, 53, 85, 95, 86, 96, 97, 129, 87, 102, 90, 129, 98, 127, 88, 124, 113, 128, 127, 24, 24, 24, 24, 24, 28, 126, 28, 49, 49, 49, 50, 125, 50, 50, 50, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 89, 101, 100, 99, 94, 93, 92, 91, 90, 89, 71, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 57, 56, 55, 54, 53, 48, 45, 44, 43, 36, 35, 32, 29, 130, 5, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 } ; static yyconst flex_int16_t yy_chk[192] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 7, 7, 3, 4, 11, 11, 14, 17, 18, 17, 22, 14, 18, 27, 27, 22, 36, 18, 29, 29, 18, 31, 31, 52, 52, 36, 53, 53, 68, 81, 68, 81, 85, 129, 68, 90, 90, 128, 85, 124, 68, 113, 113, 127, 127, 131, 131, 131, 131, 131, 132, 118, 132, 133, 133, 133, 134, 117, 134, 134, 134, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 89, 88, 87, 86, 80, 78, 76, 75, 73, 72, 71, 67, 65, 64, 63, 61, 60, 59, 58, 57, 56, 54, 51, 48, 47, 46, 45, 44, 43, 41, 40, 39, 38, 37, 35, 34, 33, 32, 30, 23, 21, 20, 19, 16, 15, 13, 10, 5, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "uscan.l" /* * amanda, the advanced maryland automatic network disk archiver * Copyright (c) 1991-2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: uscan.l,v 1.3 2006/07/05 11:15:56 martinea Exp $ * * lexer for amrecover interactive language */ #line 33 "uscan.l" #include "amanda.h" #include "uparse.h" /* * We redefine this here to prevent compiler warning about ignoring fwrite * return value... */ #undef ECHO #define ECHO do { \ if (fwrite(yytext, (size_t)yyleng, 1, yyout) <= 0) { \ yyerror("ECHO failure"); \ } \ } while (0) #define YY_NO_UNPUT #define DATE_ALLOC_SIZE sizeof("YYYY-MM-DD-HH-MM-SS") /* includes null */ #define YY_DECL int yylex() extern int yylex(void); extern void yyerror(char *s); extern int yyparse(void); static int ll_parse_date(int type, char *text); int process_line(char *line); #line 63 "uscan.l" static char *string_buf = NULL; #line 594 "uscan.c" #define INITIAL 0 #define quotedpath 1 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 66 "uscan.l" /* literal keyword tokens */ #line 784 "uscan.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 131 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 162 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 72 "uscan.l" { return LISTHOST; } YY_BREAK case 2: YY_RULE_SETUP #line 73 "uscan.l" { return LISTDISK; } YY_BREAK case 3: YY_RULE_SETUP #line 74 "uscan.l" { return SETHOST; } YY_BREAK case 4: YY_RULE_SETUP #line 75 "uscan.l" { return SETDISK; } YY_BREAK case 5: YY_RULE_SETUP #line 76 "uscan.l" { return SETDATE; } YY_BREAK case 6: YY_RULE_SETUP #line 77 "uscan.l" { return SETMODE; } YY_BREAK case 7: YY_RULE_SETUP #line 78 "uscan.l" { return SETTAPE; } YY_BREAK case 8: YY_RULE_SETUP #line 79 "uscan.l" { return CD; } YY_BREAK case 9: YY_RULE_SETUP #line 80 "uscan.l" { return CDX; } YY_BREAK case 10: YY_RULE_SETUP #line 81 "uscan.l" { return QUIT; } YY_BREAK case 11: YY_RULE_SETUP #line 82 "uscan.l" { return QUIT; } YY_BREAK case 12: YY_RULE_SETUP #line 83 "uscan.l" { return DHIST; } YY_BREAK case 13: YY_RULE_SETUP #line 84 "uscan.l" { return LS; } YY_BREAK case 14: YY_RULE_SETUP #line 85 "uscan.l" { return ADD; } YY_BREAK case 15: YY_RULE_SETUP #line 86 "uscan.l" { return ADDX; } YY_BREAK case 16: YY_RULE_SETUP #line 87 "uscan.l" { return LIST; } YY_BREAK case 17: YY_RULE_SETUP #line 88 "uscan.l" { return DELETE; } YY_BREAK case 18: YY_RULE_SETUP #line 89 "uscan.l" { return DELETEX; } YY_BREAK case 19: YY_RULE_SETUP #line 90 "uscan.l" { return PWD; } YY_BREAK case 20: YY_RULE_SETUP #line 91 "uscan.l" { return CLEAR; } YY_BREAK case 21: YY_RULE_SETUP #line 92 "uscan.l" { return HELP; } YY_BREAK case 22: YY_RULE_SETUP #line 93 "uscan.l" { return HELP; } YY_BREAK case 23: YY_RULE_SETUP #line 94 "uscan.l" { return LCD; } YY_BREAK case 24: YY_RULE_SETUP #line 95 "uscan.l" { return LPWD; } YY_BREAK case 25: YY_RULE_SETUP #line 96 "uscan.l" { return EXTRACT; } YY_BREAK case 26: YY_RULE_SETUP #line 97 "uscan.l" { return SMB; } YY_BREAK case 27: YY_RULE_SETUP #line 98 "uscan.l" { return TAR; } YY_BREAK case 28: YY_RULE_SETUP #line 99 "uscan.l" { return MODE; } YY_BREAK /* dates */ case 29: YY_RULE_SETUP #line 105 "uscan.l" { return ll_parse_date(1, yytext); } YY_BREAK case 30: YY_RULE_SETUP #line 106 "uscan.l" { return ll_parse_date(2, yytext); } YY_BREAK case 31: YY_RULE_SETUP #line 107 "uscan.l" { return ll_parse_date(3, yytext); } YY_BREAK case 32: YY_RULE_SETUP #line 108 "uscan.l" { return ll_parse_date(4, yytext); } YY_BREAK case 33: YY_RULE_SETUP #line 109 "uscan.l" { return ll_parse_date(5, yytext); } YY_BREAK /* quoted file names */ case 34: YY_RULE_SETUP #line 115 "uscan.l" { if(string_buf != NULL) { g_printf("ERROR:string_buf != NULL: %s\n",string_buf); } BEGIN(quotedpath); strappend(string_buf, yytext); } YY_BREAK case 35: /* rule 35 can match eol */ YY_RULE_SETUP #line 123 "uscan.l" { strappend(string_buf, yytext); } YY_BREAK case 36: YY_RULE_SETUP #line 127 "uscan.l" { /* escaped character (including quote) */ strappend(string_buf, yytext); } YY_BREAK case 37: YY_RULE_SETUP #line 132 "uscan.l" { /* saw closing quote - all done */ strappend(string_buf, yytext); yylval.strval = string_buf; string_buf = NULL; BEGIN(INITIAL); return PATH; } YY_BREAK /* file names */ case 38: YY_RULE_SETUP #line 144 "uscan.l" { yylval.strval = stralloc(yytext); return PATH; } YY_BREAK /* whitespace */ case 39: /* rule 39 can match eol */ YY_RULE_SETUP #line 153 "uscan.l" ; /* whitespace */ YY_BREAK /* anything else */ /* everything should have been handled by now, so this rule is disabled */ #if 0 . { yyerror("invalid character"); } #endif case 40: YY_RULE_SETUP #line 166 "uscan.l" ECHO; YY_BREAK #line 1110 "uscan.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(quotedpath): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 131 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 131 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 130); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 166 "uscan.l" int process_line( char * line) { YY_BUFFER_STATE b; int result; b = yy_scan_string(line); /* tell lex to scan lineread */ result = yyparse(); /* parse lineread and act */ yy_delete_buffer(b); return result; } static int ll_parse_date( int type, char * text) { time_t now; struct tm *t; int y=2000, m=0, d=1, h=0, mi=0, s=0; int ret; now = time((time_t *)NULL); t = localtime(&now); if (t) { y = 1900+t->tm_year; m = t->tm_mon+1; d = t->tm_mday; } switch(type) { case 1: if (sscanf(text, "---%d", &d) != 1) { yyerror("invalid date"); } break; case 2: if (sscanf(text, "--%d-%d", &m, &d) != 2) { yyerror("invalid date"); } break; case 3: if (sscanf(text, "%d-%d-%d", &y, &m, &d) != 3) { yyerror("invalid date"); } break; case 4: if (sscanf(text, "%d-%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi, &s) != 6) { yyerror("invalid date"); } break; case 5: if (sscanf(text, "%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi) != 5) { yyerror("invalid date"); } break; } ret = PATH; /* cause a parse error */ if(y < 70) { y += 2000; } else if(y < 100) { y += 1900; } if(y < 1000 || y > 9999) { yyerror("invalid year"); } else if(m < 1 || m > 12) { yyerror("invalid month"); } else if(d < 1 || d > 31) { yyerror("invalid day"); } else if(h < 0 || h > 24) { yyerror("invalid hour"); } else if(mi < 0 || mi > 59) { yyerror("invalid minute"); } else if(s < 0 || s > 59) { yyerror("invalid second"); } else if(type < 4) { yylval.strval = alloc(DATE_ALLOC_SIZE); g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d); ret = DATE; } else { yylval.strval = alloc(DATE_ALLOC_SIZE); g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s); ret = DATE; } return ret; } int yywrap(void) { return 1; } amanda-3.3.6/oldrecover-src/uparse.c0000664000076400007640000015232712357750335021060 0ustar00martineamartinea00000000000000/* A Bison parser, made by GNU Bison 2.5. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 268 of yacc.c */ #line 32 "uparse.y" #include "amanda.h" #include "amrecover.h" void yyerror(char *s); extern int yylex(void); extern char * yytext; /* Line 268 of yacc.c */ #line 82 "uparse.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { LISTHOST = 258, LISTDISK = 259, SETHOST = 260, SETDISK = 261, SETDATE = 262, SETTAPE = 263, SETMODE = 264, CD = 265, CDX = 266, QUIT = 267, DHIST = 268, LS = 269, ADD = 270, ADDX = 271, EXTRACT = 272, LIST = 273, DELETE = 274, DELETEX = 275, PWD = 276, CLEAR = 277, HELP = 278, LCD = 279, LPWD = 280, MODE = 281, SMB = 282, TAR = 283, PATH = 284, DATE = 285 }; #endif /* Tokens. */ #define LISTHOST 258 #define LISTDISK 259 #define SETHOST 260 #define SETDISK 261 #define SETDATE 262 #define SETTAPE 263 #define SETMODE 264 #define CD 265 #define CDX 266 #define QUIT 267 #define DHIST 268 #define LS 269 #define ADD 270 #define ADDX 271 #define EXTRACT 272 #define LIST 273 #define DELETE 274 #define DELETEX 275 #define PWD 276 #define CLEAR 277 #define HELP 278 #define LCD 279 #define LPWD 280 #define MODE 281 #define SMB 282 #define TAR 283 #define PATH 284 #define DATE 285 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 293 of yacc.c */ #line 43 "uparse.y" int intval; double floatval; char * strval; int subtok; /* Line 293 of yacc.c */ #line 187 "uparse.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 343 of yacc.c */ #line 199 "uparse.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 55 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 45 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 31 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 16 /* YYNRULES -- Number of rules. */ #define YYNRULES 49 /* YYNRULES -- Number of states. */ #define YYNSTATES 61 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 285 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 24, 26, 29, 31, 34, 37, 41, 44, 47, 49, 52, 55, 58, 61, 63, 65, 68, 70, 72, 74, 76, 78, 81, 84, 86, 89, 92, 94, 97, 100, 102, 105, 108, 110, 112, 115, 117 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 32, 0, -1, 33, -1, 34, -1, 35, -1, 36, -1, 38, -1, 40, -1, 42, -1, 44, -1, 45, -1, 46, -1, -1, 3, -1, 4, 29, -1, 4, -1, 7, 30, -1, 5, 29, -1, 6, 29, 29, -1, 6, 29, -1, 8, 29, -1, 8, -1, 10, 29, -1, 11, 29, -1, 9, 27, -1, 9, 28, -1, 13, -1, 14, -1, 18, 29, -1, 18, -1, 21, -1, 22, -1, 26, -1, 12, -1, 15, 37, -1, 37, 29, -1, 29, -1, 16, 39, -1, 39, 29, -1, 29, -1, 19, 41, -1, 41, 29, -1, 29, -1, 20, 43, -1, 43, 29, -1, 29, -1, 25, -1, 24, 29, -1, 23, -1, 17, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 101, 109, 110, 111, 112, 113, 114, 115, 119, 123, 127, 128, 132, 136, 137, 141, 145, 146, 150, 154, 155, 159, 160, 167, 171 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST", "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST", "LS", "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD", "CLEAR", "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE", "$accept", "ucommand", "set_command", "display_command", "quit_command", "add_command", "add_path", "addx_command", "addx_path", "delete_command", "delete_path", "deletex_command", "deletex_path", "local_command", "help_command", "extract_command", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 12, 13, 15, 0, 0, 0, 21, 0, 0, 0, 33, 26, 27, 0, 0, 49, 29, 0, 0, 30, 31, 48, 0, 46, 32, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 17, 19, 16, 20, 24, 25, 22, 23, 36, 34, 39, 37, 28, 42, 40, 45, 43, 47, 1, 18, 35, 38, 41, 44 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 25, 26, 27, 28, 29, 46, 30, 48, 31, 51, 32, 53, 33, 34, 35 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -6 static const yytype_int8 yypact[] = { -3, -6, -5, -1, 0, 1, 3, -2, 4, 5, -6, -6, -6, 6, 7, -6, 8, 9, 10, -6, -6, -6, 11, -6, -6, 27, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, 12, -6, -6, -6, -6, -6, -6, -6, 13, -6, 14, -6, -6, 15, -6, 16, -6, -6, -6, -6, -6, -6, -6 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 36, 41, 42, 55, 37, 38, 0, 39, 40, 43, 44, 45, 47, 49, 50, 52, 54, 56, 57, 58, 59, 60 }; #define yypact_value_is_default(yystate) \ ((yystate) == (-6)) #define yytable_value_is_error(yytable_value) \ YYID (0) static const yytype_int8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 27, 28, 0, 29, 29, -1, 30, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 32, 33, 34, 35, 36, 38, 40, 42, 44, 45, 46, 29, 29, 29, 30, 29, 27, 28, 29, 29, 29, 37, 29, 39, 29, 29, 41, 29, 43, 29, 0, 29, 29, 29, 29, 29 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. However, YYFAIL appears to be in use. Nevertheless, it is formally deprecated in Bison 2.4.2's NEWS entry, where a plan to phase it out is discussed. */ #define YYFAIL goto yyerrlab #if defined YYFAIL /* This is here to suppress warnings from the GCC cpp's -Wunused-macros. Normally we don't worry about that warning, but some users do, and we want to make it easy for users to remove YYFAIL uses, which will produce warnings from Bison 2.5. */ #endif #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = 0; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - Assume YYFAIL is not used. It's too flawed to consider. See for details. YYERROR is fine as it does not invoke this function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 12: /* Line 1806 of yacc.c */ #line 76 "uparse.y" { char * errstr = vstralloc("Invalid command: ", yytext, NULL); yyerror(errstr); amfree(errstr); YYERROR; } break; case 13: /* Line 1806 of yacc.c */ #line 85 "uparse.y" { list_host(); } break; case 14: /* Line 1806 of yacc.c */ #line 86 "uparse.y" { list_disk((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 15: /* Line 1806 of yacc.c */ #line 87 "uparse.y" { list_disk(NULL); } break; case 16: /* Line 1806 of yacc.c */ #line 88 "uparse.y" { set_date((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 17: /* Line 1806 of yacc.c */ #line 89 "uparse.y" { set_host((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 18: /* Line 1806 of yacc.c */ #line 90 "uparse.y" { set_disk((yyvsp[(2) - (3)].strval), (yyvsp[(3) - (3)].strval)); amfree((yyvsp[(2) - (3)].strval)); amfree((yyvsp[(3) - (3)].strval)); } break; case 19: /* Line 1806 of yacc.c */ #line 91 "uparse.y" { set_disk((yyvsp[(2) - (2)].strval), NULL); amfree((yyvsp[(2) - (2)].strval)); } break; case 20: /* Line 1806 of yacc.c */ #line 92 "uparse.y" { set_tape((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 21: /* Line 1806 of yacc.c */ #line 93 "uparse.y" { set_tape(""); } break; case 22: /* Line 1806 of yacc.c */ #line 94 "uparse.y" { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 23: /* Line 1806 of yacc.c */ #line 95 "uparse.y" { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 24: /* Line 1806 of yacc.c */ #line 96 "uparse.y" { #ifdef SAMBA_CLIENT set_mode(SAMBA_SMBCLIENT); #endif /* SAMBA_CLIENT */ } break; case 25: /* Line 1806 of yacc.c */ #line 101 "uparse.y" { #ifdef SAMBA_CLIENT set_mode(SAMBA_TAR); #endif /* SAMBA_CLIENT */ } break; case 26: /* Line 1806 of yacc.c */ #line 109 "uparse.y" { list_disk_history(); } break; case 27: /* Line 1806 of yacc.c */ #line 110 "uparse.y" { list_directory(); } break; case 28: /* Line 1806 of yacc.c */ #line 111 "uparse.y" { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 29: /* Line 1806 of yacc.c */ #line 112 "uparse.y" { display_extract_list(NULL); } break; case 30: /* Line 1806 of yacc.c */ #line 113 "uparse.y" { show_directory(); } break; case 31: /* Line 1806 of yacc.c */ #line 114 "uparse.y" { clear_extract_list(); } break; case 32: /* Line 1806 of yacc.c */ #line 115 "uparse.y" { show_mode (); } break; case 33: /* Line 1806 of yacc.c */ #line 119 "uparse.y" { quit(); } break; case 35: /* Line 1806 of yacc.c */ #line 127 "uparse.y" { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 36: /* Line 1806 of yacc.c */ #line 128 "uparse.y" { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); } break; case 38: /* Line 1806 of yacc.c */ #line 136 "uparse.y" { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 39: /* Line 1806 of yacc.c */ #line 137 "uparse.y" { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); } break; case 41: /* Line 1806 of yacc.c */ #line 145 "uparse.y" { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 42: /* Line 1806 of yacc.c */ #line 146 "uparse.y" { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); } break; case 44: /* Line 1806 of yacc.c */ #line 154 "uparse.y" { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 45: /* Line 1806 of yacc.c */ #line 155 "uparse.y" { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); } break; case 46: /* Line 1806 of yacc.c */ #line 159 "uparse.y" { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); } break; case 47: /* Line 1806 of yacc.c */ #line 160 "uparse.y" { local_cd((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); } break; case 48: /* Line 1806 of yacc.c */ #line 167 "uparse.y" { help_list(); } break; case 49: /* Line 1806 of yacc.c */ #line 171 "uparse.y" { extract_files(); } break; /* Line 1806 of yacc.c */ #line 1729 "uparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 2067 of yacc.c */ #line 175 "uparse.y" void yyerror( char * s) { g_printf("%s\n", s); } amanda-3.3.6/oldrecover-src/uparse.h0000664000076400007640000000611312357750335021054 0ustar00martineamartinea00000000000000/* A Bison parser, made by GNU Bison 2.5. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { LISTHOST = 258, LISTDISK = 259, SETHOST = 260, SETDISK = 261, SETDATE = 262, SETTAPE = 263, SETMODE = 264, CD = 265, CDX = 266, QUIT = 267, DHIST = 268, LS = 269, ADD = 270, ADDX = 271, EXTRACT = 272, LIST = 273, DELETE = 274, DELETEX = 275, PWD = 276, CLEAR = 277, HELP = 278, LCD = 279, LPWD = 280, MODE = 281, SMB = 282, TAR = 283, PATH = 284, DATE = 285 }; #endif /* Tokens. */ #define LISTHOST 258 #define LISTDISK 259 #define SETHOST 260 #define SETDISK 261 #define SETDATE 262 #define SETTAPE 263 #define SETMODE 264 #define CD 265 #define CDX 266 #define QUIT 267 #define DHIST 268 #define LS 269 #define ADD 270 #define ADDX 271 #define EXTRACT 272 #define LIST 273 #define DELETE 274 #define DELETEX 275 #define PWD 276 #define CLEAR 277 #define HELP 278 #define LCD 279 #define LPWD 280 #define MODE 281 #define SMB 282 #define TAR 283 #define PATH 284 #define DATE 285 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 2068 of yacc.c */ #line 43 "uparse.y" int intval; double floatval; char * strval; int subtok; /* Line 2068 of yacc.c */ #line 119 "uparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; amanda-3.3.6/oldrecover-src/uscan.l0000664000076400007640000001404012357250001020651 0ustar00martineamartinea00000000000000/* * amanda, the advanced maryland automatic network disk archiver * Copyright (c) 1991-2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: uscan.l,v 1.3 2006/07/05 11:15:56 martinea Exp $ * * lexer for amrecover interactive language */ %{ #include "amanda.h" #include "uparse.h" /* * We redefine this here to prevent compiler warning about ignoring fwrite * return value... */ #undef ECHO #define ECHO do { \ if (fwrite(yytext, (size_t)yyleng, 1, yyout) <= 0) { \ yyerror("ECHO failure"); \ } \ } while (0) #define YY_NO_UNPUT #define DATE_ALLOC_SIZE sizeof("YYYY-MM-DD-HH-MM-SS") /* includes null */ #define YY_DECL int yylex() extern int yylex(void); extern void yyerror(char *s); extern int yyparse(void); static int ll_parse_date(int type, char *text); int process_line(char *line); %} %x quotedpath %{ static char *string_buf = NULL; %} %% %{ /* literal keyword tokens */ %} listhost { return LISTHOST; } listdisk { return LISTDISK; } sethost { return SETHOST; } setdisk { return SETDISK; } setdate { return SETDATE; } setmode { return SETMODE; } settape { return SETTAPE; } cd { return CD; } cdx { return CDX; } quit { return QUIT; } exit { return QUIT; } history { return DHIST; } ls { return LS; } add { return ADD; } addx { return ADDX; } list { return LIST; } delete { return DELETE; } deletex { return DELETEX; } pwd { return PWD; } clear { return CLEAR; } help { return HELP; } \? { return HELP; } lcd { return LCD; } lpwd { return LPWD; } extract { return EXTRACT; } smb { return SMB; } tar { return TAR; } mode { return MODE; } %{ /* dates */ %} ---[0-9]+ { return ll_parse_date(1, yytext); } --[0-9]+-[0-9]+ { return ll_parse_date(2, yytext); } [0-9]+-[0-9]+-[0-9]+ { return ll_parse_date(3, yytext); } [0-9]+-[0-9]+-[0-9]+-[0-9]+-[0-9]+-[0-9]+ { return ll_parse_date(4, yytext); } [0-9]+-[0-9]+-[0-9]+-[0-9]+-[0-9]+ { return ll_parse_date(5, yytext); } %{ /* quoted file names */ %} \" { if(string_buf != NULL) { g_printf("ERROR:string_buf != NULL: %s\n",string_buf); } BEGIN(quotedpath); strappend(string_buf, yytext); } [^\\\"]+ { strappend(string_buf, yytext); } \\. { /* escaped character (including quote) */ strappend(string_buf, yytext); } \" { /* saw closing quote - all done */ strappend(string_buf, yytext); yylval.strval = string_buf; string_buf = NULL; BEGIN(INITIAL); return PATH; } %{ /* file names */ %} [^[:space:][:cntrl:]"]+ { yylval.strval = stralloc(yytext); return PATH; } %{ /* whitespace */ %} [[:space:]]+ ; /* whitespace */ %{ /* anything else */ /* everything should have been handled by now, so this rule is disabled */ %} %{ #if 0 . { yyerror("invalid character"); } #endif %} %% int process_line( char * line) { YY_BUFFER_STATE b; int result; b = yy_scan_string(line); /* tell lex to scan lineread */ result = yyparse(); /* parse lineread and act */ yy_delete_buffer(b); return result; } static int ll_parse_date( int type, char * text) { time_t now; struct tm *t; int y=2000, m=0, d=1, h=0, mi=0, s=0; int ret; now = time((time_t *)NULL); t = localtime(&now); if (t) { y = 1900+t->tm_year; m = t->tm_mon+1; d = t->tm_mday; } switch(type) { case 1: if (sscanf(text, "---%d", &d) != 1) { yyerror("invalid date"); } break; case 2: if (sscanf(text, "--%d-%d", &m, &d) != 2) { yyerror("invalid date"); } break; case 3: if (sscanf(text, "%d-%d-%d", &y, &m, &d) != 3) { yyerror("invalid date"); } break; case 4: if (sscanf(text, "%d-%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi, &s) != 6) { yyerror("invalid date"); } break; case 5: if (sscanf(text, "%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi) != 5) { yyerror("invalid date"); } break; } ret = PATH; /* cause a parse error */ if(y < 70) { y += 2000; } else if(y < 100) { y += 1900; } if(y < 1000 || y > 9999) { yyerror("invalid year"); } else if(m < 1 || m > 12) { yyerror("invalid month"); } else if(d < 1 || d > 31) { yyerror("invalid day"); } else if(h < 0 || h > 24) { yyerror("invalid hour"); } else if(mi < 0 || mi > 59) { yyerror("invalid minute"); } else if(s < 0 || s > 59) { yyerror("invalid second"); } else if(type < 4) { yylval.strval = alloc(DATE_ALLOC_SIZE); g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d); ret = DATE; } else { yylval.strval = alloc(DATE_ALLOC_SIZE); g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s); ret = DATE; } return ret; } int yywrap(void) { return 1; } amanda-3.3.6/oldrecover-src/amrecover.h0000664000076400007640000000774412357250001021534 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amrecover.h,v 1.2 2006/05/25 01:47:13 johnfranks Exp $ * * data structures and declarations for amrecover */ #include "amanda.h" #include "amfeatures.h" typedef struct DIR_ITEM { char *date; int level; char *tape; char *path; off_t fileno; struct DIR_ITEM *next; } DIR_ITEM; extern char *server_name; extern char *config; extern char *dump_datestamp; /* date we are restoring */ extern char *dump_hostname; /* which machine we are restoring */ extern char *disk_name; /* disk we are restoring */ extern char *mount_point; /* where disk was mounted */ extern char *disk_path; /* path relative to mount point */ extern char dump_date[STR_SIZE]; /* date on which we are restoring */ extern int quit_prog; /* set when time to exit parser */ extern char *tape_server_name; extern char *tape_device_name; extern am_feature_t *our_features; extern am_feature_t *indexsrv_features; extern am_feature_t *tapesrv_features; extern pid_t extract_restore_child_pid; extern void free_dir_item(DIR_ITEM *item); extern int converse(char *cmd); extern int exchange(char *cmd); extern int server_happy(void); extern int send_command(char *cmd); extern int get_reply_line(void); extern char *reply_line(void); extern void quit(void); extern void help_list(void); /* list commands */ extern void set_disk(char *dsk, char *mtpt); extern void list_disk(char *amdevice); extern void list_host(void); extern void set_host(const char *host); extern int set_date(char *date); extern void set_directory(char *dir); extern void local_cd(char *dir); extern void cd_glob(char *dir); extern void cd_regex(char *dir); extern void cd_dir(char *dir, char *default_dir); extern void set_tape(char *tape); extern void show_directory(void); extern void set_mode(int mode); extern void show_mode(void); extern void list_disk_history(void); extern void list_directory(void); extern DIR_ITEM *get_dir_list(void); extern DIR_ITEM *get_next_dir_item(DIR_ITEM *this); extern void suck_dir_list_from_server(void); extern void clear_dir_list(void); extern void clean_pathname(char *s); extern void display_extract_list(char *file); extern void clear_extract_list(void); extern int is_extract_list_nonempty(void); extern void add_glob(char *glob); extern void add_regex(char *regex); extern void add_file(char *path, char *regex); extern void delete_glob(char *glob); extern void delete_regex(char *regex); extern void delete_file(char *path, char *regex); extern void extract_files(void); #ifdef SAMBA_CLIENT #define SAMBA_SMBCLIENT 0 #define SAMBA_TAR 1 #endif extern char *get_security(void); amanda-3.3.6/oldrecover-src/uparse.y0000664000076400007640000001063412357250001021061 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: uparse.y,v 1.2 2006/05/25 01:47:13 johnfranks Exp $ * * parser for amrecover interactive language */ %{ #include "amanda.h" #include "amrecover.h" void yyerror(char *s); extern int yylex(void); extern char * yytext; %} /* DECLARATIONS */ %union { int intval; double floatval; char * strval; int subtok; } /* literal keyword tokens */ %token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE %token CD CDX QUIT DHIST LS ADD ADDX EXTRACT %token LIST DELETE DELETEX PWD CLEAR HELP LCD LPWD MODE SMB TAR /* typed tokens */ %token PATH %token DATE /* GRAMMAR */ %% ucommand: set_command | display_command | quit_command | add_command | addx_command | delete_command | deletex_command | local_command | help_command | extract_command | { char * errstr = vstralloc("Invalid command: ", yytext, NULL); yyerror(errstr); amfree(errstr); YYERROR; } /* Quiets compiler warnings about unused label */ ; set_command: LISTHOST { list_host(); } | LISTDISK PATH { list_disk($2); amfree($2); } | LISTDISK { list_disk(NULL); } | SETDATE DATE { set_date($2); amfree($2); } | SETHOST PATH { set_host($2); amfree($2); } | SETDISK PATH PATH { set_disk($2, $3); amfree($2); amfree($3); } | SETDISK PATH { set_disk($2, NULL); amfree($2); } | SETTAPE PATH { set_tape($2); amfree($2); } | SETTAPE { set_tape(""); } | CD PATH { cd_glob($2); amfree($2); } | CDX PATH { cd_regex($2); amfree($2); } | SETMODE SMB { #ifdef SAMBA_CLIENT set_mode(SAMBA_SMBCLIENT); #endif /* SAMBA_CLIENT */ } | SETMODE TAR { #ifdef SAMBA_CLIENT set_mode(SAMBA_TAR); #endif /* SAMBA_CLIENT */ } ; display_command: DHIST { list_disk_history(); } | LS { list_directory(); } | LIST PATH { display_extract_list($2); amfree($2); } | LIST { display_extract_list(NULL); } | PWD { show_directory(); } | CLEAR { clear_extract_list(); } | MODE { show_mode (); } ; quit_command: QUIT { quit(); } ; add_command: ADD add_path ; add_path: add_path PATH { add_glob($2); amfree($2); } | PATH { add_glob($1); amfree($1); } ; addx_command: ADDX addx_path ; addx_path: addx_path PATH { add_regex($2); amfree($2); } | PATH { add_regex($1); amfree($1); } ; delete_command: DELETE delete_path ; delete_path: delete_path PATH { delete_glob($2); amfree($2); } | PATH { delete_glob($1); amfree($1); } ; deletex_command: DELETEX deletex_path ; deletex_path: deletex_path PATH { delete_regex($2); amfree($2); } | PATH { delete_regex($1); amfree($1); } ; local_command: LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); } | LCD PATH { local_cd($2); amfree($2); } ; help_command: HELP { help_list(); } ; extract_command: EXTRACT { extract_files(); } ; /* ADDITIONAL C CODE */ %% void yyerror( char * s) { g_printf("%s\n", s); } amanda-3.3.6/oldrecover-src/extract_list.c0000664000076400007640000016253712357250001022253 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998, 2000 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id$ * * implements the "extract" command in amrecover */ #include "amanda.h" #include "match.h" #include "conffile.h" #include "amrecover.h" #include "fileheader.h" #include "dgram.h" #include "stream.h" #include "tapelist.h" #ifdef SAMBA_CLIENT #include "findpass.h" #endif #include "util.h" typedef struct EXTRACT_LIST_ITEM { char *path; struct EXTRACT_LIST_ITEM *next; } EXTRACT_LIST_ITEM; typedef struct EXTRACT_LIST { char *date; /* date tape created */ int level; /* level of dump */ char *tape; /* tape label */ off_t fileno; /* fileno on tape */ EXTRACT_LIST_ITEM *files; /* files to get off tape */ struct EXTRACT_LIST *next; } EXTRACT_LIST; #define SKIP_TAPE 2 #define RETRY_TAPE 3 char *dump_device_name = NULL; extern char *localhost; /* global pid storage for interrupt handler */ pid_t extract_restore_child_pid = -1; static EXTRACT_LIST *extract_list = NULL; static int tape_control_sock = -1; static int tape_data_sock = -1; #ifdef SAMBA_CLIENT unsigned short samba_extract_method = SAMBA_TAR; #endif /* SAMBA_CLIENT */ #define READ_TIMEOUT 240*60 EXTRACT_LIST *first_tape_list(void); EXTRACT_LIST *next_tape_list(EXTRACT_LIST *list); int is_extract_list_nonempty(void); int length_of_tape_list(EXTRACT_LIST *tape_list); void add_file(char *path, char *regex); void add_glob(char *glob); void add_regex(char *regex); void clear_extract_list(void); void clean_tape_list(EXTRACT_LIST *tape_list); void clean_extract_list(void); void delete_file(char *path, char *regex); void delete_glob(char *glob); void delete_regex(char *regex); void delete_tape_list(EXTRACT_LIST *tape_list); void display_extract_list(char *file); void extract_files(void); void read_file_header(char *buffer, dumpfile_t *file, size_t buflen, int tapedev); void writer_intermediary(int ctl_fd, int data_fd, EXTRACT_LIST *elist); void writer_intermediary(int ctl_fd, int data_fd, EXTRACT_LIST *elist); static int add_extract_item(DIR_ITEM *ditem); static int delete_extract_item(DIR_ITEM *ditem); static int extract_files_setup(char *label, off_t fsf); static int okay_to_continue(int allow_tape, int allow_skip, int allow_retry); static int okay_to_continue(int, int, int); static ssize_t read_buffer(int datafd, char *buffer, size_t buflen, long timeout_s); static void clear_tape_list(EXTRACT_LIST *tape_list); static void extract_files_child(int in_fd, EXTRACT_LIST *elist); static void send_to_tape_server(int tss, char *cmd); /* * Function: ssize_t read_buffer(datafd, buffer, buflen, timeout_s) * * Description: * read data from input file desciptor waiting up to timeout_s * seconds before returning data. * * Inputs: * datafd - File descriptor to read from. * buffer - Buffer to read into. * buflen - Maximum number of bytes to read into buffer. * timeout_s - Seconds to wait before returning what was already read. * * Returns: * >0 - Number of data bytes in buffer. * 0 - EOF * -1 - errno == ETIMEDOUT if no data available in specified time. * errno == ENFILE if datafd is invalid. * otherwise errno is set by select or read.. */ static ssize_t read_buffer( int datafd, char * buffer, size_t buflen, long timeout_s) { ssize_t size = 0; fd_set readset; struct timeval timeout; char *dataptr; ssize_t spaceleft; int nfound; if(datafd < 0 || datafd >= (int)FD_SETSIZE) { errno = EMFILE; /* out of range */ return -1; } dataptr = buffer; spaceleft = (ssize_t)buflen; do { FD_ZERO(&readset); FD_SET(datafd, &readset); timeout.tv_sec = timeout_s; timeout.tv_usec = 0; nfound = select(datafd+1, &readset, NULL, NULL, &timeout); if(nfound < 0 ) { /* Select returned an error. */ g_fprintf(stderr,_("select error: %s\n"), strerror(errno)); size = -1; break; } if (nfound == 0) { /* Select timed out. */ if (timeout_s != 0) { /* Not polling: a real read timeout */ g_fprintf(stderr,_("timeout waiting for restore\n")); g_fprintf(stderr,_("increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n")); } errno = ETIMEDOUT; size = -1; break; } if(!FD_ISSET(datafd, &readset)) continue; /* Select says data is available, so read it. */ size = read(datafd, dataptr, (size_t)spaceleft); if (size < 0) { if ((errno == EINTR) || (errno == EAGAIN)) { continue; } if (errno != EPIPE) { g_fprintf(stderr, _("read_buffer: read error - %s"), strerror(errno)); break; } size = 0; } spaceleft -= size; dataptr += size; } while ((size > 0) && (spaceleft > 0)); return ((((ssize_t)buflen-spaceleft) > 0) ? ((ssize_t)buflen-spaceleft) : size); } EXTRACT_LIST * first_tape_list(void) { return extract_list; } EXTRACT_LIST * next_tape_list( /*@keep@*/ EXTRACT_LIST *list) { if (list == NULL) return NULL; return list->next; } static void clear_tape_list( EXTRACT_LIST * tape_list) { EXTRACT_LIST_ITEM *this, *next; this = tape_list->files; while (this != NULL) { next = this->next; amfree(this->path); amfree(this); this = next; } tape_list->files = NULL; } /* remove a tape list from the extract list, clearing the tape list beforehand if necessary */ void delete_tape_list( EXTRACT_LIST * tape_list) { EXTRACT_LIST *this, *prev; if (tape_list == NULL) return; /* is it first on the list? */ if (tape_list == extract_list) { extract_list = tape_list->next; clear_tape_list(tape_list); amfree(tape_list->date); amfree(tape_list->tape); amfree(tape_list); return; } /* so not first on list - find it and delete */ prev = extract_list; this = extract_list->next; while (this != NULL) { if (this == tape_list) { prev->next = tape_list->next; clear_tape_list(tape_list); amfree(tape_list->date); amfree(tape_list->tape); amfree(tape_list); return; } prev = this; this = this->next; } /*NOTREACHED*/ } /* return the number of files on a tape's list */ int length_of_tape_list( EXTRACT_LIST * tape_list) { EXTRACT_LIST_ITEM *fn; int n; n = 0; for (fn = tape_list->files; fn != NULL; fn = fn->next) n++; return n; } void clear_extract_list(void) { while (extract_list != NULL) delete_tape_list(extract_list); } void clean_tape_list( EXTRACT_LIST *tape_list) { EXTRACT_LIST_ITEM *fn1, *pfn1, *ofn1; EXTRACT_LIST_ITEM *fn2, *pfn2, *ofn2; int remove_fn1; int remove_fn2; pfn1 = NULL; fn1 = tape_list->files; while (fn1 != NULL) { remove_fn1 = 0; pfn2 = fn1; fn2 = fn1->next; while (fn2 != NULL && remove_fn1 == 0) { remove_fn2 = 0; if(strcmp(fn1->path, fn2->path) == 0) { remove_fn2 = 1; } else if (strncmp(fn1->path, fn2->path, strlen(fn1->path)) == 0 && ((strlen(fn2->path) > strlen(fn1->path) && fn2->path[strlen(fn1->path)] == '/') || (fn1->path[strlen(fn1->path)-1] == '/'))) { remove_fn2 = 1; } else if (strncmp(fn2->path, fn1->path, strlen(fn2->path)) == 0 && ((strlen(fn1->path) > strlen(fn2->path) && fn1->path[strlen(fn2->path)] == '/') || (fn2->path[strlen(fn2->path)-1] == '/'))) { remove_fn1 = 1; break; } if (remove_fn2) { dbprintf(_("removing path %s, it is included in %s\n"), fn2->path, fn1->path); ofn2 = fn2; fn2 = fn2->next; amfree(ofn2->path); amfree(ofn2); pfn2->next = fn2; } else if (remove_fn1 == 0) { pfn2 = fn2; fn2 = fn2->next; } } if(remove_fn1 != 0) { /* fn2->path is always valid */ /*@i@*/ dbprintf(_("removing path %s, it is included in %s\n"), /*@i@*/ fn1->path, fn2->path); ofn1 = fn1; fn1 = fn1->next; amfree(ofn1->path); if(pfn1 == NULL) { amfree(tape_list->files); tape_list->files = fn1; } else { amfree(pfn1->next); pfn1->next = fn1; } } else { pfn1 = fn1; fn1 = fn1->next; } } } void clean_extract_list(void) { EXTRACT_LIST *this; for (this = extract_list; this != NULL; this = this->next) clean_tape_list(this); } /* returns -1 if error */ /* returns 0 on succes */ /* returns 1 if already added */ static int add_extract_item( DIR_ITEM * ditem) { EXTRACT_LIST *this, *this1; EXTRACT_LIST_ITEM *that, *curr; char *ditem_path = NULL; ditem_path = stralloc(ditem->path); clean_pathname(ditem_path); for (this = extract_list; this != NULL; this = this->next) { /* see if this is the list for the tape */ if (this->level == ditem->level && strcmp(this->tape, ditem->tape) == 0) { /* yes, so add to list */ curr=this->files; while(curr!=NULL) { if (strcmp(curr->path, ditem_path) == 0) { amfree(ditem_path); return 1; } curr=curr->next; } that = (EXTRACT_LIST_ITEM *)alloc(sizeof(EXTRACT_LIST_ITEM)); that->path = stralloc(ditem_path); that->next = this->files; this->files = that; /* add at front since easiest */ amfree(ditem_path); return 0; } } /* so this is the first time we have seen this tape */ this = (EXTRACT_LIST *)alloc(sizeof(EXTRACT_LIST)); this->tape = stralloc(ditem->tape); this->level = ditem->level; this->fileno = ditem->fileno; this->date = stralloc(ditem->date); that = (EXTRACT_LIST_ITEM *)alloc(sizeof(EXTRACT_LIST_ITEM)); that->path = stralloc(ditem_path); that->next = NULL; this->files = that; /* add this in date increasing order */ /* because restore must be done in this order */ /* add at begining */ if(extract_list==NULL || strcmp(this->date,extract_list->date) < 0) { this->next = extract_list; extract_list = this; amfree(ditem_path); return 0; } for (this1 = extract_list; this1->next != NULL; this1 = this1->next) { /* add in the middle */ if(strcmp(this->date,this1->next->date) < 0) { this->next = this1->next; this1->next = this; amfree(ditem_path); return 0; } } /* add at end */ this->next = NULL; this1->next = this; amfree(ditem_path); return 0; } /* returns -1 if error */ /* returns 0 on deletion */ /* returns 1 if not there */ static int delete_extract_item( DIR_ITEM * ditem) { EXTRACT_LIST *this; EXTRACT_LIST_ITEM *that, *prev; char *ditem_path = NULL; ditem_path = stralloc(ditem->path); clean_pathname(ditem_path); for (this = extract_list; this != NULL; this = this->next) { /* see if this is the list for the tape */ if (this->level == ditem->level && strcmp(this->tape, ditem->tape) == 0) { /* yes, so find file on list */ that = this->files; if (strcmp(that->path, ditem_path) == 0) { /* first on list */ this->files = that->next; amfree(that->path); amfree(that); /* if list empty delete it */ if (this->files == NULL) delete_tape_list(this); amfree(ditem_path); return 0; } prev = that; that = that->next; while (that != NULL) { if (strcmp(that->path, ditem_path) == 0) { prev->next = that->next; amfree(that->path); amfree(that); amfree(ditem_path); return 0; } prev = that; that = that->next; } amfree(ditem_path); return 1; } } amfree(ditem_path); return 1; } void add_glob( char * glob) { char *regex; char *regex_path; char *s; char *uqglob = unquote_string(glob); regex = glob_to_regex(uqglob); dbprintf(_("add_glob (%s) -> %s\n"), uqglob, regex); if ((s = validate_regexp(regex)) != NULL) { g_printf(_("%s is not a valid shell wildcard pattern: "), glob); puts(s); } else { /* * glob_to_regex() anchors the beginning of the pattern with ^, * but we will be tacking it onto the end of the current directory * in add_file, so strip that off. Also, it anchors the end with * $, but we need to match an optional trailing /, so tack that on * the end. */ regex_path = stralloc(regex + 1); regex_path[strlen(regex_path) - 1] = '\0'; strappend(regex_path, "[/]*$"); add_file(uqglob, regex_path); amfree(regex_path); } amfree(regex); amfree(uqglob); } void add_regex( char * regex) { char *s; char *uqregex = unquote_string(regex); if ((s = validate_regexp(uqregex)) != NULL) { g_printf(_("%s is not a valid regular expression: "), regex); puts(s); } else { add_file(uqregex, regex); } amfree(uqregex); } void add_file( char * path, char * regex) { DIR_ITEM *ditem, lditem; char *path_on_disk = NULL; char *path_on_disk_slash = NULL; char *cmd = NULL; char *err = NULL; int i; ssize_t j; char *dir_undo, dir_undo_ch = '\0'; char *ditem_path = NULL; char *l = NULL; int added; char *s, *fp, *quoted; int ch; int found_one; int dir_entries; if (disk_path == NULL) { g_printf(_("Must select directory before adding files\n")); return; } memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */ dbprintf(_("add_file: Looking for \"%s\"\n"), regex); if(strcmp(regex, "/[/]*$") == 0) { /* "/" behave like "." */ regex = "\\.[/]*$"; } else if(strcmp(regex, "[^/]*[/]*$") == 0) { /* "*" */ regex = "([^/.]|\\.[^/]+|[^/.][^/]*)[/]*$"; } else { /* remove "/" at end of path */ j = (ssize_t)(strlen(regex) - 1); while(j >= 0 && regex[j] == '/') regex[j--] = '\0'; } /* convert path (assumed in cwd) to one on disk */ if (strcmp(disk_path, "/") == 0) { if (*regex == '/') { /* No mods needed if already starts with '/' */ path_on_disk = stralloc(regex); } else { /* Prepend '/' */ path_on_disk = stralloc2("/", regex); } } else { char *clean_disk_path = clean_regex(disk_path, 0); path_on_disk = vstralloc(clean_disk_path, "/", regex, NULL); amfree(clean_disk_path); } path_on_disk_slash = stralloc2(path_on_disk, "/"); dbprintf(_("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"), regex, path_on_disk); found_one = 0; dir_entries = 0; for (ditem=get_dir_list(); ditem!=NULL; ditem=get_next_dir_item(ditem)) { dir_entries++; quoted = quote_string(ditem->path); dbprintf(_("add_file: Pondering ditem->path=%s\n"), quoted); amfree(quoted); if (match(path_on_disk, ditem->path) || match(path_on_disk_slash, ditem->path)) { found_one = 1; j = (ssize_t)strlen(ditem->path); if((j > 0 && ditem->path[j-1] == '/') || (j > 1 && ditem->path[j-2] == '/' && ditem->path[j-1] == '.')) { /* It is a directory */ ditem_path = newstralloc(ditem_path, ditem->path); clean_pathname(ditem_path); cmd = newstralloc2(cmd, "ORLD ", ditem_path); if(send_command(cmd) == -1) { amfree(cmd); amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } amfree(cmd); cmd = NULL; /* skip preamble */ if ((i = get_reply_line()) == -1) { amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } if(i==0) { /* assume something wrong */ amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); l = reply_line(); g_printf(_("%s\n"), l); return; } dir_undo = NULL; added=0; lditem.path = newstralloc(lditem.path, ditem->path); /* skip the last line -- duplicate of the preamble */ while ((i = get_reply_line()) != 0) { if (i == -1) { amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } if(err) { if(cmd == NULL) { if(dir_undo) *dir_undo = dir_undo_ch; dir_undo = NULL; cmd = stralloc(l); /* save for error report */ } continue; /* throw the rest of the lines away */ } l=reply_line(); if (!server_happy()) { puts(l); continue; } s = l; if(strncmp_const_skip(l, "201-", s, ch) != 0) { err = _("bad reply: not 201-"); continue; } ch = *s++; skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing date field"); continue; } fp = s-1; skip_non_whitespace(s, ch); s[-1] = '\0'; lditem.date = newstralloc(lditem.date, fp); s[-1] = (char)ch; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%d", &lditem.level) != 1) { err = _("bad reply: cannot parse level field"); continue; } skip_integer(s, ch); skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing tape field"); continue; } fp = s-1; skip_non_whitespace(s, ch); s[-1] = '\0'; lditem.tape = newstralloc(lditem.tape, fp); s[-1] = (char)ch; if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) { long long fileno_ = (long long)0; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%lld", &fileno_) != 1) { err = _("bad reply: cannot parse fileno field"); continue; } lditem.fileno = (off_t)fileno_; skip_integer(s, ch); } skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing directory field"); continue; } skip_quoted_string(s, ch); dir_undo = s - 1; dir_undo_ch = *dir_undo; *dir_undo = '\0'; switch(add_extract_item(&lditem)) { case -1: g_printf(_("System error\n")); dbprintf(_("add_file: (Failed) System error\n")); break; case 0: quoted = quote_string(lditem.path); g_printf(_("Added dir %s at date %s\n"), quoted, lditem.date); dbprintf(_("add_file: (Successful) Added dir %s at date %s\n"), quoted, lditem.date); amfree(quoted); added=1; break; case 1: break; } } if(!server_happy()) { puts(reply_line()); } else if(err) { if (*err) puts(err); if (cmd) puts(cmd); } else if(added == 0) { quoted = quote_string(ditem_path); g_printf(_("dir %s already added\n"), quoted); dbprintf(_("add_file: dir %s already added\n"), quoted); amfree(quoted); } } else /* It is a file */ { switch(add_extract_item(ditem)) { case -1: g_printf(_("System error\n")); dbprintf(_("add_file: (Failed) System error\n")); break; case 0: quoted = quote_string(ditem->path); g_printf(_("Added file %s\n"), quoted); dbprintf(_("add_file: (Successful) Added %s\n"), quoted); amfree(quoted); break; case 1: quoted = quote_string(ditem->path); g_printf(_("File %s already added\n"), quoted); dbprintf(_("add_file: file %s already added\n"), quoted); amfree(quoted); break; } } } } if (cmd != NULL) amfree(cmd); amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); if(! found_one) { quoted = quote_string(path); g_printf(_("File %s doesn't exist in directory\n"), quoted); dbprintf(_("add_file: (Failed) File %s doesn't exist in directory\n"), quoted); amfree(quoted); } } void delete_glob( char * glob) { char *regex; char *regex_path; char *s; char *uqglob = unquote_string(glob); regex = glob_to_regex(uqglob); dbprintf(_("delete_glob (%s) -> %s\n"), uqglob, regex); if ((s = validate_regexp(regex)) != NULL) { g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob); puts(s); } else { /* * glob_to_regex() anchors the beginning of the pattern with ^, * but we will be tacking it onto the end of the current directory * in add_file, so strip that off. Also, it anchors the end with * $, but we need to match an optional trailing /, so tack that on * the end. */ regex_path = stralloc(regex + 1); regex_path[strlen(regex_path) - 1] = '\0'; strappend(regex_path, "[/]*$"); delete_file(uqglob, regex_path); amfree(regex_path); } amfree(regex); amfree(uqglob); } void delete_regex( char * regex) { char *s; char *uqregex = unquote_string(regex); if ((s = validate_regexp(regex)) != NULL) { g_printf(_("\"%s\" is not a valid regular expression: "), regex); puts(s); } else { delete_file(uqregex, uqregex); } amfree(uqregex); } void delete_file( char * path, char * regex) { DIR_ITEM *ditem, lditem; char *path_on_disk = NULL; char *path_on_disk_slash = NULL; char *cmd = NULL; char *err = NULL; int i; ssize_t j; char *date; char *tape, *tape_undo, tape_undo_ch = '\0'; char *dir_undo, dir_undo_ch = '\0'; int level = 0; char *ditem_path = NULL; char *l = NULL; int deleted; char *s; int ch; int found_one; char *quoted; if (disk_path == NULL) { g_printf(_("Must select directory before deleting files\n")); return; } memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */ dbprintf(_("delete_file: Looking for \"%s\"\n"), path); if (strcmp(regex, "[^/]*[/]*$") == 0) { /* Looking for * find everything but single . */ regex = "([^/.]|\\.[^/]+|[^/.][^/]*)[/]*$"; } else { /* remove "/" at end of path */ j = (ssize_t)(strlen(regex) - 1); while(j >= 0 && regex[j] == '/') regex[j--] = '\0'; } /* convert path (assumed in cwd) to one on disk */ if (strcmp(disk_path, "/") == 0) { if (*regex == '/') { if (strcmp(regex, "/[/]*$") == 0) { /* We want "/" to match the directory itself: "/." */ path_on_disk = stralloc("/\\.[/]*$"); } else { /* No mods needed if already starts with '/' */ path_on_disk = stralloc(regex); } } else { /* Prepend '/' */ path_on_disk = stralloc2("/", regex); } } else { char *clean_disk_path = clean_regex(disk_path, 0); path_on_disk = vstralloc(clean_disk_path, "/", regex, NULL); amfree(clean_disk_path); } path_on_disk_slash = stralloc2(path_on_disk, "/"); dbprintf(_("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"), regex, path_on_disk); found_one = 0; for (ditem=get_dir_list(); ditem!=NULL; ditem=get_next_dir_item(ditem)) { quoted = quote_string(ditem->path); dbprintf(_("delete_file: Pondering ditem->path=%s\n"), quoted); amfree(quoted); if (match(path_on_disk, ditem->path) || match(path_on_disk_slash, ditem->path)) { found_one = 1; j = (ssize_t)strlen(ditem->path); if((j > 0 && ditem->path[j-1] == '/') || (j > 1 && ditem->path[j-2] == '/' && ditem->path[j-1] == '.')) { /* It is a directory */ ditem_path = newstralloc(ditem_path, ditem->path); clean_pathname(ditem_path); cmd = newstralloc2(cmd, "ORLD ", ditem_path); if(send_command(cmd) == -1) { amfree(cmd); amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } amfree(cmd); /* skip preamble */ if ((i = get_reply_line()) == -1) { amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } if(i==0) /* assume something wrong */ { amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); l = reply_line(); g_printf("%s\n", l); return; } deleted=0; lditem.path = newstralloc(lditem.path, ditem->path); amfree(cmd); tape_undo = dir_undo = NULL; /* skip the last line -- duplicate of the preamble */ while ((i = get_reply_line()) != 0) { if (i == -1) { amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); exit(1); } if(err) { if(cmd == NULL) { if(tape_undo) *tape_undo = tape_undo_ch; if(dir_undo) *dir_undo = dir_undo_ch; tape_undo = dir_undo = NULL; cmd = stralloc(l); /* save for the error report */ } continue; /* throw the rest of the lines away */ } l=reply_line(); if (!server_happy()) { puts(l); continue; } s = l; if(strncmp_const_skip(l, "201-", s, ch) != 0) { err = _("bad reply: not 201-"); continue; } ch = *s++; skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing date field"); continue; } date = s - 1; skip_non_whitespace(s, ch); *(s - 1) = '\0'; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { err = _("bad reply: cannot parse level field"); continue; } skip_integer(s, ch); skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing tape field"); continue; } tape = s - 1; skip_non_whitespace(s, ch); tape_undo = s - 1; tape_undo_ch = *tape_undo; *tape_undo = '\0'; if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) { long long fileno_ = (long long)0; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%lld", &fileno_) != 1) { err = _("bad reply: cannot parse fileno field"); continue; } skip_integer(s, ch); } skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing directory field"); continue; } skip_non_whitespace(s, ch); dir_undo = s - 1; dir_undo_ch = *dir_undo; *dir_undo = '\0'; lditem.date = newstralloc(lditem.date, date); lditem.level=level; lditem.tape = newstralloc(lditem.tape, tape); switch(delete_extract_item(&lditem)) { case -1: g_printf(_("System error\n")); dbprintf(_("delete_file: (Failed) System error\n")); break; case 0: g_printf(_("Deleted dir %s at date %s\n"), ditem_path, date); dbprintf(_("delete_file: (Successful) Deleted dir %s at date %s\n"), ditem_path, date); deleted=1; break; case 1: break; } } if(!server_happy()) { puts(reply_line()); } else if(err) { if (*err) puts(err); if (cmd) puts(cmd); } else if(deleted == 0) { g_printf(_("Warning - dir '%s' not on tape list\n"), ditem_path); dbprintf(_("delete_file: dir '%s' not on tape list\n"), ditem_path); } } else { switch(delete_extract_item(ditem)) { case -1: g_printf(_("System error\n")); dbprintf(_("delete_file: (Failed) System error\n")); break; case 0: g_printf(_("Deleted %s\n"), ditem->path); dbprintf(_("delete_file: (Successful) Deleted %s\n"), ditem->path); break; case 1: g_printf(_("Warning - file '%s' not on tape list\n"), ditem->path); dbprintf(_("delete_file: file '%s' not on tape list\n"), ditem->path); break; } } } } amfree(cmd); amfree(ditem_path); amfree(path_on_disk); amfree(path_on_disk_slash); if(! found_one) { g_printf(_("File %s doesn't exist in directory\n"), path); dbprintf(_("delete_file: (Failed) File %s doesn't exist in directory\n"), path); } } /* print extract list into file. If NULL ptr passed print to screen */ void display_extract_list( char * file) { EXTRACT_LIST *this; EXTRACT_LIST_ITEM *that; FILE *fp; char *pager; char *pager_command; char *uqfile; if (file == NULL) { if ((pager = getenv("PAGER")) == NULL) { pager = "more"; } /* * Set up the pager command so if the pager is terminated, we do * not get a SIGPIPE back. */ pager_command = stralloc2(pager, " ; /bin/cat > /dev/null"); if ((fp = popen(pager_command, "w")) == NULL) { g_printf(_("Warning - can't pipe through %s\n"), pager); fp = stdout; } amfree(pager_command); } else { uqfile = unquote_string(file); if ((fp = fopen(uqfile, "w")) == NULL) { g_printf(_("Can't open file %s to print extract list into\n"), file); amfree(uqfile); return; } amfree(uqfile); } for (this = extract_list; this != NULL; this = this->next) { g_fprintf(fp, _("TAPE %s LEVEL %d DATE %s\n"), this->tape, this->level, this->date); for (that = this->files; that != NULL; that = that->next) g_fprintf(fp, "\t%s\n", that->path); } if (file == NULL) { apclose(fp); } else { g_printf(_("Extract list written to file %s\n"), file); afclose(fp); } } /* returns 0 if extract list empty and 1 if it isn't */ int is_extract_list_nonempty(void) { return (extract_list != NULL); } /* prints continue prompt and waits for response, returns 0 if don't, non-0 if do */ static int okay_to_continue( int allow_tape, int allow_skip, int allow_retry) { int ch; int ret = -1; char *line = NULL; char *s; char *prompt; int get_tape; get_tape = 0; while (ret < 0) { if (get_tape) { prompt = _("New tape device [?]: "); } else if (allow_tape && allow_skip) { prompt = _("Continue [?/Y/n/s/t]? "); } else if (allow_tape && !allow_skip) { prompt = _("Continue [?/Y/n/t]? "); } else if (allow_retry) { prompt = _("Continue [?/Y/n/r]? "); } else { prompt = _("Continue [?/Y/n]? "); } fputs(prompt, stdout); fflush(stdout); fflush(stderr); amfree(line); if ((line = agets(stdin)) == NULL) { putchar('\n'); clearerr(stdin); if (get_tape) { get_tape = 0; continue; } ret = 0; break; } s = line; while ((ch = *s++) != '\0' && g_ascii_isspace(ch)) { (void)ch; /* Quiet empty loop body warning */ } if (ch == '?') { if (get_tape) { g_printf(_("Enter a new device ([host:]device) or \"default\"\n")); } else { g_printf(_("Enter \"y\"es to continue, \"n\"o to stop")); if(allow_skip) { g_printf(_(", \"s\"kip this tape")); } if(allow_retry) { g_printf(_(" or \"r\"etry this tape")); } if (allow_tape) { g_printf(_(" or \"t\"ape to change tape drives")); } putchar('\n'); } } else if (get_tape) { set_tape(s - 1); get_tape = 0; } else if (ch == '\0' || ch == 'Y' || ch == 'y') { ret = 1; } else if (allow_tape && (ch == 'T' || ch == 't')) { get_tape = 1; } else if (ch == 'N' || ch == 'n') { ret = 0; } else if (allow_retry && (ch == 'R' || ch == 'r')) { ret = RETRY_TAPE; } else if (allow_skip && (ch == 'S' || ch == 's')) { ret = SKIP_TAPE; } } /*@ignore@*/ amfree(line); /*@end@*/ return ret; } static void send_to_tape_server( int tss, char * cmd) { char *msg = stralloc2(cmd, "\r\n"); if (full_write(tss, msg, strlen(msg)) < strlen(msg)) { error(_("Error writing to tape server: %s"), strerror(errno)); /*NOTREACHED*/ } amfree(msg); } /* start up connection to tape server and set commands to initiate transfer of dump image. Return tape server socket on success, -1 on error. */ static int extract_files_setup( char * label, off_t fsf) { struct servent *sp; in_port_t my_port, my_data_port; char *disk_regex = NULL; char *host_regex = NULL; char *service_name = NULL; char *line = NULL; char *clean_datestamp, *ch, *ch1; char *our_feature_string = NULL; char *tt = NULL; service_name = stralloc2("amidxtape", SERVICE_SUFFIX); /* get tape server details */ if ((sp = getservbyname(service_name, "tcp")) == NULL) { g_printf(_("%s/tcp unknown protocol - config error?\n"), service_name); amfree(service_name); return -1; } amfree(service_name); if (seteuid(0) != 0) { error("Can't set euid"); }; /* it either works ... */ if (setegid(0) != 0) { error("Can't set egid"); }; tape_control_sock = stream_client_privileged(tape_server_name, (in_port_t)ntohs((in_port_t)sp->s_port), 0, STREAM_BUFSIZE, &my_port, 0); if (tape_control_sock < 0) { g_printf(_("cannot connect to %s: %s\n"), tape_server_name, strerror(errno)); return -1; } if (my_port >= IPPORT_RESERVED) { aclose(tape_control_sock); g_printf(_("did not get a reserved port: %u\n"), (unsigned)my_port); return -1; } if (setegid(getgid()) != 0) { error("Can't set gid"); }; if (seteuid(getuid()) != 0) { error("Can't set uid"); }; /* put it back */ /* do the security thing */ line = get_security(); send_to_tape_server(tape_control_sock, line); memset(line, '\0', strlen(line)); amfree(line); disk_regex = alloc(strlen(disk_name) * 2 + 3); ch = disk_name; ch1 = disk_regex; /* we want to force amrestore to only match disk_name exactly */ *(ch1++) = '^'; /* We need to escape some characters first... NT compatibilty crap */ for (; *ch != 0; ch++, ch1++) { switch (*ch) { /* done this way in case there are more */ case '$': *(ch1++) = '\\'; /* no break; we do want to fall through... */ default: *ch1 = *ch; } } /* we want to force amrestore to only match disk_name exactly */ *(ch1++) = '$'; *ch1 = '\0'; host_regex = alloc(strlen(dump_hostname) * 2 + 3); ch = dump_hostname; ch1 = host_regex; /* we want to force amrestore to only match dump_hostname exactly */ *(ch1++) = '^'; /* We need to escape some characters first... NT compatibilty crap */ for (; *ch != 0; ch++, ch1++) { switch (*ch) { /* done this way in case there are more */ case '$': *(ch1++) = '\\'; /* no break; we do want to fall through... */ default: *ch1 = *ch; } } /* we want to force amrestore to only match dump_hostname exactly */ *(ch1++) = '$'; *ch1 = '\0'; clean_datestamp = stralloc(dump_datestamp); for(ch=ch1=clean_datestamp;*ch1 != '\0';ch1++) { if(*ch1 != '-') { *ch = *ch1; ch++; } } *ch = '\0'; /* push our feature list off to the tape server */ /* XXX assumes that index server and tape server are equivalent, ew */ if(am_has_feature(indexsrv_features, fe_amidxtaped_exchange_features)){ char buffer[32768] = "\0"; our_feature_string = am_feature_to_string(our_features); tt = newstralloc2(tt, "FEATURES=", our_feature_string); send_to_tape_server(tape_control_sock, tt); if (read(tape_control_sock, buffer, sizeof(buffer)) <= 0) { error(_("Could not read features from control socket\n")); /*NOTREACHED*/ } tapesrv_features = am_string_to_feature(buffer); amfree(our_feature_string); } if(am_has_feature(indexsrv_features, fe_amidxtaped_header) && am_has_feature(indexsrv_features, fe_amidxtaped_device) && am_has_feature(indexsrv_features, fe_amidxtaped_host) && am_has_feature(indexsrv_features, fe_amidxtaped_disk) && am_has_feature(indexsrv_features, fe_amidxtaped_datestamp)) { if(am_has_feature(indexsrv_features, fe_amidxtaped_config)) { tt = newstralloc2(tt, "CONFIG=", config); send_to_tape_server(tape_control_sock, tt); } if(am_has_feature(indexsrv_features, fe_amidxtaped_label) && label && label[0] != '/') { tt = newstralloc2(tt,"LABEL=",label); send_to_tape_server(tape_control_sock, tt); } if(am_has_feature(indexsrv_features, fe_amidxtaped_fsf)) { char v_fsf[100]; g_snprintf(v_fsf, 99, "%lld", (long long)fsf); tt = newstralloc2(tt, "FSF=",v_fsf); send_to_tape_server(tape_control_sock, tt); } send_to_tape_server(tape_control_sock, "HEADER"); tt = newstralloc2(tt, "DEVICE=", dump_device_name); send_to_tape_server(tape_control_sock, tt); tt = newstralloc2(tt, "HOST=", host_regex); send_to_tape_server(tape_control_sock, tt); tt = newstralloc2(tt, "DISK=", disk_regex); send_to_tape_server(tape_control_sock, tt); tt = newstralloc2(tt, "DATESTAMP=", clean_datestamp); send_to_tape_server(tape_control_sock, tt); send_to_tape_server(tape_control_sock, "END"); amfree(tt); } else if(am_has_feature(indexsrv_features, fe_amidxtaped_nargs)) { /* send to the tape server what tape file we want */ /* 6 args: * "-h" * "-p" * "tape device" * "hostname" * "diskname" * "datestamp" */ send_to_tape_server(tape_control_sock, "6"); send_to_tape_server(tape_control_sock, "-h"); send_to_tape_server(tape_control_sock, "-p"); send_to_tape_server(tape_control_sock, dump_device_name); send_to_tape_server(tape_control_sock, host_regex); send_to_tape_server(tape_control_sock, disk_regex); send_to_tape_server(tape_control_sock, clean_datestamp); dbprintf(_("Started amidxtaped with arguments \"6 -h -p %s %s %s %s\"\n"), dump_device_name, host_regex, disk_regex, clean_datestamp); } /* * split-restoring amidxtaped versions will expect to set up a data * connection for dumpfile data, distinct from the socket we're already * using for control data */ if(am_has_feature(tapesrv_features, fe_recover_splits)){ char buffer[32768]; in_port_t data_port = (in_port_t)-1; ssize_t nread; nread = read(tape_control_sock, buffer, sizeof(buffer)); if (nread <= 0) { error(_("Could not read from control socket: %s\n"), strerror(errno)); /*NOTREACHED*/ } buffer[nread] = '\0'; if (sscanf(buffer, "CONNECT %hu\n", (unsigned short *)&data_port) != 1) { error(_("Received invalid port number message from control socket: %s\n"), buffer); /*NOTREACHED*/ } tape_data_sock = stream_client_privileged(server_name, data_port, 0, STREAM_BUFSIZE, &my_data_port, 0); if(tape_data_sock == -1){ error(_("Unable to make data connection to server: %s\n"), strerror(errno)); /*NOTREACHED*/ } amfree(our_feature_string); line = get_security(); send_to_tape_server(tape_data_sock, line); memset(line, '\0', strlen(line)); amfree(line); } amfree(disk_regex); amfree(host_regex); amfree(clean_datestamp); return tape_control_sock; } /* * Reads the first block of a tape file. */ void read_file_header( char * buffer, dumpfile_t *file, size_t buflen, int tapedev) { ssize_t bytes_read; bytes_read = read_buffer(tapedev, buffer, buflen, READ_TIMEOUT); if(bytes_read < 0) { error(_("error reading header (%s), check amidxtaped.*.debug on server"), strerror(errno)); /*NOTREACHED*/ } if((size_t)bytes_read < buflen) { g_fprintf(stderr, plural(_("%s: short block %d byte\n"), _("%s: short block %d bytes\n"), bytes_read), get_pname(), (int)bytes_read); print_header(stdout, file); error(_("Can't read file header")); /*NOTREACHED*/ } /* bytes_read == buflen */ parse_file_header(buffer, file, (size_t)bytes_read); } enum dumptypes { IS_UNKNOWN, IS_DUMP, IS_GNUTAR, IS_TAR, IS_SAMBA, IS_SAMBA_TAR }; static void extract_files_child( int in_fd, EXTRACT_LIST * elist) { int save_errno; int i; guint j; GPtrArray *argv_ptr = g_ptr_array_new(); int files_off_tape; EXTRACT_LIST_ITEM *fn; enum dumptypes dumptype = IS_UNKNOWN; char buffer[DISK_BLOCK_BYTES]; dumpfile_t file; size_t len_program; char *cmd = NULL; guint passwd_field = 999999999; #ifdef SAMBA_CLIENT char *domain = NULL, *smbpass = NULL; #endif /* code executed by child to do extraction */ /* never returns */ /* make in_fd be our stdin */ if (dup2(in_fd, STDIN_FILENO) == -1) { error(_("dup2 failed in extract_files_child: %s"), strerror(errno)); /*NOTREACHED*/ } /* read the file header */ fh_init(&file); read_file_header(buffer, &file, sizeof(buffer), STDIN_FILENO); if(file.type != F_DUMPFILE) { print_header(stdout, &file); error(_("bad header")); /*NOTREACHED*/ } if (file.program != NULL) { #ifdef GNUTAR if (strcmp(file.program, GNUTAR) == 0) dumptype = IS_GNUTAR; #endif if (dumptype == IS_UNKNOWN) { len_program = strlen(file.program); if(len_program >= 3 && strcmp(&file.program[len_program-3],"tar") == 0) dumptype = IS_TAR; } #ifdef SAMBA_CLIENT if (dumptype == IS_UNKNOWN && strcmp(file.program, SAMBA_CLIENT) ==0) { if (samba_extract_method == SAMBA_TAR) dumptype = IS_SAMBA_TAR; else dumptype = IS_SAMBA; } #endif } /* form the arguments to restore */ files_off_tape = length_of_tape_list(elist); switch(dumptype) { case IS_SAMBA: #ifdef SAMBA_CLIENT g_ptr_array_add(argv_ptr, stralloc("smbclient")); smbpass = findpass(file.disk, &domain); if (smbpass) { g_ptr_array_add(argv_ptr, stralloc(file.disk)); g_ptr_array_add(argv_ptr, stralloc("-U")); passwd_field = argv_ptr->len; g_ptr_array_add(argv_ptr, stralloc(smbpass)); if (domain) { g_ptr_array_add(argv_ptr, stralloc("-W")); g_ptr_array_add(argv_ptr, stralloc(domain)); } } g_ptr_array_add(argv_ptr, stralloc("-d0")); g_ptr_array_add(argv_ptr, stralloc("-Tx")); g_ptr_array_add(argv_ptr, stralloc("-")); /* data on stdin */ break; #endif case IS_TAR: case IS_GNUTAR: g_ptr_array_add(argv_ptr, stralloc("tar")); g_ptr_array_add(argv_ptr, stralloc("--numeric-owner")); g_ptr_array_add(argv_ptr, stralloc("-xpGvf")); g_ptr_array_add(argv_ptr, stralloc("-")); /* data on stdin */ break; case IS_SAMBA_TAR: g_ptr_array_add(argv_ptr, stralloc("tar")); g_ptr_array_add(argv_ptr, stralloc("-xpvf")); g_ptr_array_add(argv_ptr, stralloc("-")); /* data on stdin */ break; case IS_UNKNOWN: case IS_DUMP: g_ptr_array_add(argv_ptr, stralloc("restore")); #ifdef AIX_BACKUP g_ptr_array_add(argv_ptr, stralloc("-xB")); #else #if defined(XFSDUMP) if (strcmp(file.program, XFSDUMP) == 0) { g_ptr_array_add(argv_ptr, stralloc("-v")); g_ptr_array_add(argv_ptr, stralloc("silent")); } else #endif #if defined(VDUMP) if (strcmp(file.program, VDUMP) == 0) { g_ptr_array_add(argv_ptr, stralloc("xf")); g_ptr_array_add(argv_ptr, stralloc("-")); /* data on stdin */ } else #endif { g_ptr_array_add(argv_ptr, stralloc("xbf")); g_ptr_array_add(argv_ptr, stralloc("2")); /* read in units of 1K */ g_ptr_array_add(argv_ptr, stralloc("-")); /* data on stdin */ } #endif } for (i = 0, fn = elist->files; i < files_off_tape; i++, fn = fn->next) { switch (dumptype) { case IS_TAR: case IS_GNUTAR: case IS_SAMBA_TAR: case IS_SAMBA: if (strcmp(fn->path, "/") == 0) g_ptr_array_add(argv_ptr, stralloc(".")); else g_ptr_array_add(argv_ptr, stralloc2(".", fn->path)); break; case IS_UNKNOWN: case IS_DUMP: #if defined(XFSDUMP) if (strcmp(file.program, XFSDUMP) == 0) { /* * xfsrestore needs a -s option before each file to be * restored, and also wants them to be relative paths. */ g_ptr_array_add(argv_ptr, stralloc("-s")); g_ptr_array_add(argv_ptr, stralloc(fn->path + 1)); } else #endif { g_ptr_array_add(argv_ptr, stralloc(fn->path)); } } } #if defined(XFSDUMP) if (strcmp(file.program, XFSDUMP) == 0) { g_ptr_array_add(argv_ptr, stralloc("-")); g_ptr_array_add(argv_ptr, stralloc(".")); } #endif g_ptr_array_add(argv_ptr, NULL); switch (dumptype) { case IS_SAMBA: #ifdef SAMBA_CLIENT cmd = stralloc(SAMBA_CLIENT); break; #else /* fall through to ... */ #endif case IS_TAR: case IS_GNUTAR: case IS_SAMBA_TAR: #ifndef GNUTAR g_fprintf(stderr, _("warning: GNUTAR program not available.\n")); cmd = stralloc("tar"); #else cmd = stralloc(GNUTAR); #endif break; case IS_UNKNOWN: case IS_DUMP: cmd = NULL; #if defined(DUMP) if (strcmp(file.program, DUMP) == 0) { cmd = stralloc(RESTORE); } #endif #if defined(VDUMP) if (strcmp(file.program, VDUMP) == 0) { cmd = stralloc(VRESTORE); } #endif #if defined(VXDUMP) if (strcmp(file.program, VXDUMP) == 0) { cmd = stralloc(VXRESTORE); } #endif #if defined(XFSDUMP) if (strcmp(file.program, XFSDUMP) == 0) { cmd = stralloc(XFSRESTORE); } #endif if (cmd == NULL) { g_fprintf(stderr, _("warning: restore program for %s not available.\n"), file.program); cmd = stralloc("restore"); } } if (cmd) { dbprintf(_("Exec'ing %s with arguments:\n"), cmd); for (j = 0; j < argv_ptr->len - 1; j++) { if( j == passwd_field) dbprintf("\tXXXXX\n"); else dbprintf("\t%s\n", (char *)g_ptr_array_index(argv_ptr, j)); } safe_fd(-1, 0); (void)execv(cmd, (char **)argv_ptr->pdata); /* only get here if exec failed */ save_errno = errno; g_ptr_array_free_full(argv_ptr); errno = save_errno; perror(_("amrecover couldn't exec")); g_fprintf(stderr, _(" problem executing %s\n"), cmd); amfree(cmd); } exit(1); /*NOT REACHED */ } /* * Interpose something between the process writing out the dump (writing it to * some extraction program, really) and the socket from which we're reading, so * that we can do things like prompt for human interaction for multiple tapes. */ void writer_intermediary( int ctl_fd, int data_fd, EXTRACT_LIST * elist) { int child_pipe[2]; pid_t pid; char buffer[DISK_BLOCK_BYTES]; size_t bytes_read; amwait_t extractor_status; int max_fd, nfound; SELECT_ARG_TYPE readset, selectset; struct timeval timeout; /* * If there's no distinct data channel (such as if we're talking to an * older server), don't bother doing anything complicated. Just run the * extraction. */ if(data_fd == -1){ extract_files_child(ctl_fd, elist); /*NOTREACHED*/ } if(pipe(child_pipe) == -1) { error(_("extract_list - error setting up pipe to extractor: %s\n"), strerror(errno)); /*NOTREACHED*/ } /* okay, ready to extract. fork a child to do the actual work */ if ((pid = fork()) == 0) { /* this is the child process */ /* never gets out of this clause */ aclose(child_pipe[1]); extract_files_child(child_pipe[0], elist); /*NOTREACHED*/ } /* This is the parent */ if (pid == -1) { error(_("writer_intermediary - error forking child")); /*NOTREACHED*/ } aclose(child_pipe[0]); if(data_fd > ctl_fd) max_fd = data_fd+1; else max_fd = ctl_fd+1; FD_ZERO(&readset); FD_SET(data_fd, &readset); FD_SET(ctl_fd, &readset); do { timeout.tv_sec = READ_TIMEOUT; timeout.tv_usec = 0; FD_COPY(&readset, &selectset); nfound = select(max_fd, &selectset, NULL, NULL, &timeout); if(nfound < 0) { g_fprintf(stderr,_("select error: %s\n"), strerror(errno)); break; } if (nfound == 0) { /* timeout */ g_fprintf(stderr, _("timeout waiting %d seconds for restore\n"), READ_TIMEOUT); g_fprintf(stderr, _("increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n")); break; } if(FD_ISSET(ctl_fd, &selectset)) { bytes_read = read(ctl_fd, buffer, sizeof(buffer)-1); switch(bytes_read) { case -1: if ((errno != EINTR) && (errno != EAGAIN)) { if (errno != EPIPE) { g_fprintf(stderr,_("writer ctl fd read error: %s"), strerror(errno)); } FD_CLR(ctl_fd, &readset); } break; case 0: FD_CLR(ctl_fd, &readset); break; default: { char desired_tape[MAX_TAPE_LABEL_BUF]; buffer[bytes_read] = '\0'; /* if prompted for a tape, relay said prompt to the user */ if(sscanf(buffer, "FEEDME %132s\n", desired_tape) == 1) { int done = 0; while (!done) { char *input = NULL; g_printf(_("Please insert tape %s. Continue? [Y|n]: "), desired_tape); fflush(stdout); input = agets(stdin); /* strips \n */ if (strcasecmp("", input) == 0|| strcasecmp("y", input) == 0|| strcasecmp("yes", input) == 0) { send_to_tape_server(tape_control_sock, "OK"); done = 1; } else if (strcasecmp("n", input) == 0|| strcasecmp("no", input) == 0) { send_to_tape_server(tape_control_sock, "ERROR"); /* Abort! We are the middle process, so just die. */ exit(EXIT_FAILURE); } amfree(input); } } else { g_fprintf(stderr, _("Strange message from tape server: %s"), buffer); break; } } } } /* now read some dump data */ if(FD_ISSET(data_fd, &selectset)) { bytes_read = read(data_fd, buffer, sizeof(buffer)-1); switch(bytes_read) { case -1: if ((errno != EINTR) && (errno != EAGAIN)) { if (errno != EPIPE) { g_fprintf(stderr,_("writer data fd read error: %s"), strerror(errno)); } FD_CLR(data_fd, &readset); } break; case 0: FD_CLR(data_fd, &readset); break; default: /* * spit what we got from the server to the child * process handling actual dumpfile extraction */ if(full_write(child_pipe[1], buffer, bytes_read) < bytes_read) { if(errno == EPIPE) { error(_("pipe data reader has quit: %s\n"), strerror(errno)); /* NOTREACHED */ } error(_("Write error to extract child: %s\n"), strerror(errno)); /* NOTREACHED */ } break; } } } while(FD_ISSET(ctl_fd, &readset) || FD_ISSET(data_fd, &readset)); aclose(child_pipe[1]); waitpid(pid, &extractor_status, 0); if(WEXITSTATUS(extractor_status) != 0){ int ret = WEXITSTATUS(extractor_status); if(ret == 255) ret = -1; error(_("Extractor child exited with status %d\n"), ret); /*NOTREACHED*/ } exit(0); } /* exec restore to do the actual restoration */ /* does the actual extraction of files */ /* * The original design had the dump image being returned exactly as it * appears on the tape, and this routine getting from the index server * whether or not it is compressed, on the assumption that the tape * server may not know how to uncompress it. But * - Amrestore can't do that. It returns either compressed or uncompressed * (always). Amrestore assumes it can uncompress files. It is thus a good * idea to run the tape server on a machine with gzip. * - The information about compression in the disklist is really only * for future dumps. It is possible to change compression on a drive * so the information in the disklist may not necessarily relate to * the dump image on the tape. * Consequently the design was changed to assuming that amrestore can * uncompress any dump image and have it return an uncompressed file * always. */ void extract_files(void) { EXTRACT_LIST *elist; pid_t pid; amwait_t child_stat; char buf[STR_SIZE]; char *l; int first; int otc; tapelist_t *tlist = NULL; if (!is_extract_list_nonempty()) { g_printf(_("Extract list empty - No files to extract!\n")); return; } clean_extract_list(); /* get tape device name from index server if none specified */ if (tape_server_name == NULL) { tape_server_name = newstralloc(tape_server_name, server_name); } if (tape_device_name == NULL) { if (send_command("TAPE") == -1) exit(1); if (get_reply_line() == -1) exit(1); l = reply_line(); if (!server_happy()) { g_printf("%s\n", l); exit(1); } /* skip reply number */ tape_device_name = newstralloc(tape_device_name, l+4); } if (strcmp(tape_device_name, "/dev/null") == 0) { g_printf(_("amrecover: warning: using %s as the tape device will not work\n"), tape_device_name); } first=1; for (elist = first_tape_list(); elist != NULL; elist = next_tape_list(elist)) if(elist->tape[0]!='/') { if(first) { g_printf(_("\nExtracting files using tape drive %s on host %s.\n"), tape_device_name, tape_server_name); g_printf(_("The following tapes are needed:")); first=0; } else g_printf(" "); tlist = unmarshal_tapelist_str(elist->tape); for( ; tlist != NULL; tlist = tlist->next) g_printf(" %s", tlist->label); g_printf("\n"); amfree(tlist); } first=1; for (elist = first_tape_list(); elist != NULL; elist = next_tape_list(elist)) { if(elist->tape[0]=='/') { if(first) { g_printf(_("\nExtracting files from holding disk on host %s.\n"), tape_server_name); g_printf(_("The following files are needed:")); first=0; } else g_printf(" "); tlist = unmarshal_tapelist_str(elist->tape); for( ; tlist != NULL; tlist = tlist->next) g_printf(" %s", tlist->label); g_printf("\n"); amfree(tlist); } } g_printf("\n"); if (getcwd(buf, sizeof(buf)) == NULL) { perror(_("extract_list: Cannot determine current working directory")); exit(1); } g_printf(_("Restoring files into directory %s\n"), buf); #ifdef SAMBA_CLIENT if (samba_extract_method == SAMBA_SMBCLIENT) g_printf(_("(unless it is a Samba backup, that will go through to the SMB server)\n")); #endif if (!okay_to_continue(0,0,0)) return; g_printf("\n"); while ((elist = first_tape_list()) != NULL) { if(elist->tape[0]=='/') { dump_device_name = newstralloc(dump_device_name, elist->tape); g_printf(_("Extracting from file ")); tlist = unmarshal_tapelist_str(dump_device_name); for( ; tlist != NULL; tlist = tlist->next) g_printf(" %s", tlist->label); g_printf("\n"); amfree(tlist); } else { g_printf(_("Extracting files using tape drive %s on host %s.\n"), tape_device_name, tape_server_name); tlist = unmarshal_tapelist_str(elist->tape); g_printf(_("Load tape %s now\n"), tlist->label); amfree(tlist); otc = okay_to_continue(1,1,0); if (otc == 0) return; else if (otc == SKIP_TAPE) { delete_tape_list(elist); /* skip this tape */ continue; } dump_device_name = newstralloc(dump_device_name, tape_device_name); } dump_datestamp = newstralloc(dump_datestamp, elist->date); /* connect to the tape handler daemon on the tape drive server */ if ((tape_control_sock = extract_files_setup(elist->tape, elist->fileno)) == -1) { g_fprintf(stderr, _("amrecover - can't talk to tape server\n")); return; } /* okay, ready to extract. fork a child to do the actual work */ if ((pid = fork()) == 0) { /* this is the child process */ /* never gets out of this clause */ writer_intermediary(tape_control_sock, tape_data_sock, elist); /*NOT REACHED*/ } /* this is the parent */ if (pid == -1) { perror(_("extract_list - error forking child")); aclose(tape_control_sock); exit(1); } /* store the child pid globally so that it can be killed on intr */ extract_restore_child_pid = pid; /* wait for the child process to finish */ if ((pid = waitpid(-1, &child_stat, 0)) == (pid_t)-1) { perror(_("extract_list - error waiting for child")); exit(1); } if(tape_data_sock != -1) { aclose(tape_data_sock); } if (pid == extract_restore_child_pid) { extract_restore_child_pid = -1; } else { g_fprintf(stderr, _("extract list - unknown child terminated?\n")); exit(1); } if ((WIFEXITED(child_stat) != 0) && (WEXITSTATUS(child_stat) != 0)) { g_fprintf(stderr, _("extract_list - child returned non-zero status: %d\n"), WEXITSTATUS(child_stat)); otc = okay_to_continue(0,0,1); if(otc == 0) return; if(otc == 1) { delete_tape_list(elist); /* tape failed so delete from list */ } } else { delete_tape_list(elist); /* tape done so delete from list */ } } } amanda-3.3.6/oldrecover-src/display_commands.c0000664000076400007640000001661612357250001023070 0ustar00martineamartinea00000000000000/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: display_commands.c,v 1.3 2006/07/05 19:42:17 martinea Exp $ * * implements the directory-display related commands in amrecover */ #include "amanda.h" #include "amrecover.h" #include "util.h" DIR_ITEM *get_dir_list(void); DIR_ITEM *get_next_dir_item(DIR_ITEM *this); void clear_dir_list(void); void free_dir_item(DIR_ITEM *item); static int add_dir_list_item(char *date, int level, char *tape, off_t fileno, char *path); void list_disk_history(void); void suck_dir_list_from_server(void); void list_directory(void); static DIR_ITEM *dir_list = NULL; DIR_ITEM * get_dir_list(void) { return dir_list; } DIR_ITEM * get_next_dir_item( /*@keep@*/ DIR_ITEM * this) { return this->next; } void clear_dir_list(void) { free_dir_item(dir_list); /* Frees all items from dir_list to end of list */ dir_list = NULL; } void free_dir_item( DIR_ITEM * item) { DIR_ITEM *next; while (item != NULL) { next = item->next; amfree(item->date); amfree(item->tape); amfree(item->path); amfree(item); item = next; } } /* add item to list if path not already on list */ static int add_dir_list_item( char * date, int level, char * tape, off_t fileno, char * path) { DIR_ITEM *next; dbprintf(_("add_dir_list_item: Adding \"%s\" \"%d\" \"%s\" \"%lld\" \"%s\"\n"), date, level, tape, (long long)fileno, path); next = (DIR_ITEM *)alloc(sizeof(DIR_ITEM)); memset(next, 0, sizeof(DIR_ITEM)); next->date = stralloc(date); next->level = level; next->tape = stralloc(tape); next->fileno = fileno; next->path = stralloc(path); next->next = dir_list; dir_list = next; return 0; } void list_disk_history(void) { if (converse("DHST") == -1) exit(1); } void suck_dir_list_from_server(void) { char *cmd = NULL; char *err = NULL; int i; char *l = NULL; char *date; int level = 0; off_t fileno = (off_t)-1; char *tape, *tape_undo, tape_undo_ch = '\0'; char *dir, *qdir; char *disk_path_slash = NULL; char *disk_path_slash_dot = NULL; char *s; int ch; if (disk_path == NULL) { g_printf(_("Directory must be set before getting listing\n")); return; } else if(strcmp(disk_path, "/") == 0) { disk_path_slash = stralloc(disk_path); } else { disk_path_slash = stralloc2(disk_path, "/"); } clear_dir_list(); cmd = stralloc2("OLSD ", disk_path); if (send_command(cmd) == -1) { amfree(cmd); amfree(disk_path_slash); exit(1); } amfree(cmd); /* skip preamble */ if ((i = get_reply_line()) == -1) { amfree(disk_path_slash); exit(1); } if (i == 0) /* assume something wrong! */ { amfree(disk_path_slash); l = reply_line(); g_printf("%s\n", l); return; } disk_path_slash_dot = stralloc2(disk_path_slash, "."); amfree(cmd); amfree(err); tape_undo = NULL; /* skip the last line -- duplicate of the preamble */ while ((i = get_reply_line()) != 0) { if (i == -1) { amfree(disk_path_slash_dot); amfree(disk_path_slash); exit(1); } if(err) { if(cmd == NULL) { if(tape_undo) *tape_undo = tape_undo_ch; tape_undo = NULL; cmd = stralloc(l); /* save for the error report */ } continue; /* throw the rest of the lines away */ } l = reply_line(); if (!server_happy()) { g_printf("%s\n", l); continue; } s = l; if (strncmp_const_skip(s, "201-", s, ch) != 0) { err = "bad reply: not 201-"; continue; } ch = *s++; skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing date field"); continue; } date = s - 1; skip_non_whitespace(s, ch); *(s - 1) = '\0'; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { err = _("bad reply: cannot parse level field"); continue; } skip_integer(s, ch); skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing tape field"); continue; } tape = s - 1; skip_non_whitespace(s, ch); tape_undo = s - 1; tape_undo_ch = *tape_undo; *tape_undo = '\0'; if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) { long long fileno_ = (long long)0; skip_whitespace(s, ch); if(ch == '\0' || sscanf(s - 1, "%lld", &fileno_) != 1) { err = _("bad reply: cannot parse fileno field"); continue; } fileno = (off_t)fileno_; skip_integer(s, ch); } else { fileno = (off_t)-1; } skip_whitespace(s, ch); if(ch == '\0') { err = _("bad reply: missing directory field"); continue; } qdir = s - 1; dir = unquote_string(qdir); /* add a '.' if it a the entry for the current directory */ if((strcmp(disk_path,dir)==0) || (strcmp(disk_path_slash,dir)==0)) { amfree(dir); dir = stralloc(disk_path_slash_dot); } add_dir_list_item(date, level, tape, fileno, dir); amfree(dir); } amfree(disk_path_slash_dot); amfree(disk_path_slash); if(!server_happy()) { puts(reply_line()); } else if(err) { if(*err) { puts(err); } if (cmd) puts(cmd); clear_dir_list(); } amfree(cmd); } void list_directory(void) { size_t i; DIR_ITEM *item; FILE *fp; char *pager; char *pager_command; char *quoted; if (disk_path == NULL) { g_printf(_("Must select a disk before listing files; use the setdisk command.\n")); return; } if ((pager = getenv("PAGER")) == NULL) { pager = "more"; } /* * Set up the pager command so if the pager is terminated, we do * not get a SIGPIPE back. */ pager_command = stralloc2(pager, " ; /bin/cat > /dev/null"); if ((fp = popen(pager_command, "w")) == NULL) { g_printf(_("Warning - can't pipe through %s\n"), pager); fp = stdout; } amfree(pager_command); i = strlen(disk_path); if (i != 1) i++; /* so disk_path != "/" */ for (item = get_dir_list(); item != NULL; item=get_next_dir_item(item)) { quoted = quote_string(item->path + i); g_fprintf(fp, "%s %s\n", item->date, quoted); amfree(quoted); } apclose(fp); } amanda-3.3.6/example/0000775000076400007640000000000012357750430016101 5ustar00martineamartinea00000000000000amanda-3.3.6/example/chg-scsi.conf0000664000076400007640000000224512357250001020440 0ustar00martineamartinea00000000000000 number_configs 2 eject 1 # Tapedrives need an eject command sleep 5 # Seconds to wait until the tape gets ready cleanmax 10 # How many times could a cleaning tape get used changerdev /dev/sch0 # # Next comes the data for drive 0 # config 0 drivenum 0 dev /dev/tape0 # the device that is used for the tapedrive 0 startuse 0 # The slots associated with the drive 0 enduse 9 # statfile /usr/local/etc/amanda/tape5-slot # The file where the actual slot is stored cleancart 20 # the slot where the cleaningcartridge for drive 0 is located cleanfile /usr/local/etc/amanda/tape0-clean # The file where the cleanings are recorded usagecount /usr/local/etc/amanda/backup/totaltime # Next comes the data for drive 1 config 1 drivenum 1 dev /dev/tape1 # the device that is used for the tapedrive 0 startuse 10 # The slots associated with the drive 0 enduse 19 # statfile /usr/local/etc/amanda/tape1-slot # The file where the actual slot is stored cleancart 21 # the slot where the cleaningcartridge for drive 0 is located cleanfile /usr/local/etc/amanda/tape1-clean # The file where the cleanings are recorded usagecount /usr/local/etc/amanda/backup1/totaltime # # This is the end amanda-3.3.6/example/amandaserver.xml.in0000664000076400007640000000456412357250001021676 0ustar00martineamartinea00000000000000 amanda-3.3.6/example/Makefile.in0000664000076400007640000017261612357750240020162 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for sample configuration files # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = example ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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)$(client_exampledir)" \ "$(DESTDIR)$(lbltempldir)" "$(DESTDIR)$(server_exampledir)" \ "$(DESTDIR)$(templatedir)" DATA = $(client_example_DATA) $(lbltempl_DATA) $(server_example_DATA) \ $(template_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = $(template_FILE) $(template_in_FILE) \ $(server_example_FILE) $(server_example_in_FILE) \ $(client_example_FILE) $(client_example_in_FILE) \ $(lbltempl_DATA) BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log DISTCLEANFILES = $(am__append_1) $(template_generated_FILE) \ $(server_example_generated_FILE) \ $(client_example_generated_FILE) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done amanda_dir = $(amdatadir) templatedir = $(amanda_dir)/template.d server_exampledir = $(amanda_dir)/example client_exampledir = $(amanda_dir)/example lbltempldir = $(amanda_dir)/example/label-templates template_in_FILE = \ template.d/advanced.conf.in \ template.d/amanda-harddisk.conf.in \ template.d/amanda-single-tape.conf.in \ template.d/amanda-tape-changer.conf.in \ template.d/amanda-S3.conf.in template_FILE = \ template.d/dumptypes \ template.d/tapetypes \ template.d/README \ template.d/chg-manual.conf template_generated_FILE = $(template_in_FILE:%.in=%) template_DATA = $(template_FILE) $(template_generated_FILE) server_example_in_FILE = \ amanda.conf.in \ inetd.conf.amandaserver.in \ xinetd.amandaserver.in \ amandaserver.xml.in server_example_FILE = \ chg-multi.conf \ chg-scsi.conf \ disklist server_example_generated_FILE = $(server_example_in_FILE:%.in=%) server_example_DATA = $(server_example_FILE) $(server_example_generated_FILE) client_example_in_FILE = \ amanda-client.conf.in \ amanda-client-postgresql.conf.in \ inetd.conf.amandaclient.in \ xinetd.amandaclient.in \ amandaclient.xml.in client_example_FILE = client_example_generated_FILE = $(client_example_in_FILE:%.in=%) client_example_DATA = $(client_example_FILE) $(client_example_generated_FILE) lbltempl_DATA = DLT.ps \ EXB-8500.ps \ HP-DAT.ps \ 8.5x11.ps \ 3hole.ps \ DLT-A4.ps \ DIN-A4.ps all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu example/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu example/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am: $(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-client_exampleDATA: $(client_example_DATA) @$(NORMAL_INSTALL) @list='$(client_example_DATA)'; test -n "$(client_exampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(client_exampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(client_exampledir)" || 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)$(client_exampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(client_exampledir)" || exit $$?; \ done uninstall-client_exampleDATA: @$(NORMAL_UNINSTALL) @list='$(client_example_DATA)'; test -n "$(client_exampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(client_exampledir)'; $(am__uninstall_files_from_dir) install-lbltemplDATA: $(lbltempl_DATA) @$(NORMAL_INSTALL) @list='$(lbltempl_DATA)'; test -n "$(lbltempldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(lbltempldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(lbltempldir)" || 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)$(lbltempldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(lbltempldir)" || exit $$?; \ done uninstall-lbltemplDATA: @$(NORMAL_UNINSTALL) @list='$(lbltempl_DATA)'; test -n "$(lbltempldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(lbltempldir)'; $(am__uninstall_files_from_dir) install-server_exampleDATA: $(server_example_DATA) @$(NORMAL_INSTALL) @list='$(server_example_DATA)'; test -n "$(server_exampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(server_exampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(server_exampledir)" || 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)$(server_exampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(server_exampledir)" || exit $$?; \ done uninstall-server_exampleDATA: @$(NORMAL_UNINSTALL) @list='$(server_example_DATA)'; test -n "$(server_exampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(server_exampledir)'; $(am__uninstall_files_from_dir) install-templateDATA: $(template_DATA) @$(NORMAL_INSTALL) @list='$(template_DATA)'; test -n "$(templatedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(templatedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(templatedir)" || 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)$(templatedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(templatedir)" || exit $$?; \ done uninstall-templateDATA: @$(NORMAL_UNINSTALL) @list='$(template_DATA)'; test -n "$(templatedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(templatedir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(client_exampledir)" "$(DESTDIR)$(lbltempldir)" "$(DESTDIR)$(server_exampledir)" "$(DESTDIR)$(templatedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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-client_exampleDATA install-lbltemplDATA \ install-server_exampleDATA install-templateDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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-client_exampleDATA uninstall-lbltemplDATA \ uninstall-server_exampleDATA uninstall-templateDATA .MAKE: all check install install-am install-data-am install-exec-am \ install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-client_exampleDATA install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-lbltemplDATA install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-server_exampleDATA install-strip install-templateDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-client_exampleDATA uninstall-lbltemplDATA \ uninstall-server_exampleDATA uninstall-templateDATA installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # build foo from foo.in where necessary %: %.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # 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: amanda-3.3.6/example/template.d/0000775000076400007640000000000012357750430020136 5ustar00martineamartinea00000000000000amanda-3.3.6/example/template.d/amanda-single-tape.conf.in0000664000076400007640000000355212357250001025033 0ustar00martineamartinea00000000000000org "@DEFAULT_CONFIG@" # your organization name for reports mailto "@CLIENT_LOGIN@" # space separated list of operators at your site dumpcycle 1 week # the number of days in the normal dump cycle runspercycle 5 # the number of amdump runs in dumpcycle days # (1 week * 5 amdump runs per week -- just weekdays) tapecycle 10 tapes # the number of tapes in rotation # 1 week (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle runtapes 1 # number of tapes to be used in a single run of amdump define changer my_single { tpchanger "chg-single:tape:/dev/nst0" } tpchanger "my_single" tapetype HP-DAT # what kind of tape it is (see tapetypes below) holdingdisk hd2 { directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@" use 1000 Mb } labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$" # label constraint regex: all tapes must match dtimeout 1800 # number of idle seconds before a dump is aborted. ctimeout 30 # maximum number of seconds that amcheck waits # for each client host etimeout 300 # number of seconds per filesystem for estimates. define dumptype global { comment "Global definitions" auth "bsdtcp" } #define application-tool and dumptype for the amgtar application define application-tool app_amgtar { comment "amgtar" plugin "amgtar" #property "GNUTAR-PATH" "/path/to/gtar" #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" } define dumptype gui-base { global program "APPLICATION" application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes } includefile "./advanced.conf" includefile "@CONFIG_DIR@/template.d/dumptypes" includefile "@CONFIG_DIR@/template.d/tapetypes" amanda-3.3.6/example/template.d/dumptypes0000664000076400007640000003134212357250001022103 0ustar00martineamartinea00000000000000# dumptypes # # These are referred to by the disklist file. The dumptype specifies # certain parameters for dumping including: # auth - authentication scheme to use between server and client. # Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local", # "rsh" and "ssh" # Default: [auth bsd] # comment - just a comment string # comprate - set default compression rate. Should be followed by one or # two numbers, optionally separated by a comma. The 1st is # the full compression rate; the 2nd is the incremental rate. # If the second is omitted, it is assumed equal to the first. # The numbers represent the amount of the original file the # compressed file is expected to take up. # Default: [comprate 0.50, 0.50] # compress - specify compression of the backed up data. Valid values are: # "none" - don't compress the dump output. # "client best" - compress on the client using the best (and # probably slowest) algorithm. # "client fast" - compress on the client using fast algorithm. # "client custom" - compress using your custom client compression program. # use client_custom_compress "PROG" to specify # the custom compression program. # PROG must not contain white space. # "server best" - compress on the tape host using the best (and # probably slowest) algorithm. # "server fast" - compress on the tape host using a fast # algorithm. This may be useful when a fast # tape host is backing up slow clients. # "server custom" - compress using your server custom compression program. # use server_custom_compress "PROG" to specify # the custom compression program. # PROG must not contain white space. # Default: [compress client fast] # dumpcycle - set the number of days in the dump cycle, ie, set how often a # full dump should be performed. Default: from DUMPCYCLE variable # estimate Determine the way AMANDA does it's estimate. # "client" - Use the same program as the dumping program, # this is the most accurate way to do estimates, # but it can take a long time. # "calcsize" - Use a faster program to do estimates, but the # result is less accurate. # "server" - Use only statistics from the previous run to # give an estimate, # it takes only a few seconds but the result is not # accurate if your disk usage changes from day to day. # Default: [client] # encrypt - specify encryption of the backed up data. Valid values are: # "none" - don't encrypt the dump output. # "client" - encrypt on the client using the program specified by # client_encrypt "PROG". # Use client_decrypt_option to specify the decrypt- # parameter, default is "-d". # PROG and decrypt-parameter must not contain white space. # "server" - encrypt on the server using the program specified by # server_encrypt "PROG". # Use server_decrypt_option to specify the decrypt- # parameter, default is "-d". # PROG and decrypt-parameter must not contain white space. # Default: [none] # exclude - specify files and directories to be excluded from the dump. # Useful with gnutar only; silently ignored by dump and samba. # Valid values are: # "pattern" - a shell glob pattern defining which files # to exclude. # gnutar gets --exclude="pattern" # list "filename" - a file (on the client!) containing patterns # re's (1 per line) defining which files to # exclude. # gnutar gets --exclude-from="filename" # Note that the `full pathname' of a file within its # filesystem starts with `./', because of the way amanda runs # gnutar: `tar -C $mountpoint -cf - --lots-of-options .' (note # the final dot!) Thus, if you're backing up `/usr' with a # diskfile entry like ``host /usr gnutar-root', but you don't # want to backup /usr/tmp, your exclude list should contain # the pattern `./tmp', as this is relative to the `/usr' above. # Please refer to the man-page of gnutar for more information. # If a relative pathname is specified as the exclude list, # it is searched from within the directory that is # going to be backed up. # Default: include all files # holdingdisk - should the holding disk be used for this dump. Useful for # dumping the holding disk itself. Default: [holdingdisk auto] # "never" - Never use the holding disk. # "auto" - Use the holding disk if possible. # "required" - Always use the holding disk. # ignore - do not back this filesystem up. Useful for sharing a single # disklist in several configurations. # index - keep an index of the files backed up. Default: [index no] # kencrypt - encrypt the data stream between the client and server. # Default: [kencrypt no] # maxdumps - max number of concurrent dumps to run on the client. # Default: [maxdumps 1] # maxpromoteday - max number of day for a promotion, set it 0 if you don't # want promotion, set it to 1 or 2 if your disk get # overpromoted. # Default: [10000] # priority - priority level of the dump. Valid levels are "low", "medium" # or "high". These are really only used when Amanda has no # tape to write to because of some error. In that "degraded # mode", as many incrementals as will fit on the holding disk # are done, higher priority first, to insure the important # disks are at least dumped. Default: [priority medium] # program - specify the dump system to use. Valid values are "DUMP" # "STAR" and "GNUTAR". Default: [program "DUMP"]. # record - record the backup in the time-stamp-database of the backup # program (e.g. /etc/dumpdates for DUMP or # /var/lib/amanda/gnutar-lists for GNUTAR.). # Default: [record yes] # skip-full - skip the disk when a level 0 is due, to allow full backups # outside Amanda, eg when the machine is in single-user mode. # skip-incr - skip the disk when the level 0 is NOT due. This is used in # archive configurations, where only full dumps are done and # the tapes saved. # starttime - delay the start of the dump? Default: no delay # strategy - set the dump strategy. Valid strategies are currently: # "standard" - the standard one. # "nofull" - do level 1 dumps every time. This can be used, # for example, for small root filesystems that # only change slightly relative to a site-wide # prototype. Amanda then backs up just the # changes. # "noinc" - do level 0 dumps every time. # "skip" - skip all dumps. Useful for sharing a single # disklist in several configurations. # "incronly" - do only incremental dumps. This is similar # to strategy 'nofull', but will increase # the dump level as usual. Full dumps will # only be performed when an 'amadmin force' # has been issued # Default: [strategy standard] # # Note that you may specify previously defined dumptypes as a shorthand way # of defining parameters. # dumptype global defined in $config/amanda.conf define dumptype always-full { global comment "Full dump of this filesystem always" compress none priority high dumpcycle 0 } # Dumptypes for star define dumptype root-star { global program "STAR" comment "root partitions dumped with star" compress none index # exclude list "/var/lib/amanda/exclude.star" priority low } define dumptype user-star { root-star comment "user partitions dumped with star" priority medium } define dumptype user-star-span { root-star comment "tape-spanning user partitions dumped with star" priority medium } define dumptype high-star { root-star comment "partitions dumped with star" priority high } define dumptype comp-root-star { root-star comment "Root partitions with compression" compress client fast } define dumptype comp-user-star { user-star compress client fast } define dumptype comp-user-star-span { user-star-span compress client fast } # Dumptypes for gnutar define dumptype root-tar { global program "GNUTAR" comment "root partitions dumped with tar" compress none index priority low } define dumptype user-tar { root-tar comment "user partitions dumped with tar" priority medium } define dumptype user-tar-span { root-tar comment "tape-spanning user partitions dumped with tar" priority medium } define dumptype high-tar { root-tar comment "partitions dumped with tar" priority high } define dumptype comp-root-tar { root-tar comment "Root partitions with compression dumped with tar" compress client fast } define dumptype comp-user-tar { user-tar compress client fast } define dumptype comp-user-tar-span { user-tar-span compress client fast } define dumptype holding-disk { global comment "The master-host holding disk itself" holdingdisk never # do not use the holding disk priority medium } define dumptype comp-user { global comment "Non-root partitions on reasonably fast machines" compress client fast priority medium } define dumptype comp-user-span { global comment "Tape-spanning non-root partitions on reasonably fast machines" compress client fast priority medium } define dumptype nocomp-user { comp-user comment "Non-root partitions on slow machines" compress none } define dumptype nocomp-user-span { comp-user-span comment "Tape-spanning non-root partitions on slow machines" compress none } define dumptype comp-root { global comment "Root partitions with compression" compress client fast priority low } define dumptype nocomp-root { comp-root comment "Root partitions without compression" compress none } define dumptype comp-high { global comment "very important partitions on fast machines" compress client best priority high } define dumptype nocomp-high { comp-high comment "very important partitions on slow machines" compress none } define dumptype nocomp-test { global comment "test dump without compression, no /etc/dumpdates recording" compress none record no priority medium } define dumptype comp-test { nocomp-test comment "test dump with compression, no /etc/dumpdates recording" compress client fast } define dumptype nocomp-ssh { root-tar comment "ssh authorization and dumped with tar" auth "ssh" ssh_keys "/var/lib/amanda/.ssh/id_rsa_amdump" compress none } define dumptype custom-compress { root-tar comment "custom client compression, dumped with tar" compress client custom client_custom_compress "/usr/bin/bzip2" } # amcrypt requires aespipe and uuencode define dumptype encrypt-fast { root-tar comment "fast client compression and server symmetric encryption, dumped with tar" compress client fast encrypt server server_encrypt "/usr/sbin/amcrypt" server_decrypt_option "-d" } # amcryptsimple use gpg symmetric encryption. gpg does compress with zlib by default. # Thus, specify compress none. define dumptype encrypt-simple-nocomp { root-tar comment "client simple symmetric encryption, dumped with tar" compress none encrypt client client_encrypt "/usr/sbin/amcryptsimple" client_decrypt_option "-d" } # To use gpg public-key encryption, gpg does compress with zlib by default. # Thus, specify compress none. define dumptype gpg-encrypt-nocomp { root-tar comment "server public-key encryption, dumped with tar" compress none encrypt server server_encrypt "/usr/sbin/amgpgcrypt" server_decrypt_option "-d" } # The following dumptypes are for ZMC # dumptype gui-base defined in $config/amanda.conf define dumptype gui-default { gui-base comment "gui default dumptype" compress none encrypt none } define dumptype gui-compress { gui-base comment "gui dumptype with compression" compress client fast encrypt none } define dumptype gui-encrypt { gui-base comment "gui dumptype with encryption" compress none encrypt server server_encrypt "/usr/sbin/amcryptsimple" } define dumptype gui-encrypt-compress { gui-base comment "gui dumptype with compression and encryption" compress client fast encrypt server server_encrypt "/usr/sbin/amcryptsimple" } amanda-3.3.6/example/template.d/chg-manual.conf0000664000076400007640000000062012357250001023004 0ustar00martineamartinea00000000000000# #configuration used by chg-manual # resend_mail=3600 # every hour timeout_mail=43200 # 12 hours #request="tty" # Use the tty to ask the user to change tape. # Can't be use by cron #request="email" # Send an email to ask the user to change tape. request="tty_email" # Send request through tty if it exists. # Otherwise, it will send an email. amanda-3.3.6/example/template.d/amanda-S3.conf.in0000664000076400007640000000415312357250001023106 0ustar00martineamartinea00000000000000org "@DEFAULT_CONFIG@" # your organization name for reports mailto "@CLIENT_LOGIN@" # space separated list of operators at your site dumpcycle 1 week # the number of days in the normal dump cycle runspercycle 5 # the number of amdump runs in dumpcycle days # (1 week * 5 amdump runs per week -- just weekdays) tapecycle 10 tapes # the number of tapes in rotation # 1 week (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle runtapes 1 # number of tapes to be used in a single run of amdump define changer my_s3 { tpchanger "chg-multi:" device-property "S3_ACCESS_KEY" "" device-property "S3_SECRET_KEY" "" device-property "NB_THREADS_BACKUP" "3" } tpchanger "my_s3" tapetype S3 # what kind of tape it is (see tapetypes below) holdingdisk hd2 { directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@" use 1000 Mb } autolabel "@DEFAULT_CONFIG@-%%%%" empty labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$" # label constraint regex: all tapes must match dtimeout 1800 # number of idle seconds before a dump is aborted. ctimeout 30 # maximum number of seconds that amcheck waits # for each client host etimeout 300 # number of seconds per filesystem for estimates. define dumptype global { comment "Global definitions" auth "bsdtcp" } #define application-tool and dumptype for the amgtar application define application-tool app_amgtar { comment "amgtar" plugin "amgtar" #property "GNUTAR-PATH" "/path/to/gtar" #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" } define dumptype gui-base { global program "APPLICATION" application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes } define tapetype S3 { comment "S3 pseudo-tape" length 10240 gigabytes part_size 100G part_cache_type none } includefile "./advanced.conf" includefile "@CONFIG_DIR@/template.d/dumptypes" includefile "@CONFIG_DIR@/template.d/tapetypes" amanda-3.3.6/example/template.d/README0000664000076400007640000000200312357250001020776 0ustar00martineamartinea00000000000000README for template.d directory ------------------------------- This directory contains seven files that are used by amserverconfig. amanda-harddisk.conf: contains common parameters for a typical Amanda configuration using virtual tapes. amanda-single-tape.conf: contains common parameters for a typical Amanda configuration using one tape. amanda-tape-changer.conf: contains common parameters for a typical Amanda configuration using tape changer. advanced.conf: contains advanced Amanda parameters that are not usually changed by a site. dumptypes: contains Amanda dumptype definitions. tapetypes: contains Amanda tapetype definitions. README: this file. amserverconfig will create a Amanda configuration in the following directory structure: /etc/amanda/template.d: dumptypes tapetypes /etc/amanda/$config_name: amanda.conf [ it's a copy of amanda-harddisk.conf, amanda-single-tape.conf or amanda-tape-changer.conf ] advanced.conf See amserverconfig(8) or amaddclient(8) for detail. amanda-3.3.6/example/template.d/tapetypes0000664000076400007640000001572512357250001022076 0ustar00martineamartinea00000000000000# tapetypes # Define the type of tape you use here, and use it in "tapetype" # above. Some typical types of tapes are included here. The tapetype # tells amanda how many MB will fit on the tape, how big the filemarks # are, and how fast the tape device is. # A filemark is the amount of wasted space every time a tape section # ends. # For completeness Amanda should calculate the inter-record gaps too, # but it doesn't. For EXABYTE and DAT tapes this is ok. Anyone using # 9 tracks for amanda and need IRG calculations? Drop me a note if # so. # If you want amanda to print postscript paper tape labels # add a line after the comment in the tapetype of the form # lbl-templ "/path/to/postscript/template/label.ps" # if you want the label to go to a printer other than the default # for your system, you can also add a line above for a different # printer. (i usually add that line after the dumpuser specification) # dumpuser "operator" # the user to run dumps under # printer "mypostscript" # printer to print paper label on # here is an example of my definition for an EXB-8500 # define tapetype EXB-8500 { # ... # lbl-templ "/usr/local/amanda/config/lbl.exabyte.ps" # } # HARDDISK defintion in amanda.conf define tapetype DLT-S4 { comment "just produced by tapetype prog, compression off" length 772096 mbytes filemark 0 kbytes speed 33596 kps } define tapetype DLT8000 { comment "Quantum DLT8000 created by tapetype" length 38130 mbytes filemark 29 kbytes speed 5627 kps } define tapetype QUANTUM-DLT4000 { comment "Quantum DLT4000, compression off" length 19534 mbytes filemark 4 kbytes speed 1096 kps } define tapetype SDLT600 { comment "Quantum SDLT600 with 10MB/s" length 306789 mbytes filemark 0 kbytes speed 8247 kps } define tapetype SDLT320 { comment "HP Super DLTtape I, data cartridge, C7980A, compression on" length 139776 mbytes filemark 0 kbytes speed 13980 kps } define tapetype SDLT220NOCOMP { comment "Quantum SDLT 220, compression off" length 109539 mbytes filemark 0 kbytes speed 10351 kps } define tapetype Quantum-DLT-V4 { comment "Quantum-DLT-V4 on Adaptec 29160" length 157284 mbytes filemark 0 kbytes speed 9936 kps } define tapetype AIT1{ comment "Sony AIT-1 with 170m tapes" length 21568 mbytes filemark 0 kbytes speed 2699 kps } define tapetype AIT1-35 { comment "Sony AIT1 cartridge 35/70 Gbyte, compression off" length 33400 mbytes # rounded down filemark 500 kbytes speed 2890 kps } define tapetype LTO { comment "Dell PowerVault 122T, Seagate Ultrium, IBM 3581-H17, compression off" length 101376 mbytes filemark 0 kbytes speed 13872 kps } define tapetype QUANTUM-LTO2 { comment " Quantum LTO-2 HH, compression off" length 186368 mbytes filemark 0 kbytes speed 2781 kps } define tapetype LTO2 { comment "HP Ultrium 448, hardware compression off" length 193024 mbytes filemark 0 kbytes speed 20355 kps } define tapetype DELL-LTO3-400 { comment "Dell PV124T LTO3, compression off" length 402432 mbytes filemark 0 kbytes speed 71189 kps } define tapetype DELL-LTO2-200 { comment "Dell PV132T LTO2, hardware compression" length 201216 mbytes filemark 0 kbytes speed 31343 kps } define tapetype IBM-ULTRIUM-3582 { comment "IBM Ultrium 3582, compression on" length 199168 mbytes filemark 0 kbytes speed 30760 kps } define tapetype LTO3-400 { comment "LTO Ultrium 3 400/800, compression off" length 402432 mbytes filemark 0 kbytes speed 71702 kps } define tapetype HP-ULTRIUM-960 { comment "HP Ultrium 960, compression off" length 386048 mbytes filemark 0 kbytes speed 67629 kps } define tapetype SEAGATE-ULTRIUM-LTO { comment "SEAGATE ULTRIUM 06242 LTO, compression off" length 99584 mbytes filemark 0 kbytes speed 11288 kps } define tapetype QS3LTO-3 { comment "Quantum Super Loader 3 LTO-3 16 tape library" length 448369 mbytes filemark 6403 kbytes speed 37739 kps } define tapetype DDS90 { comment "DDS tapes drives - 90 meter tapes" length 1900000 kbytes # rounded down filemark 111 kbytes speed 380 kps } define tapetype DDS120 { comment "DDS tape drives - 120 meter tapes" length 3850000 # rounded down filemark 111 kbytes speed 380 kps } define tapetype IBM-DAT-72 { comment "DDS5, compression on" length 30227 mbytes filemark 0 kbytes speed 2559 kps } define tapetype HP-DAT-72 { comment "DDS5, /dev/rmt/0ln, HP C7438A Rev V309, compression on" length 30227 mbytes filemark 0 kbytes speed 2551 kps } define tapetype DLT1 { comment "HP DLT1, DLT IV Tape C5141F, compression on" length 34818 mbytes filemark 32 kbytes speed 2879 kps } define tapetype ARCvault24 { comment "Overland ARCvault, compression off" length 386048 mbytes filemark 0 kbytes speed 38246 kps } define tapetype QIC-60 { comment "Archive Viper" length 60 mbytes filemark 100 kbytes speed 100 kbytes } define tapetype CD650 { comment "CD-R 650MB sized vtape" length 681984000 bytes filemark 4 Kbytes } define tapetype CD700 { comment "CD-R 700MB sized vtape" length 737280000 bytes filemark 4 Kbytes } define tapetype DVD47 { comment "A 4.7 Gbyte DVD-sized vtape" length 4482 mbytes filemark 4 kbytes } define tapetype DVD85 { comment "A 8.5 GB DVD double layer" length 8100 mbytes # approximately - exact value not found filemark 4 kbytes } define tapetype DEC-DLT2000 { comment "DEC Differential Digital Linear Tape 2000" length 15000 mbytes filemark 8 kbytes speed 1250 kbytes } # goluboff@butch.Colorado.EDU # in amanda-users (Thu Dec 26 01:55:38 MEZ 1996) define tapetype DLT { comment "DLT tape drives" length 20000 mbytes # 20 Gig tapes filemark 2000 kbytes speed 1536 kbytes } define tapetype SURESTORE-1200E { comment "HP AutoLoader" length 3900 mbytes filemark 100 kbytes speed 500 kbytes } define tapetype EXB-8500 { comment "Exabyte EXB-8500 drive on decent machine" length 4200 mbytes filemark 48 kbytes speed 474 kbytes } define tapetype EXB-8200 { comment "Exabyte EXB-8200 drive on decent machine" length 2200 mbytes filemark 2130 kbytes speed 240 kbytes } define tapetype HP-DAT { comment "DAT tape drives" # data provided by Rob Browning length 1930 mbytes filemark 111 kbytes speed 468 kbytes } define tapetype DAT { comment "DAT tape drives" length 1000 mbytes # these numbers are not accurate filemark 100 kbytes # but you get the idea speed 100 kbytes } define tapetype MIMSY-MEGATAPE { comment "Megatape (Exabyte based) drive through Emulex on Vax 8600" length 2200 mbytes filemark 2130 kbytes speed 170 kbytes # limited by the Emulex bus interface, ugh } amanda-3.3.6/example/template.d/amanda-harddisk.conf.in0000664000076400007640000000446212357250001024415 0ustar00martineamartinea00000000000000org "@DEFAULT_CONFIG@" # your organization name for reports mailto "@CLIENT_LOGIN@" # space separated list of operators at your site dumpcycle 1 week # the number of days in the normal dump cycle runspercycle 5 # the number of amdump runs in dumpcycle days # (1 week * 5 amdump runs per week -- just weekdays) tapecycle 10 tapes # the number of tapes in rotation # 1 week (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle runtapes 1 # number of tapes to be used in a single run of amdump define changer my_vtapes { tpchanger "chg-disk:/@prefix@/var/lib/amanda/vtapes/@DEFAULT_CONFIG@" property "num-slot" "10" property "auto-create-slot" "yes" } tpchanger "my_vtapes" tapetype HARDDISK # what kind of tape it is labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$" # label constraint regex: all tapes must match dtimeout 1800 # number of idle seconds before a dump is aborted. ctimeout 30 # maximum number of seconds that amcheck waits # for each client host etimeout 300 # number of seconds per filesystem for estimates. define dumptype global { comment "Global definitions" auth "bsdtcp" } #define application-tool and dumptype for the amgtar application define application-tool app_amgtar { comment "amgtar" plugin "amgtar" #property "GNUTAR-PATH" "/path/to/gtar" #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" } define dumptype gui-base { global program "APPLICATION" application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes } define tapetype HARDDISK { comment "Virtual Tapes" length 5000 mbytes part_size 500 mbytes part_cache_type none } includefile "./advanced.conf" includefile "@CONFIG_DIR@/template.d/dumptypes" includefile "@CONFIG_DIR@/template.d/tapetypes" amanda-3.3.6/example/template.d/amanda-tape-changer.conf.in0000664000076400007640000000361712357250001025163 0ustar00martineamartinea00000000000000org "@DEFAULT_CONFIG@" # your organization name for reports mailto "@CLIENT_LOGIN@" # space separated list of operators at your site dumpcycle 1 week # the number of days in the normal dump cycle runspercycle 5 # the number of amdump runs in dumpcycle days # (1 week * 5 amdump runs per week -- just weekdays) tapecycle 10 tapes # the number of tapes in rotation # 1 week (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle runtapes 1 # number of tapes to be used in a single run of amdump define changer my_robot { tpchanger "chg-robot:/dev/sg1" property "tape-device" "0=tape:/dev/nst0" } tpchanger "my_robot" tapetype HP-DAT # what kind of tape it is (see tapetypes below) holdingdisk hd2 { directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@" use 1000 Mb } labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$" # label constraint regex: all tapes must match dtimeout 1800 # number of idle seconds before a dump is aborted. ctimeout 30 # maximum number of seconds that amcheck waits # for each client host etimeout 300 # number of seconds per filesystem for estimates. define dumptype global { comment "Global definitions" auth "bsdtcp" } #define application-tool and dumptype for the amgtar application define application-tool app_amgtar { comment "amgtar" plugin "amgtar" #property "GNUTAR-PATH" "/path/to/gtar" #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" } define dumptype gui-base { global program "APPLICATION" application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes } includefile "./advanced.conf" includefile "@CONFIG_DIR@/template.d/dumptypes" includefile "@CONFIG_DIR@/template.d/tapetypes" amanda-3.3.6/example/template.d/advanced.conf.in0000664000076400007640000001500312357250001023143 0ustar00martineamartinea00000000000000inparallel 4 # maximum dumpers that will run in parallel (max 63) # this maximum can be increased at compile-time, # modifying MAX_DUMPERS in server-src/driverio.h dumporder "sssS" # specify the priority order of each dumper # s -> smallest size # S -> biggest size # t -> smallest time # T -> biggest time # b -> smallest bandwidth # B -> biggest bandwitdh # try "BTBTBTBTBTBT" if you are not holding # disk constrained taperalgo first # The algorithm used to choose which dump image to send # to the taper. # Possible values: [first|firstfit|largest|largestfit|smallest|last] # Default: first. # first First in - first out. # firstfit The first dump image that will fit on the current tape. # largest The largest dump image. # largestfit The largest dump image that will fit on the current tape. # smallest The smallest dump image. # last Last in - first out. displayunit "g" # Possible values: "k|m|g|t" # Default: k. # The unit used to print many numbers. # k=kilo, m=mega, g=giga, t=tera netusage 8000 Kbps # maximum net bandwidth for Amanda, in KB per sec bumpsize 20 Mb # minimum savings (threshold) to bump level 1 -> 2 bumppercent 20 # minimum savings (threshold) to bump level 1 -> 2 bumpdays 1 # minimum days at each level # By default, Amanda can only track at most one run per calendar day. When # the usetimestamps option is enabled, however, Amanda can track as many # runs as you care to make. # WARNING: This option is not backward-compatible. Do not enable it if you # intend to downgrade your server installation to any version # earlier than Amanda 2.5.1 usetimestamps yes device_output_buffer_size 1280k # amount of buffer space to use when writing to devices # If you want Amanda to automatically label any non-Amanda tapes it # encounters, uncomment the line below. Note that this will ERASE any # non-Amanda tapes you may have, and may also ERASE any near-failing tapes. # Use with caution. ## autolabel "DailySet1-%%%" empty maxdumpsize -1 # Maximum total size the planner will schedule # for a run (default: runtapes * tape_length) (kbytes). bumpmult 4 # threshold = bumpsize * bumpmult^(level-1) amrecover_changer "changer" # amrecover will use the changer if you restore # from this device. It could be a string like 'changer' and amrecover will use your # changer if you set your tape to 'changer' with 'setdevice changer' or via # 'tapedev "changer"' in amanda-client.conf # If amanda cannot find a tape on which to store backups, it will run # as many backups as it can to the holding disks. In order to save # space for unattended backups, by default, amanda will only perform # incremental backups in this case, i.e., it will reserve 100% of the # holding disk space for the so-called degraded mode backups. # However, if you specify a different value for the `reserve' # parameter, amanda will not degrade backups if they will fit in the # non-reserved portion of the holding disk. # reserve 30 # percent # This means save at least 30% of the holding disk space for degraded # mode backups. autoflush no # if autoflush is set to yes, then amdump will schedule all dump on # holding disks to be flush to tape during the run. # Amanda needs a few Mb of diskspace for the log and debug files, # as well as a database. This stuff can grow large, so the conf directory # isn't usually appropriate. Some sites use /usr/local/var and some /usr/adm. # Create an amanda directory under there. You need a separate infofile and # logdir for each configuration, so create subdirectories for each conf and # put the files there. Specify the locations below. # Note that, although the keyword below is infofile, it is only so for # historic reasons, since now it is supposed to be a directory (unless # you have selected some database format other than the `text' default) infofile "@CONFIG_DIR@/@DEFAULT_CONFIG@/curinfo" # database DIRECTORY logdir "@CONFIG_DIR@/@DEFAULT_CONFIG@" # log directory indexdir "@CONFIG_DIR@/@DEFAULT_CONFIG@/index" # index directory #tapelist "@CONFIG_DIR/DailySet1/tapelist" # list of used tapes # tapelist is stored, by default, in the directory that contains amanda.conf # Specify holding disks. These are used as a temporary staging area for # dumps before they are written to tape and are recommended for most sites. # The advantages include: tape drive is more likely to operate in streaming # mode (which reduces tape and drive wear, reduces total dump time); multiple # dumps can be done in parallel (which can dramatically reduce total dump time. # The main disadvantage is that dumps on the holding disk need to be flushed # (with amflush) to tape after an operating system crash or a tape failure. # If no holding disks are specified then all dumps will be written directly # to tape. If a dump is too big to fit on the holding disk than it will be # written directly to tape. If more than one holding disk is specified then # they will all be used based on activity and available space. #holdingdisk hd1 { # comment "main holding disk" # directory "/dumps/amanda" # where the holding disk is # use -100 Mb # how much space can we use on it # # a non-positive value means: # # use all space but that value # chunksize 1Gb # size of chunk if you want big dump to be # # dumped on multiple files on holding disks # # N Kb/Mb/Gb split images in chunks of size N # # The maximum value should be # # (MAX_FILE_SIZE - 1Mb) # # 0 same as INT_MAX bytes # } #holdingdisk hd2 { # directory "/dumps2/amanda" # use 1000 Mb # } # network interfaces # # These are referred to by the disklist file. They define the attributes # of the network interface that the remote machine is accessed through. # Notes: - netusage above defines the attributes t # disklist entry doesn't specify otherwise. # - the values below are only samples. # - specifying an interface does not force the traffic to pass # through that interface. Your OS routing tables do that. This # is just a mechanism to stop Amanda trashing your network. # Attributes are: # use - bandwidth above which amanda won't start # backups using this interface. Note that if # a single backup will take more than that, # amanda won't try to make it run slower! define interface local { comment "a local disk" use 8000 kbps } #define interface le0 { # comment "10 Mbps ethernet" # use 400 kbps #} amanda-3.3.6/example/8.5x11.ps0000664000076400007640000001340712357250001017303 0ustar00martineamartinea00000000000000%! %%BoundingBox: 25 25 290 900 %%Title: AMANDA Full Page Label %%Creator: Amanda reporter %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create 8.5 x 11 inch %%%% PostScript dump logs for each dump. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +----+-------------------+ % | TAPE_NAME | <- section 'A' % | version Location date | <- section 'B' % +------------------------+ % |statistics | message | <- section 'C' | 'F' % +----+--+--------+-------+ % | f# hst fs lvl O-KB C-KB| <- section 'D' % +-------+--------+-------+ % | | | | <- section 'E' % | | | | % v v v v % % section 'A' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 24 scalefont setfont } def /TitlePos { 321 728 } def % section 'B' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 11 scalefont setfont } def /DatePos { 580 715 } def /VersFont { /Palatino-Bold findfont 11 scalefont setfont } def /VersPos { 43 715 } def /LocFont { /Helvetica-Bold findfont 12 scalefont setfont } def /LocPos { 321 715 } def % section 'C' font, start position, and line separation % /StatFont { /Courier findfont 9 scalefont setfont } def /StatPos { 43 695 } def /StatSep { 9 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 9 scalefont setfont } def /HeadingFilePos { 43 644 } def /HeadingHostPos { 73 644 } def /HeadingFsPos { 198 644 } def /HeadingLvlPos { 333 644 } def /HeadingOSizePos1 { 403 652 } def /HeadingOSizePos { 403 644 } def /HeadingCSizePos1 { 483 652 } def /HeadingCSizePos { 483 644 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 9 scalefont setfont } def /HostSep { 10 } def /HostBasePos { 38 630 } def % section 'F' font, and line separation % /MessFont { /Courier findfont 9 scalefont setfont } def /MessPos { 215 702 } def /MessSep { 9 } def % the following rectangles separate the regions % /TitleBox { 590 750 38 710 } def /StatBox { 590 710 38 660 } def /HeadingBox { 590 660 38 640 } def /HostBox { 590 640 38 0 } def /CFline { 208 710 208 660 } def %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 20 translate % draw all of the boxes % 0 setgray 2 setlinewidth % thick lines StatBox box stroke TitleBox box stroke HeadingBox box stroke HostBox box stroke CFline moveto lineto stroke HeadingFont HeadingFilePos moveto (File #) show HeadingHostPos moveto (Host) show HeadingFsPos moveto (File System) show HeadingLvlPos moveto (Level) stringwidth pop 2 div neg 0 rmoveto (Level) show HeadingOSizePos1 moveto (Original) stringwidth pop 2 div neg 0 rmoveto (Original) show HeadingOSizePos moveto (File Size (KB)) stringwidth pop 2 div neg 0 rmoveto (File Size (KB)) show HeadingCSizePos1 moveto (Compressed) stringwidth pop 2 div neg 0 rmoveto (Compressed) show HeadingCSizePos moveto (File Size (KB)) stringwidth pop 2 div neg 0 rmoveto (File Size (KB)) show % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def /CurrMessY MessPos exch pop def HostBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawLoc draws the string on the top of the stack in section 'C' % /DrawLoc { LocFont LocPos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def % DrawMess draws the string on the top of the stack in section 'F' % /DrawMess { MessFont MessPos pop CurrMessY moveto show /CurrMessY CurrMessY MessSep sub def } def % Fill in Location name and message % (Magic Software Development, Inc.) DrawLoc (To restore:) DrawMess ( position tape at the start of the file and run:) DrawMess ( dd if=/dev/nrst0 bs=32k skip=1 | zcat | restore -if -) DrawMess ( or run:) DrawMess ( amrestore -p /dev/nrst0 | restore -if -) DrawMess % DrawHost expects six strings to be on the stack. The strings are % Host Name, Partition Name, Dump Level, Tape File Number, and Output Size. % /DrawHost { HostFont .25 setlinewidth % thin lines HeadingCSizePos pop CurrColumnY moveto -22 0 rmoveto show HeadingOSizePos pop CurrColumnY moveto -22 0 rmoveto show HeadingFilePos pop CurrColumnY moveto show HeadingLvlPos pop CurrColumnY moveto show HeadingFsPos pop CurrColumnY moveto show HeadingHostPos pop CurrColumnY moveto show 38 CurrColumnY 2.5 sub moveto 590 CurrColumnY 2.5 sub lineto stroke /CurrColumnY CurrColumnY HostSep sub def } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/Makefile.am0000664000076400007640000000425012357250001020123 0ustar00martineamartinea00000000000000# Makefile for sample configuration files include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am amanda_dir = $(amdatadir) templatedir = $(amanda_dir)/template.d server_exampledir = $(amanda_dir)/example client_exampledir = $(amanda_dir)/example lbltempldir = $(amanda_dir)/example/label-templates template_in_FILE = \ template.d/advanced.conf.in \ template.d/amanda-harddisk.conf.in \ template.d/amanda-single-tape.conf.in \ template.d/amanda-tape-changer.conf.in \ template.d/amanda-S3.conf.in template_FILE = \ template.d/dumptypes \ template.d/tapetypes \ template.d/README \ template.d/chg-manual.conf template_generated_FILE = $(template_in_FILE:%.in=%) template_DATA = $(template_FILE) $(template_generated_FILE) EXTRA_DIST += $(template_FILE) $(template_in_FILE) DISTCLEANFILES += $(template_generated_FILE) server_example_in_FILE = \ amanda.conf.in \ inetd.conf.amandaserver.in \ xinetd.amandaserver.in \ amandaserver.xml.in server_example_FILE = \ chg-multi.conf \ chg-scsi.conf \ disklist server_example_generated_FILE = $(server_example_in_FILE:%.in=%) server_example_DATA = $(server_example_FILE) $(server_example_generated_FILE) EXTRA_DIST += $(server_example_FILE) $(server_example_in_FILE) DISTCLEANFILES += $(server_example_generated_FILE) client_example_in_FILE = \ amanda-client.conf.in \ amanda-client-postgresql.conf.in \ inetd.conf.amandaclient.in \ xinetd.amandaclient.in \ amandaclient.xml.in client_example_FILE = client_example_generated_FILE = $(client_example_in_FILE:%.in=%) client_example_DATA = $(client_example_FILE) $(client_example_generated_FILE) EXTRA_DIST += $(client_example_FILE) $(client_example_in_FILE) DISTCLEANFILES += $(client_example_generated_FILE) lbltempl_DATA = DLT.ps \ EXB-8500.ps \ HP-DAT.ps \ 8.5x11.ps \ 3hole.ps \ DLT-A4.ps \ DIN-A4.ps EXTRA_DIST += $(lbltempl_DATA) # build foo from foo.in where necessary %: %.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # config.status leaves config.log files around CLEANFILES += config.log amanda-3.3.6/example/DIN-A4.ps0000664000076400007640000001235612357250001017315 0ustar00martineamartinea00000000000000%! %%BoundingBox: 0 0 595 842 %%Title: AMANDA ExaLabel %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create PostScript tape %%%% labels for each dump. This file is set up for DAT 4mm tapes, %%%% but you can edit it to work with anything. %%%% %%%% NOTE: this is quick-hack for DAT TAPES; it is simply a scaled %%%% version of the Exabyte version. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +------------------------+ % |statistics | <- section 'A' % +----+-------------------+ % |logo| TAPE_NAME | <- section 'B' (logo) <- section 'F' % | | version date | <- section 'C' % +----+--+--------+-------+ % | h fs l | h fs l | <- section 'D' % +-------+--------+-------+ % | | | <- section 'E' % | | | % v v v % % Sections D and E, which hold the bulk of the information are % cut into columns. % % Quick-hack for DAT tapes % 72 25.4 div dup scale %% scale to millimeters % section 'A' font, start position, and line separation % /StatFont { /Courier findfont 4.5 scalefont setfont } def /StatPos { 30 255 } def /StatSep { 4 } def % section 'B' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 10 scalefont setfont } def /TitlePos { 115 230 } def % section 'C' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 5 scalefont setfont } def /DatePos { 190 222 } def /VersFont { /Palatino-Bold findfont 5 scalefont setfont } def /VersPos { 43 222 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 5 scalefont setfont } def /HeadingHostPos { 0 212 } def /HeadingFsPos { 25 212 } def /HeadingLvlPos { 110 212 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 4 scalefont setfont } def /HostSep { 3.2 } def % the following rectangles separate the regions % /StatBox { 200 260 15 240 } def /TitleBox { 200 240 15 220 } def /LogoBox { 35 240 15 220 } def /HeadingBox { 200 220 15 210 } def /HostBox { 200 210 15 0 } def % number of columns for section 'E,' column width, position of first % entry in first column, y coordinate of top and bottom of dividing lines % /NumColumns { 1 } def /ColumnWidth { 132 } def /ColumnBasePos { 25 190 } def /TopColDivLine { 190 } def /BotColDivLine { 0 } def %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 20 translate % draw all of the boxes % 0 setgray .3 setlinewidth % thick lines StatBox box stroke TitleBox box stroke LogoBox box stroke HeadingBox box stroke HostBox box stroke % draw the column dividers % 0.5 setlinewidth % thin lines /i 1 def { NumColumns i sub 0 le { exit } if % no lines if this last col. /xoff ColumnBasePos pop % get x base position i ColumnWidth mul add def % offset for this column xoff TopColDivLine moveto xoff BotColDivLine lineto stroke /i i 1 add def } loop % draw the heading names % /i 0 def HeadingFont { NumColumns i sub 0 le { exit } if /xoff ColumnBasePos pop i ColumnWidth mul add def HeadingHostPos exch xoff add exch moveto (Host) show HeadingFsPos exch xoff add exch moveto (Fs) show HeadingLvlPos exch xoff add exch moveto (Lv) show /i i 1 add def } loop % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def ColumnBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def % DrawHost expects five strings to be on the stack; right now it % uses only the first three. The strings are Host Name, Partition Name, % Dump Level, Tape File Number, and Output Size. % /DrawHost { HostFont pop pop pop % discard sizes and fileno CurrColumnX HeadingLvlPos pop add CurrColumnY moveto show CurrColumnX HeadingFsPos pop add CurrColumnY moveto show CurrColumnX HeadingHostPos pop add CurrColumnY moveto show /CurrColumnY CurrColumnY HostSep sub def CurrColumnY BotColDivLine lt { /CurrColumnY ColumnBasePos exch pop def /CurrColumnX CurrColumnX ColumnWidth add def } if } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/amanda.conf.in0000664000076400007640000006667012357250001020602 0ustar00martineamartinea00000000000000# amanda.conf - sample Amanda configuration file. See amanda.conf(5) for # details org "@DEFAULT_CONFIG@" # your organization name for reports mailto "@CLIENT_LOGIN@" # space separated list of operators at your site dumpuser "@CLIENT_LOGIN@" # the user to run dumps under inparallel 4 # maximum dumpers that will run in parallel (max 63) # this maximum can be increased at compile-time, # modifying MAX_DUMPERS in server-src/driverio.h dumporder "sssS" # specify the priority order of each dumper # s -> smallest size # S -> biggest size # t -> smallest time # T -> biggest time # b -> smallest bandwitdh # B -> biggest bandwitdh # try "BTBTBTBTBTBT" if you are not holding # disk constrained taperalgo first # The algorithm used to choose which dump image to send # to the taper. # Possible values: # [first|firstfit|largest|largestfit|smallest|last] # Default: first. # first First in - first out. # firstfit The first dump image that will fit # on the current tape. # largest The largest dump image. # largestfit The largest dump image that will fit # on the current tape. # smallest The smallest dump image. # last Last in - first out. displayunit "k" # Possible values: "k|m|g|t" # Default: k. # The unit used to print many numbers. # k=kilo, m=mega, g=giga, t=tera netusage 8000 Kbps # maximum net bandwidth for Amanda, in KB per sec dumpcycle 4 weeks # the number of days in the normal dump cycle runspercycle 20 # the number of amdump runs in dumpcycle days # (4 weeks * 5 amdump runs per week -- just weekdays) tapecycle 25 tapes # the number of tapes in rotation # 4 weeks (dumpcycle) times 5 tapes per week (just # the weekdays) plus a few to handle errors that # need amflush and so we do not overwrite the full # backups performed at the beginning of the previous # cycle bumpsize 20 Mb # minimum savings (threshold) to bump level 1 -> 2 bumppercent 20 # minimum savings (threshold) to bump level 1 -> 2 bumpdays 1 # minimum days at each level bumpmult 4 # threshold = bumpsize * bumpmult^(level-1) etimeout 300 # number of seconds per filesystem for estimates. dtimeout 1800 # number of idle seconds before a dump is aborted. ctimeout 30 # maximum number of seconds that amcheck waits # for each client host device_output_buffer_size 1280k # amount of buffer space to use when writing to devices # By default, Amanda can only track at most one run per calendar day. When # the usetimestamps option is enabled, however, Amanda can track as many # runs as you care to make. # WARNING: This option is not backward-compatible. Do not enable it if you # intend to downgrade your server installation to Amanda community # edition 2.5 usetimestamps yes # flush-threshold-dumped, flush-threshold-scheduled, taperflush, and autoflush # are used to control tape utilization. See the amanda.conf (5) manpage for # details on how they work. Taping will not start until all criteria are # satisfied. Here are some examples: # # You want to fill tapes completely even in the case of failed dumps, and # don't care if some dumps are left on the holding disk after a run: # flush-threshold-dumped 100 # (or more) # flush-threshold-scheduled 100 # (or more) # taperflush 100 # autoflush yes # # You want to improve tape performance by waiting for a complete tape of data # before writing anything. However, all dumps will be flushed; none will # be left on the holding disk. # flush-threshold-dumped 100 # (or more) # flush-threshold-scheduled 100 # (or more) # taperflush 0 # # You don't want to use a new tape for every run, but want to start writing # to tape as soon as possible: # flush-threshold-dumped 0 # (or more) # flush-threshold-scheduled 100 # (or more) # taperflush 100 # autoflush yes # maxdumpsize 100k # amount of data to dump each run; see above. # # You want to keep the most recent dumps on holding disk, for faster recovery. # Older dumps will be rotated to tape during each run. # flush-threshold-dumped 300 # (or more) # flush-threshold-scheduled 300 # (or more) # taperflush 300 # autoflush yes # # Defaults: # (no restrictions; flush to tape immediately; don't flush old dumps.) flush-threshold-dumped 0 flush-threshold-scheduled 0 taperflush 0 autoflush no # Specify tape device or tape changer. runtapes 1 # number of tapes to be used in a single run of amdump tapedev "@EXAMPLE_TAPEDEV@" # tape changer or device to use # To use vtapes, create some slotN directories (slot0, slot1, etc.) under # /var/amanda/vtapes and use this tapedev: ## tapedev "chg-disk:/var/amanda/vtapes" # To use a tape library, uncomment this definition. See amanda-changers(7) # for more configuration options. # # define changer myrobot { # tpchanger "chg-robot:/dev/sg0" # your changer device file # tapedev "tape:@EXAMPLE_TAPEDEV@" # your tape drive device file # } # tapedev "myrobot" # If you want Amanda to automatically label any non-Amanda tapes it # encounters, uncomment the line below. Note that this will ERASE any # non-Amanda tapes you may have, and may also ERASE any near-failing tapes. # Use with caution. ## autolabel "@DEFAULT_CONFIG@-%%%" empty maxdumpsize -1 # Maximum number of bytes the planner will schedule # for a run (default: runtapes * tape_length). tapetype HP-DAT # what kind of tape it is (see tapetypes below) labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$" # label constraint regex: all tapes must match amrecover_changer "changer" # amrecover will use the changer if you restore # from this device. It could be a string like 'changer' and amrecover will use your # changer if you set your tape to 'changer' with 'setdevice changer' or via # 'tapedev "changer"' in amanda-client.conf # Specify holding disks. These are used as a temporary staging area for # dumps before they are written to tape and are recommended for most sites. # The advantages include: tape drive is more likely to operate in streaming # mode (which reduces tape and drive wear, reduces total dump time); multiple # dumps can be done in parallel (which can dramatically reduce total dump time. # The main disadvantage is that dumps on the holding disk need to be flushed # (with amflush) to tape after an operating system crash or a tape failure. # If no holding disks are specified then all dumps will be written directly # to tape. If a dump is too big to fit on the holding disk than it will be # written directly to tape. If more than one holding disk is specified then # they will all be used based on activity and available space. holdingdisk hd1 { comment "main holding disk" directory "/dumps/amanda" # where the holding disk is use -100 Mb # how much space can we use on it # a non-positive value means: # use all space but that value chunksize 1Gb # size of chunk if you want big dump to be # dumped on multiple files on holding disks # N Kb/Mb/Gb split images in chunks of size N # The maximum value should be # (MAX_FILE_SIZE - 1Mb) # 0 same as INT_MAX bytes } #holdingdisk hd2 { # directory "/dumps2/amanda" # use 1000 Mb # } #holdingdisk hd3 { # directory "/mnt/disk4" # use 1000 Mb # } # If amanda cannot find a tape on which to store backups, it will run # as many backups as it can to the holding disks. In order to save # space for unattended backups, by default, amanda will only perform # incremental backups in this case, i.e., it will reserve 100% of the # holding disk space for the so-called degraded mode backups. # However, if you specify a different value for the `reserve' # parameter, amanda will not degrade backups if they will fit in the # non-reserved portion of the holding disk. # reserve 30 # percent # This means save at least 30% of the holding disk space for degraded # mode backups. # The format for a ColumnSpec is a ',' seperated list of triples. # Each triple consists of # + the name of the column (as in ColumnNameStrings) # + prefix before the column # + the width of the column, if set to -1 it will be recalculated # to the maximum length of a line to print. # Example: # "Disk=1:17,HostName=1:10,OutKB=1:7" # or # "Disk=1:-1,HostName=1:10,OutKB=1:7" # # You need only specify those colums that should be changed from # the default. If nothing is specified in the configfile, the # above compiled in values will be in effect, resulting in an # output as it was all the time. # The names of the colums are: # HostName, Disk, Level, OrigKB, OutKB, Compress, DumpTime, DumpRate, # TapeTime and TapeRate. # ElB, 1999-02-24. # columnspec "Disk=1:18,HostName=0:10,OutKB=1:7" # Amanda needs a few Mb of diskspace for the log and debug files, # as well as a database. This stuff can grow large, so the conf directory # isn't usually appropriate. Some sites use /usr/local/var and some /usr/adm. # Create an amanda directory under there. You need a separate infofile and # logdir for each configuration, so create subdirectories for each conf and # put the files there. Specify the locations below. # Note that, although the keyword below is infofile, it is only so for # historic reasons, since now it is supposed to be a directory (unless # you have selected some database format other than the `text' default) infofile "@CONFIG_DIR@/@DEFAULT_CONFIG@/curinfo" # database DIRECTORY logdir "@CONFIG_DIR@/@DEFAULT_CONFIG@" # log directory indexdir "@CONFIG_DIR@/@DEFAULT_CONFIG@/index" # index directory #tapelist "@CONFIG_DIR@/@DEFAULT_CONFIG@/tapelist" # list of used tapes # tapelist is stored, by default, in the directory that contains amanda.conf # tapetypes # Define the type of tape you use here, and use it in "tapetype" # above. Some typical types of tapes are included here. The tapetype # tells amanda how many MB will fit on the tape, how big the filemarks # are, and how fast the tape device is. # A filemark is the amount of wasted space every time a tape section # ends. # For completeness Amanda should calculate the inter-record gaps too, # but it doesn't. For EXABYTE and DAT tapes this is ok. Anyone using # 9 tracks for amanda and need IRG calculations? Drop me a note if # so. # If you want amanda to print postscript paper tape labels # add a line after the comment in the tapetype of the form # lbl-templ "/path/to/postscript/template/label.ps" # if you want the label to go to a printer other than the default # for your system, you can also add a line above for a different # printer. (i usually add that line after the dumpuser specification) # dumpuser "operator" # the user to run dumps under # printer "mypostscript" # printer to print paper label on # here is an example of my definition for an EXB-8500 # define tapetype EXB-8500 { # ... # lbl-templ "@CONFIG_DIR@/config/lbl.exabyte.ps" # } define tapetype global { part_size 3G part_cache_type none } define tapetype QIC-60 { global comment "Archive Viper" length 60 mbytes filemark 100 kbytes # don't know a better value speed 100 kbytes # dito } define tapetype DEC-DLT2000 { global comment "DEC Differential Digital Linear Tape 2000" length 15000 mbytes filemark 8 kbytes speed 1250 kbytes } # goluboff@butch.Colorado.EDU # in amanda-users (Thu Dec 26 01:55:38 MEZ 1996) define tapetype DLT { global comment "DLT tape drives" length 20000 mbytes # 20 Gig tapes filemark 2000 kbytes # I don't know what this means speed 1536 kbytes # 1.5 Mb/s } define tapetype SURESTORE-1200E { global comment "HP AutoLoader" length 3900 mbytes filemark 100 kbytes speed 500 kbytes } define tapetype EXB-8500 { global comment "Exabyte EXB-8500 drive on decent machine" length 4200 mbytes filemark 48 kbytes speed 474 kbytes } define tapetype EXB-8200 { global comment "Exabyte EXB-8200 drive on decent machine" length 2200 mbytes filemark 2130 kbytes speed 240 kbytes } define tapetype HP-DAT { global comment "DAT tape drives" # data provided by Rob Browning length 1930 mbytes filemark 111 kbytes speed 468 kbytes } define tapetype DAT { global comment "DAT tape drives" length 1000 mbytes # these numbers are not accurate filemark 100 kbytes # but you get the idea speed 100 kbytes } define tapetype MIMSY-MEGATAPE { global comment "Megatape (Exabyte based) drive through Emulex on Vax 8600" length 2200 mbytes filemark 2130 kbytes speed 170 kbytes # limited by the Emulex bus interface, ugh } define tapetype SEAGATE-ULTRIUM-LTO { global comment "SEAGATE ULTRIUM 06242 LTO, compression off" length 99584 mbytes filemark 0 kbytes speed 11288 kps } # dumptypes # # These are referred to by the disklist file. The dumptype specifies # certain parameters for dumping including: # auth - authentication scheme to use between server and client. # Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local", # "rsh" and "ssh". # Default: [auth "bsdtcp"] # comment - just a comment string # comprate - set default compression rate. Should be followed by one or # two numbers, optionally separated by a comma. The 1st is # the full compression rate; the 2nd is the incremental rate. # If the second is omitted, it is assumed equal to the first. # The numbers represent the amount of the original file the # compressed file is expected to take up. # Default: [comprate 0.50, 0.50] # compress - specify compression of the backed up data. Valid values are: # "none" - don't compress the dump output. # "client best" - compress on the client using the best (and # probably slowest) algorithm. # "client fast" - compress on the client using fast algorithm. # "client custom" - compress using your custom client compression program. # use client_custom_compress "PROG" to specify # the custom compression program. # PROG must not contain white space. # "server best" - compress on the tape host using the best (and # probably slowest) algorithm. # "server fast" - compress on the tape host using a fast # algorithm. This may be useful when a fast # tape host is backing up slow clients. # "server custom" - compress using your server custom compression program. # use server_custom_compress "PROG" to specify # the custom compression program. # PROG must not contain white space. # Default: [compress client fast] # dumpcycle - set the number of days in the dump cycle, ie, set how often a # full dump should be performed. Default: from DUMPCYCLE above # estimate Determine the way AMANDA does it's estimate. # "client" - Use the same program as the dumping program, # this is the most accurate way to do estimates, # but it can take a long time. # "calcsize" - Use a faster program to do estimates, but the # result is less accurate. # "server" - Use only statistics from the previous run to # give an estimate, # it takes only a few seconds but the result is not # accurate if your disk usage changes from day to day. # Default: [client] # encrypt - specify encryption of the backed up data. Valid values are: # "none" - don't encrypt the dump output. # "client" - encrypt on the client using the program specified by # client_encrypt "PROG". # Use client_decrypt_option to specify the decrypt- # parameter, default is "-d". # PROG and decrypt-parameter must not contain white space. # "server" - encrypt on the server using the program specified by # server_encrypt "PROG". # Use server_decrypt_option to specify the decrypt- # parameter, default is "-d". # PROG and decrypt-parameter must not contain white space. # Default: [none] # exclude - specify files and directories to be excluded from the dump. # Useful with gnutar only; silently ignored by dump and samba. # Valid values are: # "pattern" - a shell glob pattern defining which files # to exclude. # gnutar gets --exclude="pattern" # list "filename" - a file (on the client!) containing patterns # re's (1 per line) defining which files to # exclude. # gnutar gets --exclude-from="filename" # Note that the `full pathname' of a file within its # filesystem starts with `./', because of the way amanda runs # gnutar: `tar -C $mountpoint -cf - --lots-of-options .' (note # the final dot!) Thus, if you're backing up `/usr' with a # diskfile entry like ``host /usr gnutar-root', but you don't # want to backup /usr/tmp, your exclude list should contain # the pattern `./tmp', as this is relative to the `/usr' above. # Please refer to the man-page of gnutar for more information. # If a relative pathname is specified as the exclude list, # it is searched from within the directory that is # going to be backed up. # Default: include all files # holdingdisk - should the holding disk be used for this dump. Useful for # dumping the holding disk itself. Default: [holdingdisk auto] # "never" - Never use the holding disk. # "auto" - Use the holding disk if possible. # "required" - Always use the holding disk. # ignore - do not back this filesystem up. Useful for sharing a single # disklist in several configurations. # index - keep an index of the files backed up. Default: [index no] # kencrypt - encrypt the data stream between the client and server. # Default: [kencrypt no] # maxdumps - max number of concurrent dumps to run on the client. # Default: [maxdumps 1] # maxpromoteday - max number of day for a promotion, set it 0 if you don't # want promotion, set it to 1 or 2 if your disk get # overpromoted. # Default: [10000] # priority - priority level of the dump. Valid levels are "low", "medium" # or "high". These are really only used when Amanda has no # tape to write to because of some error. In that "degraded # mode", as many incrementals as will fit on the holding disk # are done, higher priority first, to insure the important # disks are at least dumped. Default: [priority medium] # program - specify the dump system to use. Valid values are "DUMP", # or "GNUTAR". Default: [program "DUMP"]. # record - record the backup in the time-stamp-database of the backup # program (e.g. /etc/dumpdates for DUMP or # @GNUTAR_LISTED_INCREMENTAL_DIRX@ for GNUTAR.). # Default: [record yes] # skip-full - skip the disk when a level 0 is due, to allow full backups # outside Amanda, eg when the machine is in single-user mode. # skip-incr - skip the disk when the level 0 is NOT due. This is used in # archive configurations, where only full dumps are done and # the tapes saved. # starttime - delay the start of the dump? Default: no delay # strategy - set the dump strategy. Valid strategies are currently: # "standard" - the standard one. # "nofull" - do level 1 dumps every time. This can be used, # for example, for small root filesystems that # only change slightly relative to a site-wide # prototype. Amanda then backs up just the # changes. # "noinc" - do level 0 dumps every time. # "skip" - skip all dumps. Useful for sharing a single # disklist in several configurations. # "incronly" - do only incremental dumps. This is similar # to strategy 'nofull', but will increase # the dump level as usual. Full dumps will # only be performed when an 'amadmin force' # has been issued # Default: [strategy standard] # # Note that you may specify previously defined dumptypes as a shorthand way of # defining parameters. define dumptype global { comment "Global definitions" # This is quite useful for setting global parameters, so you don't have # to type them everywhere. All dumptype definitions in this sample file # do include these definitions, either directly or indirectly. # There's nothing special about the name `global'; if you create any # dumptype that does not contain the word `global' or the name of any # other dumptype that contains it, these definitions won't apply. # Note that these definitions may be overridden in other # dumptypes, if the redefinitions appear *after* the `global' # dumptype name. # You may want to use this for globally enabling or disabling # indexing, recording, etc. Some examples: # index yes # record no # auth "bsdtcp" } define dumptype always-full { global comment "Full dump of this filesystem always" compress none priority high dumpcycle 0 } # Dumptypes for gnutar define dumptype root-tar { global program "GNUTAR" comment "root partitions dumped with tar" compress none index # exclude list "@CONFIG_DIR@/exclude.gtar" priority low } define dumptype user-tar { root-tar comment "user partitions dumped with tar" priority medium } define dumptype user-tar-span { root-tar comment "tape-spanning user partitions dumped with tar" priority medium } define dumptype high-tar { root-tar comment "partitions dumped with tar" priority high } define dumptype comp-root-tar { root-tar comment "Root partitions with compression" compress client fast } define dumptype comp-user-tar { user-tar compress client fast } define dumptype comp-user-tar-span { user-tar-span compress client fast } define dumptype holding-disk { global comment "The master-host holding disk itself" holdingdisk never # do not use the holding disk priority medium } define dumptype comp-user { global comment "Non-root partitions on reasonably fast machines" compress client fast priority medium } define dumptype comp-user-span { global comment "Tape-spanning non-root partitions on reasonably fast machines" compress client fast priority medium } define dumptype nocomp-user { comp-user comment "Non-root partitions on slow machines" compress none } define dumptype nocomp-user-span { comp-user-span comment "Tape-spanning non-root partitions on slow machines" compress none } define dumptype comp-root { global comment "Root partitions with compression" compress client fast priority low } define dumptype nocomp-root { comp-root comment "Root partitions without compression" compress none } define dumptype comp-high { global comment "very important partitions on fast machines" compress client best priority high } define dumptype nocomp-high { comp-high comment "very important partitions on slow machines" compress none } define dumptype nocomp-test { global comment "test dump without compression, no /etc/dumpdates recording" compress none record no priority medium } define dumptype comp-test { nocomp-test comment "test dump with compression, no /etc/dumpdates recording" compress client fast } define dumptype custom-compress { global program "GNUTAR" comment "custom client compression dumped with tar" compress client custom client_custom_compress "/usr/bin/bzip2" } define dumptype server-encrypt-fast { global program "GNUTAR" comment "fast client compression and server symmetric encryption" compress client fast encrypt server server_encrypt "/usr/sbin/amcrypt" server_decrypt_option "-d" } define dumptype client-encrypt-nocomp { global program "GNUTAR" comment "no compression and client symmetric encryption" compress none encrypt client client_encrypt "/usr/sbin/amcrypt" client_decrypt_option "-d" } # To use gpg public-key encryption, gpg does compress with zlib by default. # Thus, no need to specify compress #define dumptype gpg-encrypt { # global # program "GNUTAR" # comment "server public-key encryption, dumped with tar" # compress none # encrypt server # server_encrypt "/usr/sbin/amgpgcrypt" # server_decrypt_option "-d" #} # network interfaces # # These are referred to by the disklist file. They define the attributes # of the network interface that the remote machine is accessed through. # Notes: - netusage above defines the attributes that are used when the # disklist entry doesn't specify otherwise. # - the values below are only samples. # - specifying an interface does not force the traffic to pass # through that interface. Your OS routing tables do that. This # is just a mechanism to stop Amanda trashing your network. # Attributes are: # use - bandwidth above which amanda won't start # backups using this interface. Note that if # a single backup will take more than that, # amanda won't try to make it run slower! define interface local { comment "a local disk" use 8000 kbps } #define interface le0 { # comment "10 Mbps ethernet" # use 400 kbps #} #define application-tool and dumptype for the amgtar application define application-tool app_amgtar { comment "amgtar" plugin "amgtar" #property "GNUTAR-PATH" "/path/to/gtar" #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" #default from gnutar_list_dir setting in amanda-client.conf } define dumptype dt_amgtar { program "APPLICATION" application "app_amgtar" } #define application-tool and dumptype for the amstar application define application-tool app_amstar { comment "amstar" plugin "amstar" #property "STAR-PATH" "/path/to/star" #property "STAR-TARDUMP" "/path/to/tardumps" # default /etc/tardumps #property "STAR-DLE-TARDUMP" "no" # if 'yes' then create a different tardump file for each DLE, # it is required if you do many dump in parallel (maxdump>1) } define dumptype dt_amstar { program "APPLICATION" application "app_amstar" } #define a script-tool to send an email define script-tool sc-email { comment "script-email" plugin "script-email" execute_on pre-dle-amcheck, pre-host-amcheck, post-dle-amcheck, post-host-amcheck, pre-dle-estimate, pre-host-estimate, post-dle-estimate, post-host-estimate, pre-dle-backup, pre-host-backup, post-dle-backup, post-host-backup execute_where server # or client property "mailto" "martinea" } #your dumptype must include: script "sc-email" #to use the script define interactivity inter_tty { plugin "tty" } define interactivity inter_email { plugin "email" property "mailto" "admin1" "admin2" property "resend-delay" "10" property "check-file" "/tmp/email_input" property "check-file-delay" "10" } define interactivity inter_tty_email { plugin "tty_email" property "mailto" "admin1" "admin2" property "resend-delay" "10" property "check-file" "/tmp/email_input" property "check-file-delay" "10" } interactivity "inter_tty_email" define taperscan taper_traditional { comment "traditional" plugin "traditional" } define taperscan taper_oldest { comment "oldest" plugin "oldest" } define taperscan taper_lexical { comment "lexical" plugin "lexical" } taperscan "taper_lexical" # You may include other amanda configuration files, so you can share # dumptypes, tapetypes and interface definitions among several # configurations. #includefile "@CONFIG_DIR@/amanda.conf.main" amanda-3.3.6/example/amanda-client-postgresql.conf.in0000664000076400007640000000354312357250001024245 0ustar00martineamartinea00000000000000# amanda-postgresql.conf - sample Amanda client configuration file for Oracle agent. # # This file normally goes in @CONFIG_DIR@/amanda-client.conf. # conf "@DEFAULT_CONFIG@" # your config name index_server "@DEFAULT_SERVER@" # your amindexd server tape_server "@DEFAULT_TAPE_SERVER@" # your amidxtaped server #tapedev "@EXAMPLE_TAPEDEV@" # your tape device # if not set, Use configure or ask server. # if set to empty string "", ask server # amrecover will use the changer if set to the value # of 'amrecover_changer' in the server amanda.conf. # auth - authentication scheme to use between server and client. # Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local", # "rsh" and "ssh". # Default: [auth "bsdtcp"] auth "bsdtcp" # your ssh keys file if you use ssh auth ssh_keys "/var/lib/amanda/.ssh/id_rsa_amrecover" # Use /etc/amanda/pgpassfile for authentication credentials # (Note: for PostgreSQL 8.0.x, you must use PG-PASSWORD instead) # Should contain an appropriate line for foo (below).Example: # localhost:*:*:amandabackup:my_backup_password # The file must be owned by the Amanda user with permissions 0600 property "PG-PASSFILE" "/etc/amanda/pgpassfile" # For diskname "foo"... # Connect to localhost property "foo-PG-HOST" "localhost" # Connect to port 5432 (PostgreSQL's default) property "foo-PG-PORT" "5432" # Connect as user amandabackup (Note: must be a superuser) property "foo-PG-USER" "amandabackup" # Connect to database template1 (exists by default) property "foo-PG-DB" "template1" # Database's data directory property "foo-PG-DATADIR" "/var/postgresql/data" # Directory that archive_command (in postgresql.conf) copies WAL files to. # For this example: # archive_command = 'test ! -f /var/postgresql/archive/%f && cp %p /var/postgresql/archive/%f' property "foo-PG-ARCHIVEDIR" "/var/postgresql/archive" amanda-3.3.6/example/disklist0000664000076400007640000000624412357250001017645 0ustar00martineamartinea00000000000000# sample Amanda2 disklist file, derived from CS.UMD.EDU's disklist # # If your configuration is called, say, "csd2", then this file normally goes # in /etc/amanda/csd2/disklist. # # File format is: # # hostname diskdev dumptype [spindle [interface]] # # where the dumptypes are defined by you in amanda.conf or in-line. # At our site, root partitions have a different dumptype because they # are of lower priority; they don't contain user data, and don't change # much from the department prototype. In a crunch, they can be left for # last or skipped. # A SPARCstation 1+ salty sd0a comp-root salty sd0g comp-user salty sd1g comp-user salty sd2a comp-root salty sd2g comp-user salty sd3c comp-user # A DECstation 3100 slithy rz1a comp-root slithy rz1g comp-user slithy rz3a comp-root slithy rz3g comp-user # We don't run compression on the master host since it is going to be # busy enough running amanda. master sd0a nocomp-root -1 local master sd0g nocomp-user -1 local # note: -1 is a placeholder for the spindle number # the holding disk can't be dumped to itself, it uses a disktype that # specifies the "no-hold" option (see amanda.conf). master sd1c holding-disk -1 local # Compress data from a slow server on the tape server. # Example of inline dumptype specialization slowsrv / { # the line break here is mandatory root-tar # copy properties of root-tar compress server fast # but change the compression mode } # spindle and interface omitted here slowsrv /usr { user-tar exclude list ".exclude" compress server fast } 2 le0 # no line break before spindle and interface # The chairman's disk is high priority to make sure it gets done. bigwig sd0a comp-root bigwig sd0g comp-high # Likewise the named databases in the root partition on our primary # nameserver. Also, compression is turned off because we don't want # to create any unnecessary load on this baby (it's only a Sun3). bozo sd0a nocomp-high bozo sd0g nocomp-user bozo sd4c nocomp-user # Dump Joe's NetBSD machine, with the mounted MS-DOS partition dumped # using tar. joespc wd0a comp-root joespc wd0e comp-user joespc /msdos comp-user-tar # Some really slow machines, like Sun2's and some Vaxstations, take # forever to compress their dumps: it's just not worth it. # A Sun2 cleo sd0a nocomp-root cleo sd0g nocomp-user # A VaxStation susie rz8a nocomp-root susie rz8g nocomp-user # An example of how to separate a big disk (/diskA) in multiple smaller entry # using GNUTAR. # I suggest to always use the diskdevice in the diskname. # Don't forget to use the same spindle for all entry. hosta /diskA/all /diskA { # all directories except the one that start with [a-u] high-tar exclude "./[a-u]*" } 1 hosta /diskA/ag /diskA { # all directories that start with [a-g] except big1 and big2 high-tar include "./[a-g]*" exclude "./big1" "./big2" } 1 hosta /diskA/big /diskA { # directories big1 and big2 high-tar include "./big1" "./big2" } 1 hosta /diskA/gm /diskA { # all directories that start with [h-m] high-tar include "./[h-m]*" } 1 hosta /diskA/nu /diskA { # all directories that start with [n-u] high-tar include "./[n-u]*" } 1 # and so on ... well, you get the idea amanda-3.3.6/example/HP-DAT.ps0000664000076400007640000001227712357250001017360 0ustar00martineamartinea00000000000000%! %%BoundingBox: 25 25 290 900 %%Title: AMANDA ExaLabel %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create PostScript tape %%%% labels for each dump. This file is set up for DAT 4mm tapes, %%%% but you can edit it to work with anything. %%%% %%%% NOTE: this is quick-hack for DAT TAPES; it is simply a scaled %%%% version of the Exabyte version. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +------------------------+ % |statistics | <- section 'A' % +----+-------------------+ % |logo| TAPE_NAME | <- section 'B' (logo) <- section 'F' % | | version date | <- section 'C' % +----+--+--------+-------+ % | h fs l | h fs l | <- section 'D' % +-------+--------+-------+ % | | | <- section 'E' % | | | % v v v % % Sections D and E, which hold the bulk of the information are % cut into columns. % % Quick-hack for DAT tapes % .78 .75 scale % section 'A' font, start position, and line separation % /StatFont { /Courier findfont 9 scalefont setfont } def /StatPos { 40 740 } def /StatSep { 8 } def % section 'B' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 24 scalefont setfont } def /TitlePos { 180 685 } def % section 'C' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 10 scalefont setfont } def /DatePos { 280 670 } def /VersFont { /Palatino-Bold findfont 10 scalefont setfont } def /VersPos { 80 670 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 8 scalefont setfont } def /HeadingHostPos { 5 650 } def /HeadingFsPos { 45 650 } def /HeadingLvlPos { 120 650 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 6 scalefont setfont } def /HostSep { 6 } def % the following rectangles separate the regions % /StatBox { 290 750 25 710 } def /TitleBox { 290 710 25 665 } def /LogoBox { 70 710 25 665 } def /HeadingBox { 290 665 25 645 } def /HostBox { 290 645 25 0 } def % number of columns for section 'E,' column width, position of first % entry in first column, y coordinate of top and bottom of dividing lines % /NumColumns { 2 } def /ColumnWidth { 132 } def /ColumnBasePos { 25 633 } def /TopColDivLine { 665 } def /BotColDivLine { 0 } def %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 20 translate % draw all of the boxes % 0 setgray 2 setlinewidth % thick lines StatBox box stroke TitleBox box stroke LogoBox box stroke HeadingBox box stroke HostBox box stroke % draw the column dividers % 0.5 setlinewidth % thin lines /i 1 def { NumColumns i sub 0 le { exit } if % no lines if this last col. /xoff ColumnBasePos pop % get x base position i ColumnWidth mul add def % offset for this column xoff TopColDivLine moveto xoff BotColDivLine lineto stroke /i i 1 add def } loop % draw the heading names % /i 0 def HeadingFont { NumColumns i sub 0 le { exit } if /xoff ColumnBasePos pop i ColumnWidth mul add def HeadingHostPos exch xoff add exch moveto (Host) show HeadingFsPos exch xoff add exch moveto (Fs) show HeadingLvlPos exch xoff add exch moveto (Lv) show /i i 1 add def } loop % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def ColumnBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def % DrawHost expects five strings to be on the stack; right now it % uses only the first three. The strings are Host Name, Partition Name, % Dump Level, Tape File Number, and Output Size. % /DrawHost { HostFont pop pop pop % discard sizes and fileno CurrColumnX HeadingLvlPos pop add CurrColumnY moveto show CurrColumnX HeadingFsPos pop add CurrColumnY moveto show CurrColumnX HeadingHostPos pop add CurrColumnY moveto show /CurrColumnY CurrColumnY HostSep sub def CurrColumnY BotColDivLine lt { /CurrColumnY ColumnBasePos exch pop def /CurrColumnX CurrColumnX ColumnWidth add def } if } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/DLT.ps0000664000076400007640000001222412357250001017056 0ustar00martineamartinea00000000000000%! %%BoundingBox: 25 25 290 900 %%Title: AMANDA ExaLabel %%Creator: AMANDA genlabel program %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create PostScript tape %%%% labels for each dump. This file is set up for DLT tapes, %%%% but you can edit it to work with anything. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +------------------------+ % |statistics | <- section 'A' % +----+-------------------+ % |logo| TAPE_NAME | <- section 'B' (logo) <- section 'F' % | | version date | <- section 'C' % +----+--+--------+-------+ % |h fs l|h fs l|h fs l| <- section 'D' % +-------+--------+-------+ % | | | | <- section 'E' % | | | | % v v v v % % Sections D and E, which hold the bulk of the information are % cut into columns. % % section 'A' font, start position, and line separation % /StatFont { /Courier findfont 10 scalefont setfont } def /StatPos { 40 738 } def /StatSep { 15 } def % section 'B' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 28 scalefont setfont } def /TitlePos { 180 635 } def % section 'C' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 10 scalefont setfont } def /DatePos { 310 610 } def /VersFont { /Palatino-Bold findfont 10 scalefont setfont } def /VersPos { 80 610 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 8 scalefont setfont } def /HeadingLvlPos { 90 590 } def % Heading is right justified /HeadingHostPos { 2 590 } def /HeadingFsPos { 30 590 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 5 scalefont setfont } def /HostSep { 5 } def % the following rectangles separate the regions % /StatBox { 320 755 25 680 } def /TitleBox { 320 680 25 605 } def /LogoBox { 70 680 25 605 } def /HeadingBox { 320 605 25 580 } def /HostBox { 320 580 25 0 } def % number of columns for section 'E,' column width, position of first % entry in first column, y coordinate of top and bottom of dividing lines % /NumColumns { 3 } def /ColumnWidth { 98 } def /ColumnBasePos { 25 568 } def /TopColDivLine { 605 } def /BotColDivLine { 0 } def %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 20 translate % draw all of the boxes % 0 setgray 2 setlinewidth % thick lines StatBox box stroke TitleBox box stroke LogoBox box stroke HeadingBox box stroke HostBox box stroke % draw the column dividers % 0.5 setlinewidth % thin lines /i 1 def { NumColumns i sub 0 le { exit } if % no lines if this last col. /xoff ColumnBasePos pop % get x base position i ColumnWidth mul add def % offset for this column xoff TopColDivLine moveto xoff BotColDivLine lineto stroke /i i 1 add def } loop % draw the heading names % /i 0 def HeadingFont { NumColumns i sub 0 le { exit } if /xoff ColumnBasePos pop i ColumnWidth mul add def HeadingLvlPos exch xoff add exch moveto (Lv) stringwidth pop neg 0 rmoveto (Lv) show HeadingHostPos exch xoff add exch moveto (Host) show HeadingFsPos exch xoff add exch moveto (Fs) show /i i 1 add def } loop % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def ColumnBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def % DrawHost expects five strings to be on the stack. The strings are % Host Name, Partition Name, Dump Level, Tape File Number, and Output Size. % Right now, the Output Size and file umber are discarded. % /DrawHost { HostFont pop pop pop % discard sizes and fileno CurrColumnX HeadingLvlPos pop add CurrColumnY moveto show CurrColumnX HeadingFsPos pop add CurrColumnY moveto show CurrColumnX HeadingHostPos pop add CurrColumnY moveto show /CurrColumnY CurrColumnY HostSep sub def CurrColumnY BotColDivLine lt { /CurrColumnY ColumnBasePos exch pop def /CurrColumnX CurrColumnX ColumnWidth add def } if } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/amanda-client.conf.in0000664000076400007640000000144612357250001022044 0ustar00martineamartinea00000000000000# # amanda-client.conf - sample Amanda client configuration file. # # This file normally goes in @CONFIG_DIR@/amanda-client.conf. # conf "@DEFAULT_CONFIG@" # your config name index_server "@DEFAULT_SERVER@" # your amindexd server tape_server "@DEFAULT_TAPE_SERVER@" # your amidxtaped server tapedev "@EXAMPLE_TAPEDEV@" # your tape device # if not set, Use configure or ask server. # if set to empty string "", ask server # amrecover will use the changer if set to the value # of 'amrecover_changer' in the server amanda.conf. # auth - authentication scheme to use between server and client. # Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local", # "rsh" and "ssh". # Default: [auth "bsdtcp"] auth "bsdtcp" ssh_keys "" # your ssh keys file if you use ssh auth amanda-3.3.6/example/inetd.conf.amandaserver.in0000664000076400007640000000015512357250001023115 0ustar00martineamartinea00000000000000amanda stream tcp nowait amandabackup @amlibexecdir@/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped amanda-3.3.6/example/DLT-A4.ps0000664000076400007640000001321012357250001017314 0ustar00martineamartinea00000000000000%! %%BoundingBox: 0 0 595 842 %%Title: AMANDA ExaLabel %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create PostScript tape %%%% labels for each dump. This file is set up for DAT 4mm tapes, %%%% but you can edit it to work with anything. %%%% %%%% NOTE: this is quick-hack for DAT TAPES; it is simply a scaled %%%% version of the Exabyte version. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +------------------------+ % |statistics | <- section 'A' % +----+-------------------+ % |logo| TAPE_NAME | <- section 'B' (logo) <- section 'F' % | | version date | <- section 'C' % +----+--+--------+-------+ % | h fs l | h fs l | <- section 'D' % +-------+--------+-------+ % | | | <- section 'E' % | | | % v v v % % Sections D and E, which hold the bulk of the information are % cut into columns. % % Quick-hack for DAT tapes % 72 25.4 div dup scale %% scale to millimeters % section 'A' font, start position, and line separation % /StatFont { /Courier findfont 4.5 scalefont setfont } def /StatPos { 30 255 } def /StatSep { 4 } def % section 'B' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 10 scalefont setfont } def /TitlePos { 115 230 } def % section 'C' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 5 scalefont setfont } def /DatePos { 190 222 } def /VersFont { /Palatino-Bold findfont 5 scalefont setfont } def /VersPos { 43 222 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 5 scalefont setfont } def /HeadingHostPos { 1 212 } def /HeadingFsPos { 17 212 } def /HeadingLvlPos { 57 212 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 2.6 scalefont setfont } def /HostSep { 2.5 } def % the following rectangles separate the regions % /StatBox { 200 260 15 240 } def /TitleBox { 200 240 15 220 } def /LogoBox { 35 240 15 220 } def /HeadingBox { 200 220 15 210 } def /HostBox { 200 210 15 0 } def % Punckmark marks center of page height to aid punching holes for ring binder /PunchMark { 13 130 15 130 } def % number of columns for section 'E,' column width, position of first % entry in first column, y coordinate of top and bottom of dividing lines % /NumColumns { 3 } def /ColumnWidth { 60 } def /ColumnBasePos { 16 200 } def /TopColDivLine { 201 } def /BotColDivLine { 2 } def % 5 %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 19 translate % draw all of the boxes % 0 setgray .3 setlinewidth % thick lines StatBox box stroke TitleBox box stroke LogoBox box stroke HeadingBox box stroke HostBox box stroke % and the PunchMark to aid puching ring binder holes PunchMark box stroke % draw the column dividers % 0.2 setlinewidth % thin lines /i 1 def { NumColumns i sub 0 le { exit } if % no lines if this last col. /xoff ColumnBasePos pop % get x base position i ColumnWidth mul add def % offset for this column xoff TopColDivLine moveto xoff BotColDivLine lineto stroke /i i 1 add def } loop % draw the heading names % /i 0 def HeadingFont { NumColumns i sub 0 le { exit } if /xoff ColumnBasePos pop i ColumnWidth mul add def HeadingHostPos exch xoff add exch moveto (Host) show HeadingFsPos exch xoff add exch moveto (Fs) show HeadingLvlPos exch xoff add exch moveto (*) show /i i 1 add def } loop % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def ColumnBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def /StripDomain { (.) search { 3 1 roll pop pop } if } def /TrimFs { dup length 25 gt { dup (* ) dup 4 2 roll length 24 sub 24 getinterval 1 exch putinterval } if } def % DrawHost expects five strings to be on the stack; right now it % uses only the first three. The strings are Host Name, Partition Name, % Dump Level, Tape File Number, and Output Size. % /DrawHost { HostFont pop pop pop % discard sizes and fileno CurrColumnX HeadingLvlPos pop add CurrColumnY moveto show CurrColumnX HeadingFsPos pop add CurrColumnY moveto TrimFs show CurrColumnX HeadingHostPos pop add CurrColumnY moveto StripDomain show /CurrColumnY CurrColumnY HostSep sub def CurrColumnY BotColDivLine lt { /CurrColumnY ColumnBasePos exch pop def /CurrColumnX CurrColumnX ColumnWidth add def } if } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/EXB-8500.ps0000664000076400007640000001221612357250001017444 0ustar00martineamartinea00000000000000%! %%BoundingBox: 25 25 290 900 %%Title: AMANDA ExaLabel %%Creator: AMANDA genlabel program %%Pages: 1 %%EndComments %%%% %%%% This is a template file used by AMANDA to create PostScript tape %%%% labels for each dump. This file is set up for Exabyte 8mm tapes, %%%% but you can edit it to work with anything. %%%% % % The label is made up of 6 parts: statistics, tape name, date, % header, filesystem list, and the logo. Geometrically, the label % looks like this: % % +------------------------+ % |statistics | <- section 'A' % +----+-------------------+ % |logo| TAPE_NAME | <- section 'B' (logo) <- section 'F' % | | version date | <- section 'C' % +----+--+--------+-------+ % | h fs l| h fs l | h fs l| <- section 'D' % +-------+--------+-------+ % | | | | <- section 'E' % | | | | % v v v v % % Sections D and E, which hold the bulk of the information are % cut into columns. % % section 'A' font, start position, and line separation % /StatFont { /Courier findfont 9 scalefont setfont } def /StatPos { 40 740 } def /StatSep { 8 } def % section 'B' font and position (text centered around this point) % /TitleFont { /Helvetica-Bold findfont 24 scalefont setfont } def /TitlePos { 180 685 } def % section 'C' font, position of the date (left justified) and the version % /DateFont { /Palatino-Bold findfont 10 scalefont setfont } def /DatePos { 280 670 } def /VersFont { /Palatino-Bold findfont 10 scalefont setfont } def /VersPos { 80 670 } def % section 'D' font, and field positions (x coord is relative to each column) % /HeadingFont { /Palatino-Bold findfont 8 scalefont setfont } def /HeadingLvlPos { 126 650 } def % Heading is right justified /HeadingHostPos { 5 650 } def /HeadingFsPos { 45 650 } def % section 'E' font, and line separation % /HostFont { /Courier findfont 6 scalefont setfont } def /HostSep { 6 } def % the following rectangles separate the regions % /StatBox { 290 750 25 710 } def /TitleBox { 290 710 25 665 } def /LogoBox { 70 710 25 665 } def /HeadingBox { 290 665 25 645 } def /HostBox { 290 645 25 0 } def % number of columns for section 'E,' column width, position of first % entry in first column, y coordinate of top and bottom of dividing lines % /NumColumns { 2 } def /ColumnWidth { 132 } def /ColumnBasePos { 25 633 } def /TopColDivLine { 665 } def /BotColDivLine { 0 } def %%%% %%%% END OF USER-CONFIGURABLE OPTIONS %%%% %%%% the rest of this file contains the internal functions that are used %%%% by genlabel to draw the label %%%% % % Initial Setup... draws everything that is the same for all labels % % function to draw a box % /box { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto llx ury lineto urx ury lineto urx lly lineto closepath } def % move the origin up a bit % 0 20 translate % draw all of the boxes % 0 setgray 2 setlinewidth % thick lines StatBox box stroke TitleBox box stroke LogoBox box stroke HeadingBox box stroke HostBox box stroke % draw the column dividers % 0.5 setlinewidth % thin lines /i 1 def { NumColumns i sub 0 le { exit } if % no lines if this last col. /xoff ColumnBasePos pop % get x base position i ColumnWidth mul add def % offset for this column xoff TopColDivLine moveto xoff BotColDivLine lineto stroke /i i 1 add def } loop % draw the heading names % /i 0 def HeadingFont { NumColumns i sub 0 le { exit } if /xoff ColumnBasePos pop i ColumnWidth mul add def HeadingLvlPos exch xoff add exch moveto (Lv) stringwidth pop neg 0 rmoveto (Lv) show HeadingHostPos exch xoff add exch moveto (Host) show HeadingFsPos exch xoff add exch moveto (Fs) show /i i 1 add def } loop % % the following functions draw strings for each kind of information % /CurrStatY StatPos exch pop def ColumnBasePos /CurrColumnY exch def /CurrColumnX exch def % DrawStat draws the string on the top of the stack in the next position % in section 'A' % /DrawStat { StatFont StatPos pop CurrStatY moveto show /CurrStatY CurrStatY StatSep sub def } def % DrawTitle draws the string on the top of the stack in section 'B' % /DrawTitle { TitleFont TitlePos moveto dup stringwidth pop 2 div neg 0 rmoveto show } def % DrawDate draws the string on the top of the stack in section 'C' % /DrawDate { DateFont DatePos moveto dup stringwidth pop neg 0 rmoveto show } def % DrawVers draws the string on the top of the stack in section 'C' % /DrawVers { VersFont VersPos moveto show } def % DrawHost expects five strings to be on the stack. The strings are % Host Name, Partition Name, Dump Level, Tape File Number, and Output Size. % Right now, the Output Size is discarded. % /DrawHost { HostFont pop pop pop % discard sizes and fileno CurrColumnX HeadingLvlPos pop add CurrColumnY moveto show CurrColumnX HeadingFsPos pop add CurrColumnY moveto show CurrColumnX HeadingHostPos pop add CurrColumnY moveto show /CurrColumnY CurrColumnY HostSep sub def CurrColumnY BotColDivLine lt { /CurrColumnY ColumnBasePos exch pop def /CurrColumnX CurrColumnX ColumnWidth add def } if } def %%%% %%%% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/3hole.ps0000664000076400007640000005176512357250001017462 0ustar00martineamartinea00000000000000%! %%BoundingBox: 25 25 290 900 %%Title: AMANDA Full Page Label %%Creator: Amanda reporter %%Pages: 1 %%EndComments %%%% %% This template file is used by AMANDA to create PostScript dump log %% listings for each run suitable for three-hole punching. %% %% This prologue is based on one from Steven Freed %% called 8.5x11.ps and was enhanced with assistance from Dale Talcott %% . %% %% John R. Jackson, Technical Software Specialist, jrj@purdue.edu %%%% /pageSave save def %%% % If you are printing duplex, change the 0 to a 1 in the following line: %%% /DoDuplex 0 def %%% % The following string (inside the parenthesis) will be displayed as % the "Location" (e.g. organization) on each page (see the page format % below). %%% /LocationString (Magic Software Development, Inc.) def %%% % Set the margin widths. This may need adjustment based on how your % printer defines the printable area on a page. %%% /inch { 72 mul % one inch == 72 points } def /mm { 25.4 div % one inch == 25.4 mm inch % convert inches to points } def /TopMargin 0.25 inch def /BottomMargin 0.25 inch def /OddLeftMargin 0.625 inch def % 5/8 inch /OddRightMargin 0.25 inch def DoDuplex 0 eq { % even and odd are the same if duplex is not used /EvenLeftMargin OddLeftMargin def /EvenRightMargin OddRightMargin def } { % otherwise they are reversed /EvenLeftMargin OddRightMargin def /EvenRightMargin OddLeftMargin def } ifelse %%% % A page is made up of these parts. The base name of the internal variable % related to each is shown in parenthesis: % % tape name (Title) % page number (Page) % version of Amanda (Vers) % location (e.g. organisation) (Loc) % date (Date) % statistics (about the Amanda run) (Stat) % message (how to do a restore) (Mess) % header for the filesystem list (Heading) % filesystem list (Host) % % Geometrically, an odd numbered page looks like this: % % +----+-------------------+ % | TAPE_NAME page | <- section 'A' % | version location date | <- section 'B' % +------------------------+ % |statistics | message | <- section 'C' | 'F' % +----+--+--------+-------+ % | f# hst fs lvl O-KB C-KB| <- section 'D' % +-------+--------+-------+ % | | | | <- section 'E' % | | | | % v v v v % % Even numbered pages look the same unless DoDuplex is turned on, in % which case the "page" field is on the left and the gutter width for % the punch is on the right (instead of the left). %%% %%% % section 'A' fonts and strings %%% /TitleFontSize 24 def % 24 point Helvetica-Bold /TitleFont /Helvetica-Bold findfont TitleFontSize scalefont def /PageFontSize 11 def % 11 point Palatino-Bold /PageFont /Palatino-Bold findfont PageFontSize scalefont def /PageString1 (Page ) def /PageString2 ( of ) def %%% % section 'B' fonts and strings %%% /VersFontSize 11 def % 11 point Palatino-Bold /VersFont /Palatino-Bold findfont VersFontSize scalefont def /LocFontSize 12 def % 12 point Helvetica-Bold /LocFont /Helvetica-Bold findfont LocFontSize scalefont def /DateFontSize 11 def % 11 point Palatino-Bold /DateFont /Palatino-Bold findfont DateFontSize scalefont def %%% % section 'C' font %%% /StatFontSize 9 def % 9 point Courier /StatFont /Courier findfont StatFontSize scalefont def %%% % section 'D' font and strings %%% /HeadingFontSize 9 def % 9 point Palatino-Bold /HeadingFont /Palatino-Bold findfont HeadingFontSize scalefont def /HeadingFileString (File #) def /HeadingHostString (Host) def /HeadingFsString (File System) def /HeadingLvlString (Level) def /HeadingOSizeString1 (Original) def /HeadingOSizeString2 (File Size (KB)) def /HeadingCSizeString1 (Compressed) def /HeadingCSizeString2 (File Size (KB)) def %%% % section 'E' font %%% /HostFontSize 9 def % 9 point Courier /HostFont /Courier findfont HostFontSize scalefont def %%% % section 'F' font and strings %%% /MessFontSize 9 def % 9 point Courier /MessFont /Courier findfont MessFontSize scalefont def /MessString1 (To restore:) def /MessString2 ( position tape at the start of the file and run:) def /MessString3 ( dd if=$TAPE bs=32k skip=1 | zcat | restore -ibf 2 -) def /MessString4 ( or run:) def /MessString5 ( amrestore -p $TAPE | restore -ibf 2 -) def %%%% %% END OF USER-CONFIGURABLE OPTIONS %% %% The rest of this file contains the internal functions used to draw %% the page and (hopefully) do not need any changes. %%%% /setTitleFont { TitleFont setfont % make TitleFont current } def /setPageFont { PageFont setfont % make PageFont current } def /setVersFont { VersFont setfont % make VersFont current } def /setLocFont { LocFont setfont % make LocFont current } def /setDateFont { DateFont setfont % make DateFont current } def /setStatFont { StatFont setfont % make StatFont current } def /setHeadingFont { HeadingFont setfont % make HeadingFont current } def /setHostFont { HostFont setfont % make HostFont current } def /setMessFont { MessFont setfont % make MessFont current } def %%% % apush -- increase an array size by one and push a value on the end % usage: value array apush array % example: /jj 0 array def % /jj (first) jj apush def % /jj (second) jj apush def % /jj (third) jj apush def %%% /apush { exch % [ array value ] /.apush exch def % save and pop the value % [ array ] aload % [ old ... array ] length % length of the old array % [ old ... length ] 1 add % bump it by one % [ old ... length+1 ] array % create the new array % [ old ... newarray ] .apush exch % [ old ... value newarray ] astore % store the values % [ newarray ] } def %%% % box -- draw a box % usage: llx lly urx ury box - %%% /box { 3 index 2 1 add index moveto 3 index 0 1 add index lineto 1 index 0 1 add index lineto 1 index 2 1 add index lineto pop pop pop pop closepath } def %%% % concat -- join two strings % usage: str1 str2 concat new %%% /concat { exch % str2 str1 dup % str2 str1 length % str2 str1 str1l 2 index % str2 str1 str1l str2 length add string % str2 str1 new dup dup % str2 str1 new new new 4 2 roll % str2 new new str1 new copy % str2 new new (str1) length % str2 new new newl 4 -1 roll % new new newl str2 putinterval % new } bind def %%% % max -- return the max of two numbers % usage: a b max a_or_b %%% /max { 1 index 1 index % [ a b a b ] lt { exch % [ b a ] } if pop } def %%% % Set the basic drawable area width and height. %%% clippath % make the clip area the path pathbbox % and get its bounding box % [ llx lly urx ury ] exch % [ llx lly ury urx ] 4 1 roll % [ urx llx lly ury ] exch sub % total height TopMargin sub BottomMargin sub % minus the margins /PageHeight exch def % [ urx llx ] sub % total width EvenLeftMargin sub EvenRightMargin sub % minus the margins /PageWidth exch def newpath % zap the path %%% % Define rectangles to separate the regions. %%% /TitleBox { 0 % [ llx ] PageHeight % [ llx PageHeight ] TitleFontSize PageFontSize max % 'A' height 2 add % space between 'A' and 'B' 4 add % space below 'B' VersFontSize LocFontSize max DateFontSize max % 'B' height add % 'A' height+space+'B' height sub % [ llx lly ] PageWidth % [ llx lly urx ] PageHeight % [ llx lly urx ury ] } bind def /StatBox { TitleBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 1 roll dup % [ urx llx lly lly ] StatStrings length % number of status lines StatFontSize mul % height of status lines MessStrings length % number of message lines MessFontSize mul % height of message lines max % max height 2 add % space above 4 add % space below sub % [ urx llx ury lly ] exch % [ urx llx lly ury ] 4 -1 roll % [ llx lly ury urx ] exch % [ llx lly urx ury ] } def /CFLine { StatBox % [ llx lly urx ury ] 3 1 roll % [ llx ury lly urx ] pop exch % [ llx lly ury ] 3 -1 roll % [ lly ury llx ] setStatFont 0 StatStrings { stringwidth pop max } forall add (nn) stringwidth pop add % left and right padding dup % [ ly uy x x ] 3 1 roll % [ ly x uy x ] 4 1 roll % [ x ly x uy ] } def /HeadingBox { StatBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 1 roll dup % [ urx llx lly lly ] HeadingFontSize 2 mul % two heading lines 2 add % space above 4 add % space below sub % [ urx llx ury lly ] exch % [ urx llx lly ury ] 4 -1 roll % [ llx lly ury urx ] exch % [ llx lly urx ury ] } def /HostBox { HeadingBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 1 roll 0 % [ urx llx lly 0 ] exch % [ urx llx lly ury ] 4 -1 roll % [ llx lly ury urx ] exch % [ llx lly urx ury ] } def %%% % Compute the center point for the section 'A' title text. %%% /TitlePos { TitleBox % [ llx lly urx ury ] TitleFontSize sub % [ llx lly urx y ] 3 -1 roll % [ llx urx y lly ] pop % [ llx urx y ] 3 1 roll % [ y llx urx ] exch dup % [ y urx llx llx ] 3 -1 roll % [ y llx llx urx ] exch sub 2 div add % [ y x ] exch % [ x y ] } def %%% % Compute the position of the odd page string (right adjusted). %%% /OddPagePos { TitleBox % [ llx lly urx ury ] 4 -2 roll % [ urx ury llx lly ] pop pop % [ x y ] exch % [ y x ] setPageFont (n) stringwidth pop sub % a little padding exch % [ x y ] PageFontSize sub 2 sub % space above } def %%% % Compute the position of the even page string (left adjusted). % Not used if DoDuplex is off. %%% /EvenPagePos { TitleBox % [ llx lly urx ury ] 4 1 roll % [ ury llx lly urx ] pop pop % [ y x ] setPageFont (n) stringwidth pop add % a little padding exch % [ x y ] PageFontSize sub 2 sub % space above } def %%% % Compute the position of the version string. %%% /VersPos { TitleBox % [ llx lly urx ury ] pop pop % [ llx lly ] exch % [ lly llx ] setVersFont (n) stringwidth pop add % a little padding exch % [ x y ] 4 add % space below } def %%% % Compute the position of the location string (centered). %%% /LocPos { TitleBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 -1 roll % [ lly urx llx ] dup % [ lly urx llx llx ] 3 -1 roll % [ lly llx llx urx ] exch sub 2 div add % [ y x ] exch % [ x y ] 4 add % space below } def %%% % Compute the position of the date string (right adjusted). %%% /DatePos { TitleBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 -1 roll % [ lly urx llx ] pop % [ y x ] setDateFont (n) stringwidth pop sub % a little padding exch % [ x y ] 4 add % space below } def %%% % Compute the position of the top status string. %%% /StatPos { StatBox % [ llx lly urx ury ] exch pop % [ llx lly ury ] dup % [ llx lly ury ury ] 3 1 roll % [ llx ury lly ury ] exch sub % [ llx ury box_height ] StatStrings length % number of status lines StatFontSize mul % height of status lines sub 2 div % [ llx ury space_above ] sub StatFontSize sub % [ llx y ] 2 add % space above exch % [ y llx ] setStatFont (n) stringwidth pop add % a little padding exch % [ x y ] } def %%% % Compute the position of the top message string. %%% /MessPos { CFLine % [ lx ly ux uy ] exch pop % [ lx ly uy ] dup % [ lx ly uy uy ] 3 1 roll % [ lx uy ly uy ] exch sub % [ lx uy box_height ] MessStrings length % number of status lines MessFontSize mul % height of status lines sub 2 div % [ lx uy space_above ] sub MessFontSize sub % [ lx y ] 2 add % space above exch % [ y lx ] setMessFont (n) stringwidth pop add % a little padding exch % [ x y ] } def %%% % Compute the heading positions that start at the left. %%% /HeadingFilePos { HeadingBox % [ llx lly urx ury ] pop pop % [ llx lly ] exch % [ y x ] setHeadingFont (n) stringwidth pop add % a little padding dup HeadingFileString stringwidth pop add /HeadingFilePosX exch def % for BuildHost exch % [ x y ] 4 add % space below } def /HeadingHostPos { HeadingFilePos % [ x y ] exch % [ y x ] setHeadingFont (nn) stringwidth pop add % a little padding HeadingFileString stringwidth pop add dup /HeadingHostPosX exch def % for BuildHost exch % [ x y ] } def /HeadingFsPos { HeadingHostPos % [ x y ] exch % [ y x ] setHostFont % use the host font for sizes HostNameWidth add (nn) stringwidth pop add % a little padding dup /HeadingFsPosX exch def % for BuildHost exch % [ x y ] setHeadingFont % leave it in the heading font } def %%% % Compute the heading positions that start at the right (and are right % justified). %%% /HeadingCSizePos2 { HeadingBox % [ llx lly urx ury ] pop % [ llx lly urx ] 3 -1 roll % [ lly urx llx ] pop % [ lly urx ] setHeadingFont (n) stringwidth pop sub % a little padding dup /HeadingCSizePosX exch def % for BuildHost exch % [ x y ] 4 add % space below } def /HeadingCSizePos1 { HeadingCSizePos2 HeadingFontSize add } def /HeadingOSizePos2 { HeadingCSizePos2 % [ x y ] exch % [ y x ] setHeadingFont HeadingCSizeString1 stringwidth pop HeadingCSizeString2 stringwidth pop max % widest string sub % [ y x ] (n) stringwidth pop sub % a little padding dup /HeadingOSizePosX exch def % for BuildHost exch % [ x y ] } def /HeadingOSizePos1 { HeadingOSizePos2 HeadingFontSize add } def /HeadingLvlPos { HeadingOSizePos2 % [ x y ] exch % [ y x ] setHeadingFont HeadingOSizeString1 stringwidth pop HeadingOSizeString2 stringwidth pop max % widest string sub % [ y x ] HeadingLvlString stringwidth pop 2 div sub % set up for centering (n) stringwidth pop sub % a little padding dup /HeadingLvlPosX exch def % for BuildHost exch % [ x y ] } def %%%% %% The following functions save strings for each kind of information %% and handle the calls generated by amreport. %%%% %%% % DrawStat saves a string in the next position for section 'A'. %%% /StatStrings 0 array def /DrawStat { /StatStrings exch % [ /StatStrings value ] StatStrings apush def } def %%% % DrawMess saves a string in the next position for section 'F'. %%% /MessStrings 0 array def /DrawMess { /MessStrings exch % [ /MessStrings value ] MessStrings apush def } def MessString1 DrawMess MessString2 DrawMess MessString3 DrawMess MessString4 DrawMess MessString5 DrawMess %%% % DrawTitle saves the title string. %%% /TitleString () def /DrawTitle { /TitleString exch def } def %%% % DrawDate save the date string. %%% /DateString () def /DrawDate { /DateString exch def } def %%% % DrawLoc saves the location string. Amreport does not generate this % call and the initial value has been set at the start of this file % in the user-changeable area. %%% /DrawLoc { /LocationString exch def } def %%% % DrawVers saves the Amanda version string. %%% /VersionString () def /DrawVers { /VersionString exch def } def %%% % DrawHost expects six strings on the stack: % % Host Name % Partition Name % Dump Level % Tape File Number % Original Size % Compressed Size % % They are saved for processing by the final showpage. %%% /HostStrings 0 array def /HostNameWidth 0 def /DrawHost { setHostFont 5 index % copy of host name stringwidth pop HostNameWidth max /HostNameWidth exch def % find maximum host name width 6 array astore % convert args to an array /HostStrings exch % [ /HostStrings value ] HostStrings apush def } def %%%% %% Functions used during actual page drawing. %%%% %%% % Center a string on the current point. %%% /Center { dup stringwidth pop 2 div neg 0 rmoveto } bind def %%% % Right justify a string on the current point. %%% /RightJustify { dup % [ (str) (str) ] stringwidth pop % [ (str) width ] neg 0 rmoveto } bind def %%% % The main page drawing function called when a new page is started. %%% /PageCount 1 def /BuildPage { % translate to leave room for the margins PageCount 2 mod 1 eq { OddLeftMargin } { EvenLeftMargin } ifelse BottomMargin translate % draw the boxes currentgray % save the gray value 0 setgray % turn off gray currentlinewidth % save the current line width 2 setlinewidth % thick lines StatBox box stroke TitleBox box stroke HeadingBox box stroke HostBox box stroke CFLine moveto lineto stroke setlinewidth % restore the line width setgray % restore the gray value % draw the title setTitleFont TitleString TitlePos moveto Center show % draw the page number string setPageFont PageCount 32 string % big enough for the number cvs % convert the number PageString1 exch concat % (Page NN) PageString2 concat % (Page NN of ) PageMaxString concat % (Page NN of MM) PageCount 2 mod 1 eq { OddPagePos moveto RightJustify } { DoDuplex 0 eq { OddPagePos moveto RightJustify } { EvenPagePos moveto } ifelse } ifelse show /PageCount PageCount 1 add def % bump the page counter % draw the version string setVersFont VersionString VersPos moveto show % draw the location setLocFont LocationString LocPos moveto Center show % draw the date string setDateFont DateString DatePos moveto RightJustify show % draw the status lines setStatFont StatPos /CurrentY exch def StatStrings { exch dup CurrentY moveto exch show /CurrentY CurrentY StatFontSize sub def } forall pop % get rid of the X value % draw the messages setMessFont MessPos /CurrentY exch def MessStrings { exch dup CurrentY moveto exch show /CurrentY CurrentY MessFontSize sub def } forall pop % get rid of the X value % draw the headings setHeadingFont HeadingFilePos moveto HeadingFileString show HeadingHostPos moveto HeadingHostString show HeadingFsPos moveto HeadingFsString show HeadingLvlPos moveto HeadingLvlString Center show HeadingOSizePos1 moveto HeadingOSizeString1 RightJustify show HeadingOSizePos2 moveto HeadingOSizeString2 RightJustify show HeadingCSizePos1 moveto HeadingCSizeString1 RightJustify show HeadingCSizePos2 moveto HeadingCSizeString2 RightJustify show % reset the host position variables HeadingBox % [ llx lly urx ury ] pop pop exch pop % [ lly ] HostFontSize sub /CurrentY exch def } def %%% % Build the host line on the page. %%% /BuildHost { setHostFont HeadingCSizePosX CurrentY moveto RightJustify show % compressed size HeadingOSizePosX CurrentY moveto RightJustify show % original size HeadingFilePosX CurrentY moveto RightJustify show % tape file number HeadingLvlPosX CurrentY moveto show % dump level HeadingFsPosX CurrentY moveto show % file system HeadingHostPosX CurrentY moveto show % host HostCount 0 gt { % if not at end of page currentlinewidth % save the line width .25 setlinewidth % thin lines CurrentY dup % keep this CurrentY HostFontSize 2 add sub /CurrentY exch def % update CurrentY for next host 2 sub % move down a little dup 0 exch % [ y 0 y ] moveto PageWidth exch % [ PageWidth y ] lineto stroke setlinewidth % restore the line width } if } def %%% % Magic time -- the input consists of lots of calls to the /DrawXXX % functions, which gather the text into memory. It ends with a showpage, % which we hook here to do all the real imaging after everything has % been collected. The only reason to do all this is so we can know % how many pages will be generated for the "Page N of M" line. %%% 25 dict begin % emperically enough entries /*showpage /showpage load def % rename showpage to *showpage % in our dictionary /showpage { HostBox % [ llx lly urx ury ] exch pop % [ llx lly ury ] exch sub % [ llx height ] exch pop % [ height ] cvi % idiv requires integers HostFontSize 2 add % space below each line idiv % hosts per page dup /HostMax exch def dup /HostCount exch def % initialize the counter dup % [ HostMax HostMax ] HostStrings length % number of hosts add 1 sub exch idiv % number of pages 32 string cvs /PageMaxString exch def /HavePage 0 def % flag that page is built HostStrings { aload pop % put host strings on the stack HostCount HostMax eq { BuildPage % time to build a new page /HavePage 1 def } if /HostCount HostCount 1 sub def BuildHost % build this host line HostCount 0 le { *showpage % time to dump a page /HavePage 0 def /HostCount HostMax def } if } forall HavePage 1 eq { *showpage % dump the last page } if % Clean up. Ideally this would be in the page epilog, % but reporter.c only emits the "showpage". end % end the dict in which this % showpage redefinition lives pageSave restore % free up memory } def %%% % Normally there would be an "end" here to match the "begin" for our % dictionary, but we want to leave it on top of the dictionary stack % so the final showpage runs our showpage replacement. %%% %%%% %% END OF TEMPLATE FILE %%%% amanda-3.3.6/example/xinetd.amandaclient.in0000664000076400007640000000060312357250001022327 0ustar00martineamartinea00000000000000# default: on # # description: The Amanda backup client should be enabled for systems # which will be backed up by an Amanda backup server. service amanda { disable = no flags = IPv4 socket_type = stream protocol = tcp wait = no user = amandabackup group = disk groups = yes server = @amlibexecdir@/amandad server_args = -auth=bsdtcp amdump } amanda-3.3.6/example/inetd.conf.amandaclient.in0000664000076400007640000000025312357250001023064 0ustar00martineamartinea00000000000000#amanda stream tcp nowait amandabackup @amlibexecdir@/amandad -auth=bsdtcp amdump amanda stream tcp nowait amandabackup @amlibexecdir@/amandad amandad -auth=bsdtcp amdump amanda-3.3.6/example/amandaclient.xml.in0000664000076400007640000000451412357250001021641 0ustar00martineamartinea00000000000000 amanda-3.3.6/example/xinetd.amandaserver.in0000664000076400007640000000072212357250001022361 0ustar00martineamartinea00000000000000# default: on # # description: Amanda services for Amanda server and client. # service amanda { disable = no flags = IPv4 socket_type = stream protocol = tcp wait = no user = amandabackup group = disk groups = yes server = @amlibexecdir@/amandad server_args = -auth=bsdtcp amdump amindexd amidxtaped } amanda-3.3.6/example/chg-multi.conf0000664000076400007640000000507712357250001020637 0ustar00martineamartinea00000000000000# config file for the chg-multi tape changer program. # Used when tpchanger "chg-multi" is specified in amanda.conf. # chg-multi supports several configurations, with or without an actual # changer. Please see docs/TAPE.CHANGERS for a description # # chg-multi should actually work directly with any changer that allows # access to the slots via Unix devices that look to software like # regular tape drives. (that is, you don't need a changer driver...). # Configuration variables: # # 'multieject': use an 'mt offline' command to change to the next # tape, or multiple such commands for skipping several tapes at a # time. # # 'needeject': this option is incompatible with 'multieject'. This is # needed for changers accessed through several virtual tape # devices, when the changer needs the current tape to be ejected # before changing to another device. # # 'gravity': set this to 1 if the changer/stacker is unable to loop # back to the first tape after unloading the last one, or if you # don't want amanda to go through the tape stack looking for the # exact tape it wants instead of using the first acceptable one. # # slot X: The configuration file should list as many 'slot X' # statements as the number of slots supported by the changer or the # number of separate tape drives used. # For changers that need an 'mt offline' to load the next tape multieject 0 # Is this a gravity stacker that can't go backwards or cycle ? If # yes, set gravity to 1. gravity 0 # Does this tape-changer need an explicit eject command before loading # a new tape? If you are using multiple drives as a tape changer, you # don't want to do this, but if you are using an auto-changer that # allows access to the slots through Unix tape devices, it might block # the mount of a new slot until the old is explicitly ejected. In # that case, set needeject to 1. needeject 0 # On some machines there is a delay between when the eject command # finishes and the next tape is ready to be accessed. Set ejectdelay # to the number of seconds to wait after an eject command. This will # almost certainly be needed if multieject is set, probably not if # needeject is used. ejectdelay 0 # Names a status file where the current ``changer'' state is stored. statefile /usr/adm/amanda/csd/changer-status # What are the slot numbers used in the tape rack? firstslot 1 lastslot 4 # Enumerate the device files that go with the particular tape changer # slots. Don't forget to specify the no-rewind version of the device. slot 1 /dev/nrst8 slot 2 /dev/nrst9 slot 3 /dev/nrst10 slot 4 /dev/nrst11 amanda-3.3.6/server-src/0000775000076400007640000000000012357750430016541 5ustar00martineamartinea00000000000000amanda-3.3.6/server-src/Makefile.in0000664000076400007640000025576312357750241020630 0ustar00martineamartinea00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # Makefile for Amanda server programs. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake # Copyright (c) 2007-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com # SYNOPSIS: # # Automake magic to handle the various tasks of building scripts. Scripts can # be built down to extensionless executables (e.g., foo.pl -> foo), or to # files with the usual extension (foo-lib.sh.in -> foo.sh). # # Files which support it are syntax-checked when the user invokes 'make check', # unless the Makefile.am defines SKIP_CHECKS. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and # SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are # not substituted by config.status should be included in SCRIPTS_PERL, # SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed for # installation, then Automake will figure out that they should be distributed; # otherwise, include them in EXTRA_DIST. # # All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'. There is # a fix in place to run these syntax checks against the perl modules in the build # tree, rather than against the (potentially old) installed perl modules. # # To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g., # SCRIPTS_SHELL = $(selected_scripts) # SCRIPTS_EXTRA_DIST = $(all_scripts) # # USAGE: # # include $(top_srcdir)/config/automake/vars.am # include $(top_srcdir)/config/automake/scripts.am # ... # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk # sbin_SCRIPTS = not-subbed # SCRIPTS_EXTRA_DIST = util-script # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in # not-subbed util-script.pl # # To add extra flags to the perl checks (e.g., to add new -I flags), set # CHECK_PERL_FLAGS. # Implementation note: # # This file uses config.status to substitute @foo@ in those scripts while # converting them. It also adds the executable bits (a+x) to extensionless # files. The substitution works even though the files are not listed in # configure.in # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two # specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. # Each is a whitespace-separated list of commands, all of which are either # a variable assignment or a filename. Three variables are available: # # - dest= sets the destination directory to e.g., $(sbindir) # - chown= controls changes in ownership; value is first argument to chown # - chmod= controls changes in permissions; value is first argument to chmod # # The following special cases are available: # amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP) # root:setuid = root:$(SETUID_GROUP) # These variables might otherwise have problems with whitespace in the user/group # names. # # when a filename is seen, the currently active variables are applied. # # Note that scripts are data, not executables! # # EXAMPLE # # sbin_PROGRAMS = foo bar bing # libexec_PROGRAMS = pro gram # sbin_SCRIPTS = sk ript # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ # chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) # INSTALLPERMS_data = \ # dest=$(sbindir) chown=amanda chmod= \ # $(sbin_SCRIPTS) # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS # AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level # build directory is populated with a format suitable for shell interpretation, # with lines like this: # installperm "amanda:disk" "04750" "/usr/local/sbin/bing" # the arguments being, respectively, owner:group, mode, and filename. There will # be exactly one line for each file which has specific permissions. The intention # is that this file be used by packaging scripts to set correct permissions at install # time. Note that files which have no special permissions requirements do not appear # in this file at all, due to limitations of Automake. # vim:ft=automake VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) sbin_PROGRAMS = amadmin$(EXEEXT) amcheck$(EXEEXT) amflush$(EXEEXT) amlibexec_PROGRAMS = amindexd$(EXEEXT) amtrmidx$(EXEEXT) \ amtrmlog$(EXEEXT) driver$(EXEEXT) dumper$(EXEEXT) \ planner$(EXEEXT) chunker$(EXEEXT) @WANT_RESTORE_TRUE@am__append_2 = \ @WANT_RESTORE_TRUE@ amidxtaped @WANT_RESTORE_TRUE@am__append_3 = \ @WANT_RESTORE_TRUE@ amfetchdump \ @WANT_RESTORE_TRUE@ amrestore EXTRA_PROGRAMS = $(am__EXEEXT_1) subdir = server-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ $(top_srcdir)/config/macro-archive/xsltproc.m4 \ $(top_srcdir)/config/amanda/amplot.m4 \ $(top_srcdir)/config/amanda/as_needed.m4 \ $(top_srcdir)/config/amanda/bsd-security.m4 \ $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ $(top_srcdir)/config/amanda/bsdudp-security.m4 \ $(top_srcdir)/config/amanda/components.m4 \ $(top_srcdir)/config/amanda/compress.m4 \ $(top_srcdir)/config/amanda/config.m4 \ $(top_srcdir)/config/amanda/debugging.m4 \ $(top_srcdir)/config/amanda/defaults.m4 \ $(top_srcdir)/config/amanda/devprefix.m4 \ $(top_srcdir)/config/amanda/dirs.m4 \ $(top_srcdir)/config/amanda/documentation.m4 \ $(top_srcdir)/config/amanda/dumpers.m4 \ $(top_srcdir)/config/amanda/dvdrw-device.m4 \ $(top_srcdir)/config/amanda/flags.m4 \ $(top_srcdir)/config/amanda/flock.m4 \ $(top_srcdir)/config/amanda/funcs.m4 \ $(top_srcdir)/config/amanda/getfsent.m4 \ $(top_srcdir)/config/amanda/i18n.m4 \ $(top_srcdir)/config/amanda/ipv6.m4 \ $(top_srcdir)/config/amanda/krb5-security.m4 \ $(top_srcdir)/config/amanda/lfs.m4 \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/ndmp-device.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ $(top_srcdir)/config/amanda/s3-device.m4 \ $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ $(top_srcdir)/config/amanda/ssh-security.m4 \ $(top_srcdir)/config/amanda/summary.m4 \ $(top_srcdir)/config/amanda/swig.m4 \ $(top_srcdir)/config/amanda/syshacks.m4 \ $(top_srcdir)/config/amanda/tape.m4 \ $(top_srcdir)/config/amanda/types.m4 \ $(top_srcdir)/config/amanda/userid.m4 \ $(top_srcdir)/config/amanda/version.m4 \ $(top_srcdir)/config/gnulib/00gnulib.m4 \ $(top_srcdir)/config/gnulib/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/btowc.m4 \ $(top_srcdir)/config/gnulib/configmake.m4 \ $(top_srcdir)/config/gnulib/eealloc.m4 \ $(top_srcdir)/config/gnulib/environ.m4 \ $(top_srcdir)/config/gnulib/errno_h.m4 \ $(top_srcdir)/config/gnulib/euidaccess.m4 \ $(top_srcdir)/config/gnulib/exponentd.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ $(top_srcdir)/config/gnulib/extern-inline.m4 \ $(top_srcdir)/config/gnulib/fcntl-o.m4 \ $(top_srcdir)/config/gnulib/fcntl_h.m4 \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fseek.m4 \ $(top_srcdir)/config/gnulib/fseeko.m4 \ $(top_srcdir)/config/gnulib/fstat.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/ftell.m4 \ $(top_srcdir)/config/gnulib/ftello.m4 \ $(top_srcdir)/config/gnulib/ftruncate.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ $(top_srcdir)/config/gnulib/getgroups.m4 \ $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/group-member.m4 \ $(top_srcdir)/config/gnulib/hostent.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/inet_pton.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ $(top_srcdir)/config/gnulib/langinfo_h.m4 \ $(top_srcdir)/config/gnulib/largefile.m4 \ $(top_srcdir)/config/gnulib/localcharset.m4 \ $(top_srcdir)/config/gnulib/locale-fr.m4 \ $(top_srcdir)/config/gnulib/locale-ja.m4 \ $(top_srcdir)/config/gnulib/locale-zh.m4 \ $(top_srcdir)/config/gnulib/locale_h.m4 \ $(top_srcdir)/config/gnulib/localeconv.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ $(top_srcdir)/config/gnulib/lseek.m4 \ $(top_srcdir)/config/gnulib/lstat.m4 \ $(top_srcdir)/config/gnulib/malloc.m4 \ $(top_srcdir)/config/gnulib/mbrtowc.m4 \ $(top_srcdir)/config/gnulib/mbsinit.m4 \ $(top_srcdir)/config/gnulib/mbstate_t.m4 \ $(top_srcdir)/config/gnulib/mbtowc.m4 \ $(top_srcdir)/config/gnulib/memchr.m4 \ $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/mmap-anon.m4 \ $(top_srcdir)/config/gnulib/msvc-inval.m4 \ $(top_srcdir)/config/gnulib/msvc-nothrow.m4 \ $(top_srcdir)/config/gnulib/multiarch.m4 \ $(top_srcdir)/config/gnulib/netdb_h.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/nl_langinfo.m4 \ $(top_srcdir)/config/gnulib/nocrash.m4 \ $(top_srcdir)/config/gnulib/off_t.m4 \ $(top_srcdir)/config/gnulib/pathmax.m4 \ $(top_srcdir)/config/gnulib/physmem.m4 \ $(top_srcdir)/config/gnulib/printf.m4 \ $(top_srcdir)/config/gnulib/raise.m4 \ $(top_srcdir)/config/gnulib/read.m4 \ $(top_srcdir)/config/gnulib/regex.m4 \ $(top_srcdir)/config/gnulib/safe-read.m4 \ $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/secure_getenv.m4 \ $(top_srcdir)/config/gnulib/servent.m4 \ $(top_srcdir)/config/gnulib/signal_h.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socketlib.m4 \ $(top_srcdir)/config/gnulib/sockets.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stat.m4 \ $(top_srcdir)/config/gnulib/stdalign.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ $(top_srcdir)/config/gnulib/stddef_h.m4 \ $(top_srcdir)/config/gnulib/stdint.m4 \ $(top_srcdir)/config/gnulib/stdio_h.m4 \ $(top_srcdir)/config/gnulib/stdlib_h.m4 \ $(top_srcdir)/config/gnulib/string_h.m4 \ $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/sys_types_h.m4 \ $(top_srcdir)/config/gnulib/sys_uio_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ $(top_srcdir)/config/gnulib/threadlib.m4 \ $(top_srcdir)/config/gnulib/time_h.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/warn-on-use.m4 \ $(top_srcdir)/config/gnulib/wchar_h.m4 \ $(top_srcdir)/config/gnulib/wcrtomb.m4 \ $(top_srcdir)/config/gnulib/wctype_h.m4 \ $(top_srcdir)/config/gnulib/write.m4 \ $(top_srcdir)/config/gettext-macros/codeset.m4 \ $(top_srcdir)/config/gettext-macros/gettext.m4 \ $(top_srcdir)/config/gettext-macros/glibc21.m4 \ $(top_srcdir)/config/gettext-macros/iconv.m4 \ $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ $(top_srcdir)/config/gettext-macros/size_max.m4 \ $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ $(top_srcdir)/config/gettext-macros/wint_t.m4 \ $(top_srcdir)/config/gettext-macros/xsize.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/FULL_VERSION \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/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)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)" \ "$(DESTDIR)$(sbindir)" LTLIBRARIES = $(amlib_LTLIBRARIES) libamserver_la_DEPENDENCIES = ../device-src/libamdevice.la \ ../common-src/libamanda.la am_libamserver_la_OBJECTS = amindex.lo diskfile.lo driverio.lo \ cmdline.lo holding.lo infofile.lo logfile.lo tapefile.lo \ find.lo server_util.lo xfer-source-holding.lo libamserver_la_OBJECTS = $(am_libamserver_la_OBJECTS) libamserver_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamserver_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = diskfile$(EXEEXT) infofile$(EXEEXT) PROGRAMS = $(amlibexec_PROGRAMS) $(sbin_PROGRAMS) amadmin_SOURCES = amadmin.c amadmin_OBJECTS = amadmin.$(OBJEXT) amadmin_LDADD = $(LDADD) amadmin_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la amcheck_SOURCES = amcheck.c amcheck_OBJECTS = amcheck.$(OBJEXT) amcheck_LDADD = $(LDADD) amcheck_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la amflush_SOURCES = amflush.c amflush_OBJECTS = amflush.$(OBJEXT) amflush_LDADD = $(LDADD) amflush_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la am__objects_1 = amindexd.$(OBJEXT) disk_history.$(OBJEXT) \ list_dir.$(OBJEXT) am_amindexd_OBJECTS = $(am__objects_1) amindexd_OBJECTS = $(am_amindexd_OBJECTS) amindexd_DEPENDENCIES = $(LDADD) ../amandad-src/libamandad.la amtrmidx_SOURCES = amtrmidx.c amtrmidx_OBJECTS = amtrmidx.$(OBJEXT) amtrmidx_LDADD = $(LDADD) amtrmidx_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la amtrmlog_SOURCES = amtrmlog.c amtrmlog_OBJECTS = amtrmlog.$(OBJEXT) amtrmlog_LDADD = $(LDADD) amtrmlog_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la chunker_SOURCES = chunker.c chunker_OBJECTS = chunker.$(OBJEXT) chunker_LDADD = $(LDADD) chunker_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la am_diskfile_OBJECTS = diskfile.test.$(OBJEXT) diskfile_OBJECTS = $(am_diskfile_OBJECTS) diskfile_LDADD = $(LDADD) diskfile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la driver_SOURCES = driver.c driver_OBJECTS = driver.$(OBJEXT) driver_LDADD = $(LDADD) driver_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la dumper_SOURCES = dumper.c dumper_OBJECTS = dumper.$(OBJEXT) dumper_LDADD = $(LDADD) dumper_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la am_infofile_OBJECTS = infofile.test.$(OBJEXT) infofile_OBJECTS = $(am_infofile_OBJECTS) infofile_LDADD = $(LDADD) infofile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la planner_SOURCES = planner.c planner_OBJECTS = planner.$(OBJEXT) planner_LDADD = $(LDADD) planner_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \ ../device-src/libamdevice.la ../common-src/libamanda.la SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c amflush.c \ $(amindexd_SOURCES) amtrmidx.c amtrmlog.c chunker.c \ $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \ planner.c DIST_SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c amflush.c \ $(amindexd_SOURCES) amtrmidx.c amtrmlog.c chunker.c \ $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \ planner.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_COMPONENTS = @AMANDA_COMPONENTS@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARFLAGS = @ARFLAGS@ ASSERTIONS = @ASSERTIONS@ AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ BINARY_OWNER = @BINARY_OWNER@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ BSDTAR = @BSDTAR@ BSDTCP_SECURITY = @BSDTCP_SECURITY@ BSDUDP_SECURITY = @BSDUDP_SECURITY@ BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_USERID = @CHECK_USERID@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ COMPRESS_PATH = @COMPRESS_PATH@ COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DSYMUTIL = @DSYMUTIL@ DUMP = @DUMP@ DUMPBIN = @DUMPBIN@ DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLOAT_H = @FLOAT_H@ GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETCONF = @GETCONF@ GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GIT = @GIT@ GLIBC21 = @GLIBC21@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_ACCEPT = @GNULIB_ACCEPT@ GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_BIND = @GNULIB_BIND@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_CONNECT = @GNULIB_CONNECT@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ GNULIB_FPURGE = @GNULIB_FPURGE@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSCANF = @GNULIB_FSCANF@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FSTAT = @GNULIB_FSTAT@ GNULIB_FSTATAT = @GNULIB_FSTATAT@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETC = @GNULIB_GETC@ GNULIB_GETCHAR = @GNULIB_GETCHAR@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ GNULIB_MKNOD = @GNULIB_MKNOD@ GNULIB_MKNODAT = @GNULIB_MKNODAT@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_MKTIME = @GNULIB_MKTIME@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RECV = @GNULIB_RECV@ GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_REMOVE = @GNULIB_REMOVE@ GNULIB_RENAME = @GNULIB_RENAME@ GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SCANF = @GNULIB_SCANF@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SEND = @GNULIB_SEND@ GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGACTION = @GNULIB_SIGACTION@ GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ GNULIB_STAT = @GNULIB_STAT@ GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRPTIME = @GNULIB_STRPTIME@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VFSCANF = @GNULIB_VFSCANF@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ GNULIB_WCSCAT = @GNULIB_WCSCAT@ GNULIB_WCSCHR = @GNULIB_WCSCHR@ GNULIB_WCSCMP = @GNULIB_WCSCMP@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ GNULIB_WCSSPN = @GNULIB_WCSSPN@ GNULIB_WCSSTR = @GNULIB_WCSSTR@ GNULIB_WCSTOK = @GNULIB_WCSTOK@ GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WCTRANS = @GNULIB_WCTRANS@ GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKFIFO = @HAVE_MKFIFO@ HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ HAVE_MKNOD = @HAVE_MKNOD@ HAVE_MKNODAT = @HAVE_MKNODAT@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RENAMEAT = @HAVE_RENAMEAT@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE_WCPCPY = @HAVE_WCPCPY@ HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ HAVE_WCSCAT = @HAVE_WCSCAT@ HAVE_WCSCHR = @HAVE_WCSCHR@ HAVE_WCSCMP = @HAVE_WCSCMP@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ HAVE_WCSNCMP = @HAVE_WCSNCMP@ HAVE_WCSNCPY = @HAVE_WCSNCPY@ HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ HAVE_WCSPBRK = @HAVE_WCSPBRK@ HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCSSPN = @HAVE_WCSSPN@ HAVE_WCSSTR = @HAVE_WCSSTR@ HAVE_WCSTOK = @HAVE_WCSTOK@ HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ HAVE_WCSXFRM = @HAVE_WCSXFRM@ HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WMEMCHR = @HAVE_WMEMCHR@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HOSTENT_LIB = @HOSTENT_LIB@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INET_NTOP_LIB = @INET_NTOP_LIB@ INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KRB5_SECURITY = @KRB5_SECURITY@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBSOCKET = @LIBSOCKET@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_EACCESS = @LIB_EACCESS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ LOCALE_ZH_CN = @LOCALE_ZH_CN@ LOCKING = @LOCKING@ LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LPR = @LPR@ LPRFLAG = @LPRFLAG@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOUNT = @MOUNT@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NC = @NC@ NC6 = @NC6@ NETCAT = @NETCAT@ NETINET_IN_H = @NETINET_IN_H@ NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ PERLEXTLIBS = @PERLEXTLIBS@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PS = @PS@ PS_ARGUMENT = @PS_ARGUMENT@ PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FSTAT = @REPLACE_FSTAT@ REPLACE_FSTATAT = @REPLACE_FSTATAT@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMOVE = @REPLACE_REMOVE@ REPLACE_RENAME = @REPLACE_RENAME@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ RESTORE = @RESTORE@ RPCGEN = @RPCGEN@ RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ SED = @SED@ SERVENT_LIB = @SERVENT_LIB@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ SSH_SECURITY = @SSH_SECURITY@ STAR = @STAR@ STDALIGN_H = @STDALIGN_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUNTAR = @SUNTAR@ SVN = @SVN@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TCPPORTRANGE = @TCPPORTRANGE@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UDPPORTRANGE = @UDPPORTRANGE@ UMOUNT = @UMOUNT@ UNAME = @UNAME@ UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ USE_RUNDUMP = @USE_RUNDUMP@ VDUMP = @VDUMP@ VERSION = @VERSION@ VERSION_COMMENT = @VERSION_COMMENT@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XFSDUMP = @XFSDUMP@ XFSRESTORE = @XFSRESTORE@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XSLREL = @XSLREL@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ _libcurl_config = @_libcurl_config@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ amperldir = @amperldir@ 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@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = # config.status leaves config.log files around CLEANFILES = config.log *.test.c # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ $(SCRIPTS_INCLUDE) $(am__append_1) MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| @WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" # define a snippet of the scripts below to either perform a chown/chmod operation, # or record that operation in the logfile. On entry to the snippet, $$dest is the # destination directory, $$cmd is the srcdir-relative pathname of the target file, # $$chown is the ownership, and $$chmod is the permission pattern. @WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ @WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi; \ @WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ @WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ @WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ @WANT_INSTALLPERMS_TRUE@ fi @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" do_installperms = dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ chown=amanda:setuid) \ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ chown=root:setuid) \ echo " ($$cmd)"; chown="root:$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ *) $(do_file) ;; \ esac; \ done INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/amandad-src \ -I$(top_srcdir)/device-src \ -I$(top_srcdir)/xfer-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS) LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) amlib_LTLIBRARIES = libamserver.la amlibexec_SCRIPTS_PERL = amlogroll amdumpd taper amcheck-device \ $(am__append_2) sbin_SCRIPTS_PERL = amaddclient amoverview amserverconfig amtoc \ amcheckdump amcleanup amcleanupdisk amrmtape amlabel amreport \ amtape amvault amdump amstatus $(am__append_3) sbin_SCRIPTS_SHELL = \ amcheckdb SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL) sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL) amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL) INSTALLPERMS_exec = \ dest=$(sbindir) chown=root:setuid chmod=04750 \ amcheck \ dest=$(amlibexecdir) \ dumper planner ### # Because libamanda includes routines (e.g. regex) provided by some system # libraries, and because of the way libtool sets up the command line, we # need to list libamanda twice here, first to override the system library # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ libamserver.la \ ../device-src/libamdevice.la \ ../common-src/libamanda.la libamserver_la_SOURCES = amindex.c \ diskfile.c driverio.c cmdline.c \ holding.c infofile.c logfile.c \ tapefile.c find.c server_util.c \ xfer-source-holding.c libamserver_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS) libamserver_la_LIBADD = ../device-src/libamdevice.la \ ../common-src/libamanda.la amindexd_LDADD = $(LDADD) \ ../amandad-src/libamandad.la # there are used for testing only: TEST_PROGS = diskfile infofile amindexd_CSRC = amindexd.c disk_history.c list_dir.c amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC) noinst_HEADERS = amindex.h cmdline.h \ diskfile.h driverio.h \ holding.h infofile.h logfile.h \ tapefile.h find.h server_util.h \ xfer-server.h diskfile_SOURCES = diskfile.test.c infofile_SOURCES = infofile.test.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu server-src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu server-src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am: $(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-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || 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)$(amlibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \ } uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \ done clean-amlibLTLIBRARIES: -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libamserver.la: $(libamserver_la_OBJECTS) $(libamserver_la_DEPENDENCIES) $(EXTRA_libamserver_la_DEPENDENCIES) $(libamserver_la_LINK) -rpath $(amlibdir) $(libamserver_la_OBJECTS) $(libamserver_la_LIBADD) $(LIBS) install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || 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)$(amlibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files clean-amlibexecPROGRAMS: @list='$(amlibexec_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 amadmin$(EXEEXT): $(amadmin_OBJECTS) $(amadmin_DEPENDENCIES) $(EXTRA_amadmin_DEPENDENCIES) @rm -f amadmin$(EXEEXT) $(LINK) $(amadmin_OBJECTS) $(amadmin_LDADD) $(LIBS) amcheck$(EXEEXT): $(amcheck_OBJECTS) $(amcheck_DEPENDENCIES) $(EXTRA_amcheck_DEPENDENCIES) @rm -f amcheck$(EXEEXT) $(LINK) $(amcheck_OBJECTS) $(amcheck_LDADD) $(LIBS) amflush$(EXEEXT): $(amflush_OBJECTS) $(amflush_DEPENDENCIES) $(EXTRA_amflush_DEPENDENCIES) @rm -f amflush$(EXEEXT) $(LINK) $(amflush_OBJECTS) $(amflush_LDADD) $(LIBS) amindexd$(EXEEXT): $(amindexd_OBJECTS) $(amindexd_DEPENDENCIES) $(EXTRA_amindexd_DEPENDENCIES) @rm -f amindexd$(EXEEXT) $(LINK) $(amindexd_OBJECTS) $(amindexd_LDADD) $(LIBS) amtrmidx$(EXEEXT): $(amtrmidx_OBJECTS) $(amtrmidx_DEPENDENCIES) $(EXTRA_amtrmidx_DEPENDENCIES) @rm -f amtrmidx$(EXEEXT) $(LINK) $(amtrmidx_OBJECTS) $(amtrmidx_LDADD) $(LIBS) amtrmlog$(EXEEXT): $(amtrmlog_OBJECTS) $(amtrmlog_DEPENDENCIES) $(EXTRA_amtrmlog_DEPENDENCIES) @rm -f amtrmlog$(EXEEXT) $(LINK) $(amtrmlog_OBJECTS) $(amtrmlog_LDADD) $(LIBS) chunker$(EXEEXT): $(chunker_OBJECTS) $(chunker_DEPENDENCIES) $(EXTRA_chunker_DEPENDENCIES) @rm -f chunker$(EXEEXT) $(LINK) $(chunker_OBJECTS) $(chunker_LDADD) $(LIBS) diskfile$(EXEEXT): $(diskfile_OBJECTS) $(diskfile_DEPENDENCIES) $(EXTRA_diskfile_DEPENDENCIES) @rm -f diskfile$(EXEEXT) $(LINK) $(diskfile_OBJECTS) $(diskfile_LDADD) $(LIBS) driver$(EXEEXT): $(driver_OBJECTS) $(driver_DEPENDENCIES) $(EXTRA_driver_DEPENDENCIES) @rm -f driver$(EXEEXT) $(LINK) $(driver_OBJECTS) $(driver_LDADD) $(LIBS) dumper$(EXEEXT): $(dumper_OBJECTS) $(dumper_DEPENDENCIES) $(EXTRA_dumper_DEPENDENCIES) @rm -f dumper$(EXEEXT) $(LINK) $(dumper_OBJECTS) $(dumper_LDADD) $(LIBS) infofile$(EXEEXT): $(infofile_OBJECTS) $(infofile_DEPENDENCIES) $(EXTRA_infofile_DEPENDENCIES) @rm -f infofile$(EXEEXT) $(LINK) $(infofile_OBJECTS) $(infofile_LDADD) $(LIBS) planner$(EXEEXT): $(planner_OBJECTS) $(planner_DEPENDENCIES) $(EXTRA_planner_DEPENDENCIES) @rm -f planner$(EXEEXT) $(LINK) $(planner_OBJECTS) $(planner_LDADD) $(LIBS) install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(amlibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" || 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)$(amlibexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-amlibexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(amlibexec_SCRIPTS)'; test -n "$(amlibexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(amlibexecdir)'; $(am__uninstall_files_from_dir) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; 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 \ 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)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amadmin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindexd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmidx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmlog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disk_history.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskfile.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driverio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/holding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infofile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infofile.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/planner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapefile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-source-holding.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @SYNTAX_CHECKS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-amlibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \ install-sbinPROGRAMS install-sbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ uninstall-amlibexecSCRIPTS uninstall-sbinPROGRAMS \ uninstall-sbinSCRIPTS .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ clean-libtool clean-sbinPROGRAMS ctags dist-hook distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-amlibLTLIBRARIES \ install-amlibexecPROGRAMS install-amlibexecSCRIPTS \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-sbinPROGRAMS install-sbinSCRIPTS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ uninstall-amlibexecSCRIPTS uninstall-sbinPROGRAMS \ uninstall-sbinSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ @SYNTAX_CHECKS_TRUE@ @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ @SYNTAX_CHECKS_TRUE@ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \ @SYNTAX_CHECKS_TRUE@ rm $@.nouselib; \ @SYNTAX_CHECKS_TRUE@ else \ @SYNTAX_CHECKS_TRUE@ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \ @SYNTAX_CHECKS_TRUE@ fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< %.pm: %.pm.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Shell %: %.sh $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.sh: %.sh.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # Awk %: %.awk $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ %.awk: %.awk.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< # syntax-check perl scripts on an explicit 'make check', but only if # SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl # modules in the install tree, and can trip up unsuspecting users. check-perl: $(SCRIPTS_PERL) @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ for perlobj in $$SCRIPTS_PERL; do \ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \ rm $$perlobj.nouselib; \ done; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-perl # syntax-check shell scripts on an explicit 'make check' check-shell: $(SCRIPTS_SHELL) @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \ if test x"$(SKIP_CHECKS)" = x"" && \ test -n "$$SCRIPTS_SHELL"; then \ if test -n "$(BASH)"; then \ for shobj in $$SCRIPTS_SHELL; do \ if $(BASH) -n $$shobj; then \ echo "$$shobj syntax OK"; \ else \ echo "$$shobj syntax error"; \ exit 1; \ fi; \ done; \ else \ echo "No 'bash' available -- cannot syntax-check shell scripts"; \ fi; \ fi @SYNTAX_CHECKS_TRUE@check-local: check-shell # make sure that the sources for all shell and perl scripts get included # in the distribution dist-scripts: @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \ SCRIPTS_DIST=; \ for script in $$SCRIPTS_PERL; do \ test -f $(srcdir)/$${script}.pl && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \ done; \ for script in $$SCRIPTS_SHELL; do \ test -f $(srcdir)/$${script}.sh && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \ done; \ for script in $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.awk && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \ done; \ for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ test -f $(srcdir)/$${script}.in && \ SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \ done; \ for script in $$SCRIPTS_DIST; do \ dir=`dirname $${script}`; \ if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \ mkdir -p "$(distdir)/$$dir" || exit 1; \ fi; \ test -f "$(distdir)/$${script}" && continue; \ echo "distributing $${script}"; \ cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \ done; \ true dist-hook: dist-scripts installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ $(do_installperms) installperms-data: @installperms="$(INSTALLPERMS_data)"; \ test -n "$$installperms" && echo "Setting installation permissions on data"; \ $(do_installperms) install-exec-hook: installperms-exec install-data-hook: installperms-data # define a rule to initialize the installperms manifest file @WANT_INSTALLPERMS_TRUE@installperms-init: @WANT_INSTALLPERMS_FALSE@installperms-init: @WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange # architectures. With this rule, we can ask users to 'make foo.i' and send # the result to us. # # It touches some automake internals ($COMPILE), but since it's not # build-critical, that's OK. %.i : %.c $(COMPILE) -E -o $@ $< lint: @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do \ p=`basename $$p $(EXEEXT)`; \ if [ $$p = "amindexd" ]; then \ s="$(amindexd_CSRC)"; \ else \ s=$$p.c; \ fi; \ f="$$s $(libamserver_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ fi; \ done; \ exit 0 listlibsrc: @ for p in $(libamserver_la_SOURCES); do \ listlibsrcs="$$listlibsrcs `pwd`/$$p"; \ done; \ echo $$listlibsrcs >listlibsrc.output %.test.c: $(srcdir)/%.c echo '#define TEST' >$@ echo '#include "$<"' >>$@ # 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: amanda-3.3.6/server-src/taper.pl0000664000076400007640000000504212357250005020203 0ustar00martineamartinea00000000000000#! @PERL@ # Copyright (c) 2009-2013 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use lib '@amperldir@'; use strict; use warnings; package main; use Amanda::Util qw( :constants ); use Amanda::Config qw( :init :getconf ); use Amanda::Logfile qw( :logtype_t log_add $amanda_log_trace_log ); use Amanda::Debug qw( debug ); use Amanda::Taper::Controller; use Getopt::Long; Amanda::Util::setup_application("taper", "server", $CONTEXT_DAEMON); my $config_overrides = new_config_overrides($#ARGV+1); debug("Arguments: " . join(' ', @ARGV)); Getopt::Long::Configure(qw{bundling}); GetOptions( 'version' => \&Amanda::Util::version_opt, 'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); }, ) or usage(); if (@ARGV != 1) { die "USAGE: taper "; } set_config_overrides($config_overrides); config_init($CONFIG_INIT_EXPLICIT_NAME, $ARGV[0]); my ($cfgerr_level, @cfgerr_errors) = config_errors(); if ($cfgerr_level >= $CFGERR_WARNINGS) { config_print_errors(); if ($cfgerr_level >= $CFGERR_ERRORS) { die "Errors processing config file"; } } # our STDERR is connected to the amdump log file, so be sure to do unbuffered # writes to that file my $old_fh = select(STDERR); $| = 1; select($old_fh); log_add($L_INFO, "taper pid $$"); Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log); Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER); my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST)); my $tl = Amanda::Tapelist->new($tlf); # transfer control to the Amanda::Taper::Controller class implemented above my $controller = Amanda::Taper::Controller->new(tapelist => $tl); $controller->start(); Amanda::MainLoop::run(); log_add($L_INFO, "pid-done $$"); Amanda::Util::finish_application(); amanda-3.3.6/server-src/amrmtape.pl0000664000076400007640000002161312357250005020700 0ustar00martineamartinea00000000000000#!@PERL@ # # Copyright (c) 2008-2013 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # use lib '@amperldir@'; use strict; use warnings; use Amanda::Config qw( :init :getconf config_print_errors config_dir_relative new_config_overrides add_config_override); use Amanda::Changer; use Amanda::Device qw( :constants ); use Amanda::Debug qw( :logging ); use Amanda::Disklist; use Amanda::Paths; use Amanda::MainLoop; use Amanda::Tapelist; use Amanda::Util qw( :constants ); use File::Copy; use File::Basename; use Getopt::Long; my $amadmin = "$sbindir/amadmin"; my $amtrmidx = "$amlibexecdir/amtrmidx"; my $amtrmlog = "$amlibexecdir/amtrmlog"; my $dry_run; my $cleanup; my $erase; my $changer_name; my $keep_label; my $verbose = 1; my $help; sub usage() { print <